From 394b73e5779484907c3c9934adf2dec21d54f1e5 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Mon, 22 May 2023 16:32:58 +0800 Subject: [PATCH] networkcloud release (#25807) https://github.com/Azure/sdk-release-request/issues/4073 Recording: https://github.com/Azure/azure-sdk-assets/tree/js/networkcloud/arm-networkcloud_f8ed294c81 --- common/config/rush/pnpm-lock.yaml | 46 +- eng/ignore-links.txt | 1 + rush.json | 9 +- .../arm-networkcloud/CHANGELOG.md | 5 + sdk/networkcloud/arm-networkcloud/LICENSE | 21 + sdk/networkcloud/arm-networkcloud/README.md | 109 + sdk/networkcloud/arm-networkcloud/_meta.json | 8 + .../arm-networkcloud/api-extractor.json | 31 + sdk/networkcloud/arm-networkcloud/assets.json | 6 + .../arm-networkcloud/package.json | 123 + .../review/arm-networkcloud.api.md | 3728 ++++++++++ .../arm-networkcloud/rollup.config.js | 122 + sdk/networkcloud/arm-networkcloud/sample.env | 4 + ...MetalMachineKeySetsCreateOrUpdateSample.ts | 79 + .../bareMetalMachineKeySetsDeleteSample.ts | 44 + .../bareMetalMachineKeySetsGetSample.ts | 44 + ...MachineKeySetsListByResourceGroupSample.ts | 45 + .../bareMetalMachineKeySetsUpdateSample.ts | 77 + .../bareMetalMachinesCordonSample.ts | 53 + .../bareMetalMachinesCreateOrUpdateSample.ts | 65 + .../bareMetalMachinesDeleteSample.ts | 44 + .../samples-dev/bareMetalMachinesGetSample.ts | 42 + ...eMetalMachinesListByResourceGroupSample.ts | 43 + ...reMetalMachinesListBySubscriptionSample.ts | 39 + .../bareMetalMachinesPowerOffSample.ts | 53 + .../bareMetalMachinesReimageSample.ts | 42 + .../bareMetalMachinesReplaceSample.ts | 57 + .../bareMetalMachinesRestartSample.ts | 42 + .../bareMetalMachinesRunCommandSample.ts | 51 + .../bareMetalMachinesRunDataExtractsSample.ts | 50 + .../bareMetalMachinesRunReadCommandsSample.ts | 53 + .../bareMetalMachinesStartSample.ts | 42 + .../bareMetalMachinesUncordonSample.ts | 42 + .../bareMetalMachinesUpdateSample.ts | 54 + ...bareMetalMachinesValidateHardwareSample.ts | 49 + .../bmcKeySetsCreateOrUpdateSample.ts | 77 + .../samples-dev/bmcKeySetsDeleteSample.ts | 44 + .../samples-dev/bmcKeySetsGetSample.ts | 44 + .../bmcKeySetsListByResourceGroupSample.ts | 45 + .../samples-dev/bmcKeySetsUpdateSample.ts | 74 + ...oudServicesNetworksCreateOrUpdateSample.ts | 64 + .../cloudServicesNetworksDeleteSample.ts | 42 + .../cloudServicesNetworksGetSample.ts | 42 + ...rvicesNetworksListByResourceGroupSample.ts | 43 + ...ervicesNetworksListBySubscriptionSample.ts | 39 + .../cloudServicesNetworksUpdateSample.ts | 65 + .../clusterManagersCreateOrUpdateSample.ts | 55 + .../clusterManagersDeleteSample.ts | 42 + .../samples-dev/clusterManagersGetSample.ts | 42 + ...lusterManagersListByResourceGroupSample.ts | 43 + ...clusterManagersListBySubscriptionSample.ts | 39 + .../clusterManagersUpdateSample.ts | 53 + .../clustersCreateOrUpdateSample.ts | 148 + .../samples-dev/clustersDeleteSample.ts | 42 + .../samples-dev/clustersDeploySample.ts | 76 + .../samples-dev/clustersGetSample.ts | 39 + .../clustersListByResourceGroupSample.ts | 43 + .../clustersListBySubscriptionSample.ts | 39 + .../samples-dev/clustersUpdateSample.ts | 120 + .../clustersUpdateVersionSample.ts | 49 + .../consolesCreateOrUpdateSample.ts | 60 + .../samples-dev/consolesDeleteSample.ts | 44 + .../samples-dev/consolesGetSample.ts | 44 + .../consolesListByResourceGroupSample.ts | 45 + .../samples-dev/consolesUpdateSample.ts | 59 + .../defaultCniNetworksCreateOrUpdateSample.ts | 66 + .../defaultCniNetworksDeleteSample.ts | 42 + .../defaultCniNetworksGetSample.ts | 42 + ...ultCniNetworksListByResourceGroupSample.ts | 43 + ...aultCniNetworksListBySubscriptionSample.ts | 39 + .../defaultCniNetworksUpdateSample.ts | 53 + .../hybridAksClustersCreateOrUpdateSample.ts | 61 + .../hybridAksClustersDeleteSample.ts | 44 + .../samples-dev/hybridAksClustersGetSample.ts | 42 + ...ridAksClustersListByResourceGroupSample.ts | 43 + ...bridAksClustersListBySubscriptionSample.ts | 39 + .../hybridAksClustersRestartNodeSample.ts | 49 + .../hybridAksClustersUpdateSample.ts | 53 + .../l2NetworksCreateOrUpdateSample.ts | 56 + .../samples-dev/l2NetworksDeleteSample.ts | 42 + .../samples-dev/l2NetworksGetSample.ts | 39 + .../l2NetworksListByResourceGroupSample.ts | 43 + .../l2NetworksListBySubscriptionSample.ts | 39 + .../samples-dev/l2NetworksUpdateSample.ts | 51 + .../l3NetworksCreateOrUpdateSample.ts | 61 + .../samples-dev/l3NetworksDeleteSample.ts | 42 + .../samples-dev/l3NetworksGetSample.ts | 39 + .../l3NetworksListByResourceGroupSample.ts | 43 + .../l3NetworksListBySubscriptionSample.ts | 39 + .../samples-dev/l3NetworksUpdateSample.ts | 51 + ...tricsConfigurationsCreateOrUpdateSample.ts | 59 + .../metricsConfigurationsDeleteSample.ts | 44 + .../metricsConfigurationsGetSample.ts | 44 + ...ConfigurationsListByResourceGroupSample.ts | 45 + .../metricsConfigurationsUpdateSample.ts | 57 + .../samples-dev/operationsListSample.ts | 40 + .../samples-dev/rackSkusGetSample.ts | 37 + .../rackSkusListBySubscriptionSample.ts | 39 + .../samples-dev/racksCreateOrUpdateSample.ts | 58 + .../samples-dev/racksDeleteSample.ts | 44 + .../samples-dev/racksGetSample.ts | 39 + .../racksListByResourceGroupSample.ts | 41 + .../racksListBySubscriptionSample.ts | 39 + .../samples-dev/racksUpdateSample.ts | 53 + .../storageAppliancesCreateOrUpdateSample.ts | 60 + .../storageAppliancesDeleteSample.ts | 44 + ...ncesDisableRemoteVendorManagementSample.ts | 42 + ...ancesEnableRemoteVendorManagementSample.ts | 53 + .../samples-dev/storageAppliancesGetSample.ts | 42 + ...rageAppliancesListByResourceGroupSample.ts | 43 + ...orageAppliancesListBySubscriptionSample.ts | 39 + .../storageAppliancesRunReadCommandsSample.ts | 50 + .../storageAppliancesUpdateSample.ts | 54 + ...storageAppliancesValidateHardwareSample.ts | 49 + .../trunkedNetworksCreateOrUpdateSample.ts | 59 + .../trunkedNetworksDeleteSample.ts | 42 + .../samples-dev/trunkedNetworksGetSample.ts | 42 + ...runkedNetworksListByResourceGroupSample.ts | 43 + ...trunkedNetworksListBySubscriptionSample.ts | 39 + .../trunkedNetworksUpdateSample.ts | 53 + .../virtualMachinesAttachVolumeSample.ts | 50 + .../virtualMachinesCreateOrUpdateSample.ts | 106 + .../virtualMachinesDeleteSample.ts | 42 + .../virtualMachinesDetachVolumeSample.ts | 50 + .../samples-dev/virtualMachinesGetSample.ts | 42 + ...irtualMachinesListByResourceGroupSample.ts | 43 + ...virtualMachinesListBySubscriptionSample.ts | 39 + .../virtualMachinesPowerOffSample.ts | 53 + .../virtualMachinesReimageSample.ts | 42 + .../virtualMachinesRestartSample.ts | 42 + .../samples-dev/virtualMachinesStartSample.ts | 42 + .../virtualMachinesUpdateSample.ts | 58 + .../volumesCreateOrUpdateSample.ts | 53 + .../samples-dev/volumesDeleteSample.ts | 42 + .../samples-dev/volumesGetSample.ts | 39 + .../volumesListByResourceGroupSample.ts | 43 + .../volumesListBySubscriptionSample.ts | 39 + .../samples-dev/volumesUpdateSample.ts | 51 + .../samples/v1-beta/javascript/README.md | 298 + ...MetalMachineKeySetsCreateOrUpdateSample.js | 72 + .../bareMetalMachineKeySetsDeleteSample.js | 40 + .../bareMetalMachineKeySetsGetSample.js | 40 + ...MachineKeySetsListByResourceGroupSample.js | 41 + .../bareMetalMachineKeySetsUpdateSample.js | 67 + .../bareMetalMachinesCordonSample.js | 45 + .../bareMetalMachinesCreateOrUpdateSample.js | 60 + .../bareMetalMachinesDeleteSample.js | 40 + .../javascript/bareMetalMachinesGetSample.js | 35 + ...eMetalMachinesListByResourceGroupSample.js | 37 + ...reMetalMachinesListBySubscriptionSample.js | 36 + .../bareMetalMachinesPowerOffSample.js | 45 + .../bareMetalMachinesReimageSample.js | 38 + .../bareMetalMachinesReplaceSample.js | 49 + .../bareMetalMachinesRestartSample.js | 38 + .../bareMetalMachinesRunCommandSample.js | 44 + .../bareMetalMachinesRunDataExtractsSample.js | 43 + .../bareMetalMachinesRunReadCommandsSample.js | 46 + .../bareMetalMachinesStartSample.js | 38 + .../bareMetalMachinesUncordonSample.js | 38 + .../bareMetalMachinesUpdateSample.js | 46 + ...bareMetalMachinesValidateHardwareSample.js | 42 + .../bmcKeySetsCreateOrUpdateSample.js | 70 + .../javascript/bmcKeySetsDeleteSample.js | 40 + .../v1-beta/javascript/bmcKeySetsGetSample.js | 36 + .../bmcKeySetsListByResourceGroupSample.js | 38 + .../javascript/bmcKeySetsUpdateSample.js | 64 + ...oudServicesNetworksCreateOrUpdateSample.js | 59 + .../cloudServicesNetworksDeleteSample.js | 38 + .../cloudServicesNetworksGetSample.js | 38 + ...rvicesNetworksListByResourceGroupSample.js | 37 + ...ervicesNetworksListBySubscriptionSample.js | 36 + .../cloudServicesNetworksUpdateSample.js | 57 + .../clusterManagersCreateOrUpdateSample.js | 51 + .../javascript/clusterManagersDeleteSample.js | 38 + .../javascript/clusterManagersGetSample.js | 35 + ...lusterManagersListByResourceGroupSample.js | 37 + ...clusterManagersListBySubscriptionSample.js | 36 + .../javascript/clusterManagersUpdateSample.js | 45 + .../clustersCreateOrUpdateSample.js | 143 + .../javascript/clustersDeleteSample.js | 35 + .../javascript/clustersDeploySample.js | 58 + .../v1-beta/javascript/clustersGetSample.js | 35 + .../clustersListByResourceGroupSample.js | 37 + .../clustersListBySubscriptionSample.js | 36 + .../javascript/clustersUpdateSample.js | 102 + .../javascript/clustersUpdateVersionSample.js | 42 + .../consolesCreateOrUpdateSample.js | 55 + .../javascript/consolesDeleteSample.js | 40 + .../v1-beta/javascript/consolesGetSample.js | 36 + .../consolesListByResourceGroupSample.js | 41 + .../javascript/consolesUpdateSample.js | 51 + .../defaultCniNetworksCreateOrUpdateSample.js | 59 + .../defaultCniNetworksDeleteSample.js | 38 + .../javascript/defaultCniNetworksGetSample.js | 35 + ...ultCniNetworksListByResourceGroupSample.js | 37 + ...aultCniNetworksListBySubscriptionSample.js | 36 + .../defaultCniNetworksUpdateSample.js | 45 + .../hybridAksClustersCreateOrUpdateSample.js | 56 + .../hybridAksClustersDeleteSample.js | 40 + .../javascript/hybridAksClustersGetSample.js | 35 + ...ridAksClustersListByResourceGroupSample.js | 37 + ...bridAksClustersListBySubscriptionSample.js | 36 + .../hybridAksClustersRestartNodeSample.js | 42 + .../hybridAksClustersUpdateSample.js | 45 + .../l2NetworksCreateOrUpdateSample.js | 51 + .../javascript/l2NetworksDeleteSample.js | 35 + .../v1-beta/javascript/l2NetworksGetSample.js | 35 + .../l2NetworksListByResourceGroupSample.js | 37 + .../l2NetworksListBySubscriptionSample.js | 36 + .../javascript/l2NetworksUpdateSample.js | 39 + .../l3NetworksCreateOrUpdateSample.js | 56 + .../javascript/l3NetworksDeleteSample.js | 35 + .../v1-beta/javascript/l3NetworksGetSample.js | 35 + .../l3NetworksListByResourceGroupSample.js | 37 + .../l3NetworksListBySubscriptionSample.js | 36 + .../javascript/l3NetworksUpdateSample.js | 39 + ...tricsConfigurationsCreateOrUpdateSample.js | 51 + .../metricsConfigurationsDeleteSample.js | 40 + .../metricsConfigurationsGetSample.js | 40 + ...ConfigurationsListByResourceGroupSample.js | 41 + .../metricsConfigurationsUpdateSample.js | 49 + .../javascript/operationsListSample.js | 37 + .../samples/v1-beta/javascript/package.json | 32 + .../v1-beta/javascript/rackSkusGetSample.js | 34 + .../rackSkusListBySubscriptionSample.js | 36 + .../javascript/racksCreateOrUpdateSample.js | 53 + .../v1-beta/javascript/racksDeleteSample.js | 37 + .../v1-beta/javascript/racksGetSample.js | 35 + .../racksListByResourceGroupSample.js | 37 + .../racksListBySubscriptionSample.js | 36 + .../v1-beta/javascript/racksUpdateSample.js | 41 + .../samples/v1-beta/javascript/sample.env | 4 + .../storageAppliancesCreateOrUpdateSample.js | 55 + .../storageAppliancesDeleteSample.js | 40 + ...ncesDisableRemoteVendorManagementSample.js | 38 + ...ancesEnableRemoteVendorManagementSample.js | 45 + .../javascript/storageAppliancesGetSample.js | 35 + ...rageAppliancesListByResourceGroupSample.js | 37 + ...orageAppliancesListBySubscriptionSample.js | 36 + .../storageAppliancesRunReadCommandsSample.js | 43 + .../storageAppliancesUpdateSample.js | 46 + ...storageAppliancesValidateHardwareSample.js | 42 + .../trunkedNetworksCreateOrUpdateSample.js | 54 + .../javascript/trunkedNetworksDeleteSample.js | 38 + .../javascript/trunkedNetworksGetSample.js | 35 + ...runkedNetworksListByResourceGroupSample.js | 37 + ...trunkedNetworksListBySubscriptionSample.js | 36 + .../javascript/trunkedNetworksUpdateSample.js | 45 + .../virtualMachinesAttachVolumeSample.js | 43 + .../virtualMachinesCreateOrUpdateSample.js | 101 + .../javascript/virtualMachinesDeleteSample.js | 38 + .../virtualMachinesDetachVolumeSample.js | 43 + .../javascript/virtualMachinesGetSample.js | 35 + ...irtualMachinesListByResourceGroupSample.js | 37 + ...virtualMachinesListBySubscriptionSample.js | 36 + .../virtualMachinesPowerOffSample.js | 45 + .../virtualMachinesReimageSample.js | 38 + .../virtualMachinesRestartSample.js | 38 + .../javascript/virtualMachinesStartSample.js | 38 + .../javascript/virtualMachinesUpdateSample.js | 50 + .../javascript/volumesCreateOrUpdateSample.js | 48 + .../v1-beta/javascript/volumesDeleteSample.js | 35 + .../v1-beta/javascript/volumesGetSample.js | 35 + .../volumesListByResourceGroupSample.js | 37 + .../volumesListBySubscriptionSample.js | 36 + .../v1-beta/javascript/volumesUpdateSample.js | 39 + .../samples/v1-beta/typescript/README.md | 311 + .../samples/v1-beta/typescript/package.json | 41 + .../samples/v1-beta/typescript/sample.env | 4 + ...MetalMachineKeySetsCreateOrUpdateSample.ts | 79 + .../bareMetalMachineKeySetsDeleteSample.ts | 44 + .../src/bareMetalMachineKeySetsGetSample.ts | 44 + ...MachineKeySetsListByResourceGroupSample.ts | 45 + .../bareMetalMachineKeySetsUpdateSample.ts | 77 + .../src/bareMetalMachinesCordonSample.ts | 53 + .../bareMetalMachinesCreateOrUpdateSample.ts | 65 + .../src/bareMetalMachinesDeleteSample.ts | 44 + .../src/bareMetalMachinesGetSample.ts | 42 + ...eMetalMachinesListByResourceGroupSample.ts | 43 + ...reMetalMachinesListBySubscriptionSample.ts | 39 + .../src/bareMetalMachinesPowerOffSample.ts | 53 + .../src/bareMetalMachinesReimageSample.ts | 42 + .../src/bareMetalMachinesReplaceSample.ts | 57 + .../src/bareMetalMachinesRestartSample.ts | 42 + .../src/bareMetalMachinesRunCommandSample.ts | 51 + .../bareMetalMachinesRunDataExtractsSample.ts | 50 + .../bareMetalMachinesRunReadCommandsSample.ts | 53 + .../src/bareMetalMachinesStartSample.ts | 42 + .../src/bareMetalMachinesUncordonSample.ts | 42 + .../src/bareMetalMachinesUpdateSample.ts | 54 + ...bareMetalMachinesValidateHardwareSample.ts | 49 + .../src/bmcKeySetsCreateOrUpdateSample.ts | 77 + .../typescript/src/bmcKeySetsDeleteSample.ts | 44 + .../typescript/src/bmcKeySetsGetSample.ts | 44 + .../bmcKeySetsListByResourceGroupSample.ts | 45 + .../typescript/src/bmcKeySetsUpdateSample.ts | 74 + ...oudServicesNetworksCreateOrUpdateSample.ts | 64 + .../src/cloudServicesNetworksDeleteSample.ts | 42 + .../src/cloudServicesNetworksGetSample.ts | 42 + ...rvicesNetworksListByResourceGroupSample.ts | 43 + ...ervicesNetworksListBySubscriptionSample.ts | 39 + .../src/cloudServicesNetworksUpdateSample.ts | 65 + .../clusterManagersCreateOrUpdateSample.ts | 55 + .../src/clusterManagersDeleteSample.ts | 42 + .../src/clusterManagersGetSample.ts | 42 + ...lusterManagersListByResourceGroupSample.ts | 43 + ...clusterManagersListBySubscriptionSample.ts | 39 + .../src/clusterManagersUpdateSample.ts | 53 + .../src/clustersCreateOrUpdateSample.ts | 148 + .../typescript/src/clustersDeleteSample.ts | 42 + .../typescript/src/clustersDeploySample.ts | 76 + .../typescript/src/clustersGetSample.ts | 39 + .../src/clustersListByResourceGroupSample.ts | 43 + .../src/clustersListBySubscriptionSample.ts | 39 + .../typescript/src/clustersUpdateSample.ts | 120 + .../src/clustersUpdateVersionSample.ts | 49 + .../src/consolesCreateOrUpdateSample.ts | 60 + .../typescript/src/consolesDeleteSample.ts | 44 + .../typescript/src/consolesGetSample.ts | 44 + .../src/consolesListByResourceGroupSample.ts | 45 + .../typescript/src/consolesUpdateSample.ts | 59 + .../defaultCniNetworksCreateOrUpdateSample.ts | 66 + .../src/defaultCniNetworksDeleteSample.ts | 42 + .../src/defaultCniNetworksGetSample.ts | 42 + ...ultCniNetworksListByResourceGroupSample.ts | 43 + ...aultCniNetworksListBySubscriptionSample.ts | 39 + .../src/defaultCniNetworksUpdateSample.ts | 53 + .../hybridAksClustersCreateOrUpdateSample.ts | 61 + .../src/hybridAksClustersDeleteSample.ts | 44 + .../src/hybridAksClustersGetSample.ts | 42 + ...ridAksClustersListByResourceGroupSample.ts | 43 + ...bridAksClustersListBySubscriptionSample.ts | 39 + .../src/hybridAksClustersRestartNodeSample.ts | 49 + .../src/hybridAksClustersUpdateSample.ts | 53 + .../src/l2NetworksCreateOrUpdateSample.ts | 56 + .../typescript/src/l2NetworksDeleteSample.ts | 42 + .../typescript/src/l2NetworksGetSample.ts | 39 + .../l2NetworksListByResourceGroupSample.ts | 43 + .../src/l2NetworksListBySubscriptionSample.ts | 39 + .../typescript/src/l2NetworksUpdateSample.ts | 51 + .../src/l3NetworksCreateOrUpdateSample.ts | 61 + .../typescript/src/l3NetworksDeleteSample.ts | 42 + .../typescript/src/l3NetworksGetSample.ts | 39 + .../l3NetworksListByResourceGroupSample.ts | 43 + .../src/l3NetworksListBySubscriptionSample.ts | 39 + .../typescript/src/l3NetworksUpdateSample.ts | 51 + ...tricsConfigurationsCreateOrUpdateSample.ts | 59 + .../src/metricsConfigurationsDeleteSample.ts | 44 + .../src/metricsConfigurationsGetSample.ts | 44 + ...ConfigurationsListByResourceGroupSample.ts | 45 + .../src/metricsConfigurationsUpdateSample.ts | 57 + .../typescript/src/operationsListSample.ts | 40 + .../typescript/src/rackSkusGetSample.ts | 37 + .../src/rackSkusListBySubscriptionSample.ts | 39 + .../src/racksCreateOrUpdateSample.ts | 58 + .../typescript/src/racksDeleteSample.ts | 44 + .../v1-beta/typescript/src/racksGetSample.ts | 39 + .../src/racksListByResourceGroupSample.ts | 41 + .../src/racksListBySubscriptionSample.ts | 39 + .../typescript/src/racksUpdateSample.ts | 53 + .../storageAppliancesCreateOrUpdateSample.ts | 60 + .../src/storageAppliancesDeleteSample.ts | 44 + ...ncesDisableRemoteVendorManagementSample.ts | 42 + ...ancesEnableRemoteVendorManagementSample.ts | 53 + .../src/storageAppliancesGetSample.ts | 42 + ...rageAppliancesListByResourceGroupSample.ts | 43 + ...orageAppliancesListBySubscriptionSample.ts | 39 + .../storageAppliancesRunReadCommandsSample.ts | 50 + .../src/storageAppliancesUpdateSample.ts | 54 + ...storageAppliancesValidateHardwareSample.ts | 49 + .../trunkedNetworksCreateOrUpdateSample.ts | 59 + .../src/trunkedNetworksDeleteSample.ts | 42 + .../src/trunkedNetworksGetSample.ts | 42 + ...runkedNetworksListByResourceGroupSample.ts | 43 + ...trunkedNetworksListBySubscriptionSample.ts | 39 + .../src/trunkedNetworksUpdateSample.ts | 53 + .../src/virtualMachinesAttachVolumeSample.ts | 50 + .../virtualMachinesCreateOrUpdateSample.ts | 106 + .../src/virtualMachinesDeleteSample.ts | 42 + .../src/virtualMachinesDetachVolumeSample.ts | 50 + .../src/virtualMachinesGetSample.ts | 42 + ...irtualMachinesListByResourceGroupSample.ts | 43 + ...virtualMachinesListBySubscriptionSample.ts | 39 + .../src/virtualMachinesPowerOffSample.ts | 53 + .../src/virtualMachinesReimageSample.ts | 42 + .../src/virtualMachinesRestartSample.ts | 42 + .../src/virtualMachinesStartSample.ts | 42 + .../src/virtualMachinesUpdateSample.ts | 58 + .../src/volumesCreateOrUpdateSample.ts | 53 + .../typescript/src/volumesDeleteSample.ts | 42 + .../typescript/src/volumesGetSample.ts | 39 + .../src/volumesListByResourceGroupSample.ts | 43 + .../src/volumesListBySubscriptionSample.ts | 39 + .../typescript/src/volumesUpdateSample.ts | 51 + .../samples/v1-beta/typescript/tsconfig.json | 17 + .../arm-networkcloud/src/index.ts | 13 + .../arm-networkcloud/src/lroImpl.ts | 42 + .../arm-networkcloud/src/models/index.ts | 5821 +++++++++++++++ .../arm-networkcloud/src/models/mappers.ts | 6314 +++++++++++++++++ .../arm-networkcloud/src/models/parameters.ts | 655 ++ .../arm-networkcloud/src/networkCloud.ts | 216 + .../src/operations/bareMetalMachineKeySets.ts | 652 ++ .../src/operations/bareMetalMachines.ts | 2163 ++++++ .../src/operations/bmcKeySets.ts | 646 ++ .../src/operations/cloudServicesNetworks.ts | 721 ++ .../src/operations/clusterManagers.ts | 637 ++ .../src/operations/clusters.ts | 979 +++ .../src/operations/consoles.ts | 644 ++ .../src/operations/defaultCniNetworks.ts | 636 ++ .../src/operations/hybridAksClusters.ts | 785 ++ .../arm-networkcloud/src/operations/index.ts | 27 + .../src/operations/l2Networks.ts | 631 ++ .../src/operations/l3Networks.ts | 631 ++ .../src/operations/metricsConfigurations.ts | 652 ++ .../src/operations/operations.ts | 151 + .../src/operations/rackSkus.ts | 195 + .../arm-networkcloud/src/operations/racks.ts | 713 ++ .../src/operations/storageAppliances.ts | 1262 ++++ .../src/operations/trunkedNetworks.ts | 636 ++ .../src/operations/virtualMachines.ts | 1492 ++++ .../src/operations/volumes.ts | 631 ++ .../bareMetalMachineKeySets.ts | 144 + .../operationsInterfaces/bareMetalMachines.ts | 495 ++ .../src/operationsInterfaces/bmcKeySets.ts | 147 + .../cloudServicesNetworks.ts | 136 + .../operationsInterfaces/clusterManagers.ts | 119 + .../src/operationsInterfaces/clusters.ts | 199 + .../src/operationsInterfaces/consoles.ts | 146 + .../defaultCniNetworks.ts | 118 + .../operationsInterfaces/hybridAksClusters.ts | 163 + .../src/operationsInterfaces/index.ts | 27 + .../src/operationsInterfaces/l2Networks.ts | 118 + .../src/operationsInterfaces/l3Networks.ts | 118 + .../metricsConfigurations.ts | 144 + .../src/operationsInterfaces/operations.ts | 23 + .../src/operationsInterfaces/rackSkus.ts | 36 + .../src/operationsInterfaces/racks.ts | 141 + .../operationsInterfaces/storageAppliances.ts | 270 + .../operationsInterfaces/trunkedNetworks.ts | 118 + .../operationsInterfaces/virtualMachines.ts | 319 + .../src/operationsInterfaces/volumes.ts | 118 + .../arm-networkcloud/src/pagingHelper.ts | 39 + .../test/networkcloud_operations_test.spec.ts | 68 + .../arm-networkcloud/tsconfig.json | 33 + sdk/networkcloud/ci.mgmt.yml | 38 + 445 files changed, 53993 insertions(+), 10 deletions(-) create mode 100644 sdk/networkcloud/arm-networkcloud/CHANGELOG.md create mode 100644 sdk/networkcloud/arm-networkcloud/LICENSE create mode 100644 sdk/networkcloud/arm-networkcloud/README.md create mode 100644 sdk/networkcloud/arm-networkcloud/_meta.json create mode 100644 sdk/networkcloud/arm-networkcloud/api-extractor.json create mode 100644 sdk/networkcloud/arm-networkcloud/assets.json create mode 100644 sdk/networkcloud/arm-networkcloud/package.json create mode 100644 sdk/networkcloud/arm-networkcloud/review/arm-networkcloud.api.md create mode 100644 sdk/networkcloud/arm-networkcloud/rollup.config.js create mode 100644 sdk/networkcloud/arm-networkcloud/sample.env create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesCordonSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesPowerOffSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesReimageSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesReplaceSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRestartSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunCommandSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunDataExtractsSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunReadCommandsSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesStartSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesUncordonSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesValidateHardwareSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clustersCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clustersDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clustersDeploySample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clustersGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clustersListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clustersListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clustersUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/clustersUpdateVersionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/consolesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/consolesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/consolesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/consolesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/consolesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersRestartNodeSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/operationsListSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/rackSkusGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/rackSkusListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/racksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/racksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/racksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/racksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/racksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/racksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesDisableRemoteVendorManagementSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesEnableRemoteVendorManagementSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesRunReadCommandsSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesValidateHardwareSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesAttachVolumeSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesDetachVolumeSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesPowerOffSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesReimageSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesRestartSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesStartSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/volumesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/volumesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/volumesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/volumesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/volumesListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples-dev/volumesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/README.md create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCordonSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesPowerOffSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReimageSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReplaceSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRestartSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunCommandSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunDataExtractsSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunReadCommandsSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesStartSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUncordonSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesValidateHardwareSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeploySample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateVersionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersRestartNodeSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/operationsListSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/package.json create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/sample.env create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDisableRemoteVendorManagementSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesEnableRemoteVendorManagementSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesRunReadCommandsSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesValidateHardwareSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesAttachVolumeSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDetachVolumeSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesPowerOffSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesReimageSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesRestartSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesStartSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesCreateOrUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesDeleteSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesGetSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListByResourceGroupSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListBySubscriptionSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesUpdateSample.js create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/README.md create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/package.json create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/sample.env create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCordonSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesPowerOffSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReimageSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReplaceSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRestartSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunCommandSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunDataExtractsSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunReadCommandsSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesStartSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUncordonSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesValidateHardwareSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeploySample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateVersionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersRestartNodeSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/operationsListSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDisableRemoteVendorManagementSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesEnableRemoteVendorManagementSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesRunReadCommandsSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesValidateHardwareSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesAttachVolumeSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDetachVolumeSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesPowerOffSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesReimageSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesRestartSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesStartSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesCreateOrUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesDeleteSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesGetSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListByResourceGroupSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListBySubscriptionSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesUpdateSample.ts create mode 100644 sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/tsconfig.json create mode 100644 sdk/networkcloud/arm-networkcloud/src/index.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/lroImpl.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/models/index.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/models/mappers.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/models/parameters.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/networkCloud.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/bareMetalMachineKeySets.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/bareMetalMachines.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/bmcKeySets.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/cloudServicesNetworks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/clusterManagers.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/clusters.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/consoles.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/defaultCniNetworks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/hybridAksClusters.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/index.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/l2Networks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/l3Networks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/metricsConfigurations.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/operations.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/rackSkus.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/racks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/storageAppliances.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/trunkedNetworks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/virtualMachines.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operations/volumes.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bareMetalMachineKeySets.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bareMetalMachines.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bmcKeySets.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/cloudServicesNetworks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/clusterManagers.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/clusters.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/consoles.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/defaultCniNetworks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/hybridAksClusters.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/index.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/l2Networks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/l3Networks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/metricsConfigurations.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/operations.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/rackSkus.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/racks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/storageAppliances.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/trunkedNetworks.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/virtualMachines.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/volumes.ts create mode 100644 sdk/networkcloud/arm-networkcloud/src/pagingHelper.ts create mode 100644 sdk/networkcloud/arm-networkcloud/test/networkcloud_operations_test.spec.ts create mode 100644 sdk/networkcloud/arm-networkcloud/tsconfig.json create mode 100644 sdk/networkcloud/ci.mgmt.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 36ea91513a47..b0b25260bbc2 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -145,6 +145,7 @@ specifiers: '@rush-temp/arm-network': file:./projects/arm-network.tgz '@rush-temp/arm-network-1': file:./projects/arm-network-1.tgz '@rush-temp/arm-network-profile-2020-09-01-hybrid': file:./projects/arm-network-profile-2020-09-01-hybrid.tgz + '@rush-temp/arm-networkcloud': file:./projects/arm-networkcloud.tgz '@rush-temp/arm-networkfunction': file:./projects/arm-networkfunction.tgz '@rush-temp/arm-newrelicobservability': file:./projects/arm-newrelicobservability.tgz '@rush-temp/arm-nginx': file:./projects/arm-nginx.tgz @@ -486,6 +487,7 @@ dependencies: '@rush-temp/arm-network': file:projects/arm-network.tgz '@rush-temp/arm-network-1': file:projects/arm-network-1.tgz '@rush-temp/arm-network-profile-2020-09-01-hybrid': file:projects/arm-network-profile-2020-09-01-hybrid.tgz + '@rush-temp/arm-networkcloud': file:projects/arm-networkcloud.tgz '@rush-temp/arm-networkfunction': file:projects/arm-networkfunction.tgz '@rush-temp/arm-newrelicobservability': file:projects/arm-newrelicobservability.tgz '@rush-temp/arm-nginx': file:projects/arm-nginx.tgz @@ -3793,7 +3795,7 @@ packages: dependencies: semver: 7.5.0 shelljs: 0.8.5 - typescript: 5.2.0-dev.20230517 + typescript: 5.2.0-dev.20230521 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8337,8 +8339,8 @@ packages: hasBin: true dev: false - /typescript/5.2.0-dev.20230517: - resolution: {integrity: sha512-mTT3ka5HTeudnNirocnOfr/0d2CEvZExrJpP8YXqAvdwlwjwNPJ4TqHHiL1y9lx3RfsUWu6HSX539ZxngUTqeA==} + /typescript/5.2.0-dev.20230521: + resolution: {integrity: sha512-FY/YyQs1rvpUaX5PaZ4HZQnzBqlgjNYeQIOCF9208PLZvMsPwiJsZS5wbf5fvdepXkzpQK6ZpjGSJTXa7Gsp3Q==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -10714,7 +10716,7 @@ packages: dev: false file:projects/arm-containerservice-1.tgz: - resolution: {integrity: sha512-epUopDZF/h2mskn1cp+bG2R4hH4MWvGcLc7rnMbYLB9K3s5FhbJmc7RG+jVGZLUWZQOxMTn/IFwe3itoz3nW5w==, tarball: file:projects/arm-containerservice-1.tgz} + resolution: {integrity: sha512-r6G3gQeS9Z3dNfXiPvvlwBteDYIePYiZOiFrG/bUXIstTveG5sFEe+KpWO1GDF+zRKKugnA5IZ6YJx0rgDE/QQ==, tarball: file:projects/arm-containerservice-1.tgz} name: '@rush-temp/arm-containerservice-1' version: 0.0.0 dependencies: @@ -10816,13 +10818,13 @@ packages: version: 0.0.0 dependencies: '@azure/identity': 2.1.0 - '@microsoft/api-extractor': 7.34.6_@types+node@14.18.43 + '@microsoft/api-extractor': 7.34.8_@types+node@14.18.46 '@rollup/plugin-commonjs': 24.1.0_rollup@2.79.1 '@rollup/plugin-json': 6.0.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.5 - '@types/node': 14.18.43 + '@types/node': 14.18.46 chai: 4.3.7 cross-env: 7.0.3 dotenv: 16.0.3 @@ -10830,7 +10832,7 @@ packages: mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_mn2f3gd3jpedkkr23obcmzv5eq + rollup-plugin-sourcemaps: 0.6.3_m742s5qpci6ulntpyriekwplh4 tslib: 2.5.0 typescript: 5.0.4 uglify-js: 3.17.4 @@ -13028,7 +13030,7 @@ packages: dev: false file:projects/arm-network-1.tgz: - resolution: {integrity: sha512-nXpqdA8VSaeag42S3M95ANDnxw2lbo20X2jflKuY51YrLbk/65nVaARI3OJ6CfEYNdwrR78d8e8W4ng/gmShgw==, tarball: file:projects/arm-network-1.tgz} + resolution: {integrity: sha512-gGxn8y+MWnI9ZcjkEEyWvTRuta7sRLQ5ioIzsvxS3ojT8VqnGr2OGHhFiORHSivRZt8kjHNM/Cqab8RuLdVJDw==, tarball: file:projects/arm-network-1.tgz} name: '@rush-temp/arm-network-1' version: 0.0.0 dependencies: @@ -13124,6 +13126,34 @@ packages: - utf-8-validate dev: false + file:projects/arm-networkcloud.tgz: + resolution: {integrity: sha512-cHWm3T/AtDMfqqcJ5pGQE1VwgTNhMekMLzxL4oRhrLwqfAMUHeUKShOxKjnK3ijV29GLU2NzOxWLnHnKKHijZA==, tarball: file:projects/arm-networkcloud.tgz} + name: '@rush-temp/arm-networkcloud' + version: 0.0.0 + dependencies: + '@azure/identity': 2.1.0 + '@microsoft/api-extractor': 7.34.8_@types+node@14.18.46 + '@rollup/plugin-commonjs': 24.1.0_rollup@2.79.1 + '@rollup/plugin-json': 6.0.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.5 + '@types/node': 14.18.46 + chai: 4.3.7 + cross-env: 7.0.3 + dotenv: 16.0.3 + mkdirp: 2.1.6 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 2.79.1 + rollup-plugin-sourcemaps: 0.6.3_m742s5qpci6ulntpyriekwplh4 + tslib: 2.5.0 + typescript: 5.0.4 + uglify-js: 3.17.4 + transitivePeerDependencies: + - supports-color + dev: false + file:projects/arm-networkfunction.tgz: resolution: {integrity: sha512-SEo8YLW6VV9/d2QX9L7Y3x8p1ZKc2f5wSLDiSS9HXkSlUJkfuheVs2jNocksczuf7oV3/bz6wjzZ72nvaSh9jg==, tarball: file:projects/arm-networkfunction.tgz} name: '@rush-temp/arm-networkfunction' diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 918751716e66..6b3ac811f393 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -14,3 +14,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-paloaltonetworksngfw?view=a https://docs.microsoft.com/javascript/api/@azure/arm-selfhelp?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-costmanagement?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-costmanagement +https://docs.microsoft.com/javascript/api/@azure/arm-networkcloud?view=azure-node-preview diff --git a/rush.json b/rush.json index eccf537fbf8a..3f22a7e29291 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */{ + */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1987,6 +1987,11 @@ "packageName": "@azure/arm-costmanagement", "projectFolder": "sdk/cost-management/arm-costmanagement", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-networkcloud", + "projectFolder": "sdk/networkcloud/arm-networkcloud", + "versionPolicyName": "management" } ] -} \ No newline at end of file +} diff --git a/sdk/networkcloud/arm-networkcloud/CHANGELOG.md b/sdk/networkcloud/arm-networkcloud/CHANGELOG.md new file mode 100644 index 000000000000..00ffd505638e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-05-08) + +The package of @azure/arm-networkcloud is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/networkcloud/arm-networkcloud/LICENSE b/sdk/networkcloud/arm-networkcloud/LICENSE new file mode 100644 index 000000000000..3a1d9b6f24f7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2023 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/networkcloud/arm-networkcloud/README.md b/sdk/networkcloud/arm-networkcloud/README.md new file mode 100644 index 000000000000..3646b21175e6 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/README.md @@ -0,0 +1,109 @@ +# Azure NetworkCloud client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure NetworkCloud client. + +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. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/networkcloud/arm-networkcloud) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-networkcloud) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-networkcloud?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-networkcloud` package + +Install the Azure NetworkCloud client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-networkcloud +``` + +### Create and authenticate a `NetworkCloud` + +To create a client object to access the Azure NetworkCloud API, you will need the `endpoint` of your Azure NetworkCloud resource and a `credential`. The Azure NetworkCloud client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure NetworkCloud resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure NetworkCloud** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new NetworkCloud(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new NetworkCloud(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### NetworkCloud + +`NetworkCloud` is the primary interface for developers using the Azure NetworkCloud client library. Explore the methods on this client object to understand the different features of the Azure NetworkCloud service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fnetworkcloud%2Farm-networkcloud%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/networkcloud/arm-networkcloud/_meta.json b/sdk/networkcloud/arm-networkcloud/_meta.json new file mode 100644 index 000000000000..0904082fc8d2 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "17aa6a1314de5aafef059d9aa2229901df506e75", + "readme": "specification/networkcloud/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\networkcloud\\resource-manager\\readme.md --use=@autorest/typescript@6.0.1 --generate-sample=true", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", + "use": "@autorest/typescript@6.0.1" +} \ No newline at end of file diff --git a/sdk/networkcloud/arm-networkcloud/api-extractor.json b/sdk/networkcloud/arm-networkcloud/api-extractor.json new file mode 100644 index 000000000000..35e0cbbaa50e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-networkcloud.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/networkcloud/arm-networkcloud/assets.json b/sdk/networkcloud/arm-networkcloud/assets.json new file mode 100644 index 000000000000..4cdc4a9cbee9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "js", + "TagPrefix": "js/networkcloud/arm-networkcloud", + "Tag": "js/networkcloud/arm-networkcloud_f8ed294c81" +} diff --git a/sdk/networkcloud/arm-networkcloud/package.json b/sdk/networkcloud/arm-networkcloud/package.json new file mode 100644 index 000000000000..134db899d9c6 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/package.json @@ -0,0 +1,123 @@ +{ + "name": "@azure/arm-networkcloud", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for NetworkCloud.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=14.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.5.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.8.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-networkcloud.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.31.1", + "@rollup/plugin-commonjs": "^24.0.0", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-node-resolve": "^13.1.3", + "mkdirp": "^2.1.2", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "typescript": "~5.0.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "dotenv": "^16.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.0.0", + "mocha": "^7.1.1", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@types/node": "^14.0.0", + "@azure/dev-tool": "^1.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/networkCloud.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/networkcloud/arm-networkcloud", + "//sampleConfiguration": { + "productName": "", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-networkcloud?view=azure-node-preview" + } +} \ No newline at end of file diff --git a/sdk/networkcloud/arm-networkcloud/review/arm-networkcloud.api.md b/sdk/networkcloud/arm-networkcloud/review/arm-networkcloud.api.md new file mode 100644 index 000000000000..0e5b9ee2a204 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/review/arm-networkcloud.api.md @@ -0,0 +1,3728 @@ +## API Report File for "@azure/arm-networkcloud" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { SimplePollerLike } from '@azure/core-lro'; + +// @public +export type ActionType = string; + +// @public +export interface AdministrativeCredentials { + password: string; + username: string; +} + +// @public +export interface BareMetalMachine extends TrackedResource { + bmcConnectionString: string; + bmcCredentials: AdministrativeCredentials; + bmcMacAddress: string; + bootMacAddress: string; + readonly clusterId?: string; + readonly cordonStatus?: BareMetalMachineCordonStatus; + readonly detailedStatus?: BareMetalMachineDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + readonly hardwareInventory?: HardwareInventory; + readonly hardwareValidationStatus?: HardwareValidationStatus; + readonly hybridAksClustersAssociatedIds?: string[]; + readonly kubernetesNodeName?: string; + readonly kubernetesVersion?: string; + machineDetails: string; + machineName: string; + machineSkuId: string; + readonly oamIpv4Address?: string; + readonly oamIpv6Address?: string; + readonly osImage?: string; + readonly powerState?: BareMetalMachinePowerState; + readonly provisioningState?: BareMetalMachineProvisioningState; + rackId: string; + rackSlot: number; + readonly readyState?: BareMetalMachineReadyState; + serialNumber: string; + readonly serviceTag?: string; + readonly virtualMachinesAssociatedIds?: string[]; +} + +// @public +export interface BareMetalMachineCommandSpecification { + arguments?: string[]; + command: string; +} + +// @public +export interface BareMetalMachineConfigurationData { + readonly bmcConnectionString?: string; + bmcCredentials: AdministrativeCredentials; + bmcMacAddress: string; + bootMacAddress: string; + machineDetails?: string; + machineName?: string; + rackSlot: number; + serialNumber: string; +} + +// @public +export interface BareMetalMachineCordonParameters { + evacuate?: BareMetalMachineEvacuate; +} + +// @public +export type BareMetalMachineCordonStatus = string; + +// @public +export type BareMetalMachineDetailedStatus = string; + +// @public +export type BareMetalMachineEvacuate = string; + +// @public +export type BareMetalMachineHardwareValidationCategory = string; + +// @public +export type BareMetalMachineHardwareValidationResult = string; + +// @public +export interface BareMetalMachineKeySet extends TrackedResource { + azureGroupId: string; + readonly detailedStatus?: BareMetalMachineKeySetDetailedStatus; + readonly detailedStatusMessage?: string; + expiration: Date; + extendedLocation: ExtendedLocation; + jumpHostsAllowed: string[]; + readonly lastValidation?: Date; + osGroupName?: string; + privilegeLevel: BareMetalMachineKeySetPrivilegeLevel; + readonly provisioningState?: BareMetalMachineKeySetProvisioningState; + userList: KeySetUser[]; + readonly userListStatus?: KeySetUserStatus[]; +} + +// @public +export type BareMetalMachineKeySetDetailedStatus = string; + +// @public +export interface BareMetalMachineKeySetList { + nextLink?: string; + value?: BareMetalMachineKeySet[]; +} + +// @public +export interface BareMetalMachineKeySetPatchParameters { + expiration?: Date; + jumpHostsAllowed?: string[]; + tags?: { + [propertyName: string]: string; + }; + userList?: KeySetUser[]; +} + +// @public +export type BareMetalMachineKeySetPrivilegeLevel = string; + +// @public +export type BareMetalMachineKeySetProvisioningState = string; + +// @public +export interface BareMetalMachineKeySets { + beginCreateOrUpdate(resourceGroupName: string, clusterName: string, bareMetalMachineKeySetName: string, bareMetalMachineKeySetParameters: BareMetalMachineKeySet, options?: BareMetalMachineKeySetsCreateOrUpdateOptionalParams): Promise, BareMetalMachineKeySetsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, clusterName: string, bareMetalMachineKeySetName: string, bareMetalMachineKeySetParameters: BareMetalMachineKeySet, options?: BareMetalMachineKeySetsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, bareMetalMachineKeySetName: string, options?: BareMetalMachineKeySetsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, bareMetalMachineKeySetName: string, options?: BareMetalMachineKeySetsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, bareMetalMachineKeySetName: string, options?: BareMetalMachineKeySetsUpdateOptionalParams): Promise, BareMetalMachineKeySetsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterName: string, bareMetalMachineKeySetName: string, options?: BareMetalMachineKeySetsUpdateOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, bareMetalMachineKeySetName: string, options?: BareMetalMachineKeySetsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, clusterName: string, options?: BareMetalMachineKeySetsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BareMetalMachineKeySetsCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface BareMetalMachineKeySetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachineKeySetsCreateOrUpdateResponse = BareMetalMachineKeySet; + +// @public +export interface BareMetalMachineKeySetsDeleteHeaders { + location?: string; +} + +// @public +export interface BareMetalMachineKeySetsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BareMetalMachineKeySetsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BareMetalMachineKeySetsGetResponse = BareMetalMachineKeySet; + +// @public +export interface BareMetalMachineKeySetsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BareMetalMachineKeySetsListByResourceGroupNextResponse = BareMetalMachineKeySetList; + +// @public +export interface BareMetalMachineKeySetsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BareMetalMachineKeySetsListByResourceGroupResponse = BareMetalMachineKeySetList; + +// @public +export interface BareMetalMachineKeySetsUpdateHeaders { + location?: string; +} + +// @public +export interface BareMetalMachineKeySetsUpdateOptionalParams extends coreClient.OperationOptions { + bareMetalMachineKeySetUpdateParameters?: BareMetalMachineKeySetPatchParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachineKeySetsUpdateResponse = BareMetalMachineKeySet; + +// @public +export type BareMetalMachineKeySetUserSetupStatus = string; + +// @public +export interface BareMetalMachineList { + nextLink?: string; + value?: BareMetalMachine[]; +} + +// @public +export interface BareMetalMachinePatchParameters { + machineDetails?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface BareMetalMachinePowerOffParameters { + skipShutdown?: BareMetalMachineSkipShutdown; +} + +// @public +export type BareMetalMachinePowerState = string; + +// @public +export type BareMetalMachineProvisioningState = string; + +// @public +export type BareMetalMachineReadyState = string; + +// @public +export interface BareMetalMachineReplaceParameters { + bmcCredentials?: AdministrativeCredentials; + bmcMacAddress?: string; + bootMacAddress?: string; + machineName?: string; + serialNumber?: string; +} + +// @public +export interface BareMetalMachineRunCommandParameters { + arguments?: string[]; + limitTimeSeconds: number; + script: string; +} + +// @public +export interface BareMetalMachineRunDataExtractsParameters { + commands: BareMetalMachineCommandSpecification[]; + limitTimeSeconds: number; +} + +// @public +export interface BareMetalMachineRunReadCommandsParameters { + commands: BareMetalMachineCommandSpecification[]; + limitTimeSeconds: number; +} + +// @public +export interface BareMetalMachines { + beginCordon(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesCordonOptionalParams): Promise, BareMetalMachinesCordonResponse>>; + beginCordonAndWait(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesCordonOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineParameters: BareMetalMachine, options?: BareMetalMachinesCreateOrUpdateOptionalParams): Promise, BareMetalMachinesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineParameters: BareMetalMachine, options?: BareMetalMachinesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesDeleteOptionalParams): Promise; + beginPowerOff(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesPowerOffOptionalParams): Promise, BareMetalMachinesPowerOffResponse>>; + beginPowerOffAndWait(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesPowerOffOptionalParams): Promise; + beginReimage(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesReimageOptionalParams): Promise, BareMetalMachinesReimageResponse>>; + beginReimageAndWait(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesReimageOptionalParams): Promise; + beginReplace(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesReplaceOptionalParams): Promise, BareMetalMachinesReplaceResponse>>; + beginReplaceAndWait(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesReplaceOptionalParams): Promise; + beginRestart(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesRestartOptionalParams): Promise, BareMetalMachinesRestartResponse>>; + beginRestartAndWait(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesRestartOptionalParams): Promise; + beginRunCommand(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineRunCommandParameters: BareMetalMachineRunCommandParameters, options?: BareMetalMachinesRunCommandOptionalParams): Promise, BareMetalMachinesRunCommandResponse>>; + beginRunCommandAndWait(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineRunCommandParameters: BareMetalMachineRunCommandParameters, options?: BareMetalMachinesRunCommandOptionalParams): Promise; + beginRunDataExtracts(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineRunDataExtractsParameters: BareMetalMachineRunDataExtractsParameters, options?: BareMetalMachinesRunDataExtractsOptionalParams): Promise, BareMetalMachinesRunDataExtractsResponse>>; + beginRunDataExtractsAndWait(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineRunDataExtractsParameters: BareMetalMachineRunDataExtractsParameters, options?: BareMetalMachinesRunDataExtractsOptionalParams): Promise; + beginRunReadCommands(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineRunReadCommandsParameters: BareMetalMachineRunReadCommandsParameters, options?: BareMetalMachinesRunReadCommandsOptionalParams): Promise, BareMetalMachinesRunReadCommandsResponse>>; + beginRunReadCommandsAndWait(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineRunReadCommandsParameters: BareMetalMachineRunReadCommandsParameters, options?: BareMetalMachinesRunReadCommandsOptionalParams): Promise; + beginStart(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesStartOptionalParams): Promise, BareMetalMachinesStartResponse>>; + beginStartAndWait(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesStartOptionalParams): Promise; + beginUncordon(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesUncordonOptionalParams): Promise, BareMetalMachinesUncordonResponse>>; + beginUncordonAndWait(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesUncordonOptionalParams): Promise; + beginUpdate(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesUpdateOptionalParams): Promise, BareMetalMachinesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesUpdateOptionalParams): Promise; + beginValidateHardware(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineValidateHardwareParameters: BareMetalMachineValidateHardwareParameters, options?: BareMetalMachinesValidateHardwareOptionalParams): Promise, BareMetalMachinesValidateHardwareResponse>>; + beginValidateHardwareAndWait(resourceGroupName: string, bareMetalMachineName: string, bareMetalMachineValidateHardwareParameters: BareMetalMachineValidateHardwareParameters, options?: BareMetalMachinesValidateHardwareOptionalParams): Promise; + get(resourceGroupName: string, bareMetalMachineName: string, options?: BareMetalMachinesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: BareMetalMachinesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: BareMetalMachinesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BareMetalMachinesCordonHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesCordonOptionalParams extends coreClient.OperationOptions { + bareMetalMachineCordonParameters?: BareMetalMachineCordonParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesCordonResponse = BareMetalMachinesCordonHeaders; + +// @public +export interface BareMetalMachinesCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface BareMetalMachinesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesCreateOrUpdateResponse = BareMetalMachine; + +// @public +export interface BareMetalMachinesDeleteHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BareMetalMachinesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BareMetalMachinesGetResponse = BareMetalMachine; + +// @public +export type BareMetalMachineSkipShutdown = string; + +// @public +export interface BareMetalMachinesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BareMetalMachinesListByResourceGroupNextResponse = BareMetalMachineList; + +// @public +export interface BareMetalMachinesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BareMetalMachinesListByResourceGroupResponse = BareMetalMachineList; + +// @public +export interface BareMetalMachinesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BareMetalMachinesListBySubscriptionNextResponse = BareMetalMachineList; + +// @public +export interface BareMetalMachinesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BareMetalMachinesListBySubscriptionResponse = BareMetalMachineList; + +// @public +export interface BareMetalMachinesPowerOffHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesPowerOffOptionalParams extends coreClient.OperationOptions { + bareMetalMachinePowerOffParameters?: BareMetalMachinePowerOffParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesPowerOffResponse = BareMetalMachinesPowerOffHeaders; + +// @public +export interface BareMetalMachinesReimageHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesReimageOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesReimageResponse = BareMetalMachinesReimageHeaders; + +// @public +export interface BareMetalMachinesReplaceHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesReplaceOptionalParams extends coreClient.OperationOptions { + bareMetalMachineReplaceParameters?: BareMetalMachineReplaceParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesReplaceResponse = BareMetalMachinesReplaceHeaders; + +// @public +export interface BareMetalMachinesRestartHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesRestartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesRestartResponse = BareMetalMachinesRestartHeaders; + +// @public +export interface BareMetalMachinesRunCommandHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesRunCommandOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesRunCommandResponse = BareMetalMachinesRunCommandHeaders; + +// @public +export interface BareMetalMachinesRunDataExtractsHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesRunDataExtractsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesRunDataExtractsResponse = BareMetalMachinesRunDataExtractsHeaders; + +// @public +export interface BareMetalMachinesRunReadCommandsHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesRunReadCommandsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesRunReadCommandsResponse = BareMetalMachinesRunReadCommandsHeaders; + +// @public +export interface BareMetalMachinesStartHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesStartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesStartResponse = BareMetalMachinesStartHeaders; + +// @public +export interface BareMetalMachinesUncordonHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesUncordonOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesUncordonResponse = BareMetalMachinesUncordonHeaders; + +// @public +export interface BareMetalMachinesUpdateHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesUpdateOptionalParams extends coreClient.OperationOptions { + bareMetalMachineUpdateParameters?: BareMetalMachinePatchParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesUpdateResponse = BareMetalMachine; + +// @public +export interface BareMetalMachinesValidateHardwareHeaders { + location?: string; +} + +// @public +export interface BareMetalMachinesValidateHardwareOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BareMetalMachinesValidateHardwareResponse = BareMetalMachinesValidateHardwareHeaders; + +// @public +export interface BareMetalMachineValidateHardwareParameters { + validationCategory: BareMetalMachineHardwareValidationCategory; +} + +// @public +export interface BgpPeer { + asNumber: number; + password?: string; + peerIp: string; +} + +// @public +export interface BmcKeySet extends TrackedResource { + azureGroupId: string; + readonly detailedStatus?: BmcKeySetDetailedStatus; + readonly detailedStatusMessage?: string; + expiration: Date; + extendedLocation: ExtendedLocation; + readonly lastValidation?: Date; + privilegeLevel: BmcKeySetPrivilegeLevel; + readonly provisioningState?: BmcKeySetProvisioningState; + userList: KeySetUser[]; + readonly userListStatus?: KeySetUserStatus[]; +} + +// @public +export type BmcKeySetDetailedStatus = string; + +// @public +export interface BmcKeySetList { + nextLink?: string; + value?: BmcKeySet[]; +} + +// @public +export interface BmcKeySetPatchParameters { + expiration?: Date; + tags?: { + [propertyName: string]: string; + }; + userList?: KeySetUser[]; +} + +// @public +export type BmcKeySetPrivilegeLevel = string; + +// @public +export type BmcKeySetProvisioningState = string; + +// @public +export interface BmcKeySets { + beginCreateOrUpdate(resourceGroupName: string, clusterName: string, bmcKeySetName: string, bmcKeySetParameters: BmcKeySet, options?: BmcKeySetsCreateOrUpdateOptionalParams): Promise, BmcKeySetsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, clusterName: string, bmcKeySetName: string, bmcKeySetParameters: BmcKeySet, options?: BmcKeySetsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, bmcKeySetName: string, options?: BmcKeySetsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, bmcKeySetName: string, options?: BmcKeySetsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, bmcKeySetName: string, options?: BmcKeySetsUpdateOptionalParams): Promise, BmcKeySetsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterName: string, bmcKeySetName: string, options?: BmcKeySetsUpdateOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, bmcKeySetName: string, options?: BmcKeySetsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, clusterName: string, options?: BmcKeySetsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BmcKeySetsCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface BmcKeySetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BmcKeySetsCreateOrUpdateResponse = BmcKeySet; + +// @public +export interface BmcKeySetsDeleteHeaders { + location?: string; +} + +// @public +export interface BmcKeySetsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface BmcKeySetsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BmcKeySetsGetResponse = BmcKeySet; + +// @public +export interface BmcKeySetsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BmcKeySetsListByResourceGroupNextResponse = BmcKeySetList; + +// @public +export interface BmcKeySetsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BmcKeySetsListByResourceGroupResponse = BmcKeySetList; + +// @public +export interface BmcKeySetsUpdateHeaders { + location?: string; +} + +// @public +export interface BmcKeySetsUpdateOptionalParams extends coreClient.OperationOptions { + bmcKeySetUpdateParameters?: BmcKeySetPatchParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BmcKeySetsUpdateResponse = BmcKeySet; + +// @public +export type BootstrapProtocol = string; + +// @public +export interface CloudServicesNetwork extends TrackedResource { + additionalEgressEndpoints?: EgressEndpoint[]; + readonly clusterId?: string; + readonly detailedStatus?: CloudServicesNetworkDetailedStatus; + readonly detailedStatusMessage?: string; + enableDefaultEgressEndpoints?: CloudServicesNetworkEnableDefaultEgressEndpoints; + readonly enabledEgressEndpoints?: EgressEndpoint[]; + extendedLocation: ExtendedLocation; + readonly hybridAksClustersAssociatedIds?: string[]; + readonly interfaceName?: string; + readonly provisioningState?: CloudServicesNetworkProvisioningState; + readonly virtualMachinesAssociatedIds?: string[]; +} + +// @public +export type CloudServicesNetworkDetailedStatus = string; + +// @public +export type CloudServicesNetworkEnableDefaultEgressEndpoints = string; + +// @public +export interface CloudServicesNetworkList { + nextLink?: string; + value?: CloudServicesNetwork[]; +} + +// @public +export interface CloudServicesNetworkPatchParameters { + additionalEgressEndpoints?: EgressEndpoint[]; + enableDefaultEgressEndpoints?: CloudServicesNetworkEnableDefaultEgressEndpoints; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type CloudServicesNetworkProvisioningState = string; + +// @public +export interface CloudServicesNetworks { + beginCreateOrUpdate(resourceGroupName: string, cloudServicesNetworkName: string, cloudServicesNetworkParameters: CloudServicesNetwork, options?: CloudServicesNetworksCreateOrUpdateOptionalParams): Promise, CloudServicesNetworksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, cloudServicesNetworkName: string, cloudServicesNetworkParameters: CloudServicesNetwork, options?: CloudServicesNetworksCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, cloudServicesNetworkName: string, options?: CloudServicesNetworksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, cloudServicesNetworkName: string, options?: CloudServicesNetworksDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, cloudServicesNetworkName: string, options?: CloudServicesNetworksUpdateOptionalParams): Promise, CloudServicesNetworksUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, cloudServicesNetworkName: string, options?: CloudServicesNetworksUpdateOptionalParams): Promise; + get(resourceGroupName: string, cloudServicesNetworkName: string, options?: CloudServicesNetworksGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: CloudServicesNetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: CloudServicesNetworksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CloudServicesNetworksCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface CloudServicesNetworksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudServicesNetworksCreateOrUpdateResponse = CloudServicesNetwork; + +// @public +export interface CloudServicesNetworksDeleteHeaders { + location?: string; +} + +// @public +export interface CloudServicesNetworksDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CloudServicesNetworksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudServicesNetworksGetResponse = CloudServicesNetwork; + +// @public +export interface CloudServicesNetworksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudServicesNetworksListByResourceGroupNextResponse = CloudServicesNetworkList; + +// @public +export interface CloudServicesNetworksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudServicesNetworksListByResourceGroupResponse = CloudServicesNetworkList; + +// @public +export interface CloudServicesNetworksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudServicesNetworksListBySubscriptionNextResponse = CloudServicesNetworkList; + +// @public +export interface CloudServicesNetworksListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudServicesNetworksListBySubscriptionResponse = CloudServicesNetworkList; + +// @public +export interface CloudServicesNetworksUpdateHeaders { + location?: string; +} + +// @public +export interface CloudServicesNetworksUpdateOptionalParams extends coreClient.OperationOptions { + cloudServicesNetworkUpdateParameters?: CloudServicesNetworkPatchParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudServicesNetworksUpdateResponse = CloudServicesNetwork; + +// @public +export interface Cluster extends TrackedResource { + aggregatorOrSingleRackDefinition: RackDefinition; + analyticsWorkspaceId: string; + readonly availableUpgradeVersions?: ClusterAvailableUpgradeVersion[]; + readonly clusterCapacity?: ClusterCapacity; + readonly clusterConnectionStatus?: ClusterConnectionStatus; + readonly clusterExtendedLocation?: ExtendedLocation; + clusterLocation?: string; + readonly clusterManagerConnectionStatus?: ClusterManagerConnectionStatus; + readonly clusterManagerId?: string; + clusterServicePrincipal?: ServicePrincipalInformation; + clusterType: ClusterType; + clusterVersion: string; + computeDeploymentThreshold?: ValidationThreshold; + computeRackDefinitions?: RackDefinition[]; + readonly detailedStatus?: ClusterDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + readonly hybridAksExtendedLocation?: ExtendedLocation; + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + readonly manualActionCount?: number; + networkFabricId: string; + readonly provisioningState?: ClusterProvisioningState; + readonly supportExpiryDate?: string; + readonly workloadResourceIds?: string[]; +} + +// @public +export interface ClusterAvailableUpgradeVersion { + readonly controlImpact?: ControlImpact; + readonly expectedDuration?: string; + readonly impactDescription?: string; + readonly supportExpiryDate?: string; + readonly targetClusterVersion?: string; + readonly workloadImpact?: WorkloadImpact; +} + +// @public +export interface ClusterAvailableVersion { + readonly supportExpiryDate?: string; + readonly targetClusterVersion?: string; +} + +// @public +export interface ClusterCapacity { + availableApplianceStorageGB?: number; + availableCoreCount?: number; + availableHostStorageGB?: number; + availableMemoryGB?: number; + totalApplianceStorageGB?: number; + totalCoreCount?: number; + totalHostStorageGB?: number; + totalMemoryGB?: number; +} + +// @public +export type ClusterConnectionStatus = string; + +// @public +export interface ClusterDeployParameters { + skipValidationsForMachines?: string[]; +} + +// @public +export type ClusterDetailedStatus = string; + +// @public +export interface ClusterList { + nextLink?: string; + value?: Cluster[]; +} + +// @public +export interface ClusterManager extends TrackedResource { + analyticsWorkspaceId?: string; + availabilityZones?: string[]; + readonly clusterVersions?: ClusterAvailableVersion[]; + readonly detailedStatus?: ClusterManagerDetailedStatus; + readonly detailedStatusMessage?: string; + fabricControllerId: string; + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + readonly managerExtendedLocation?: ExtendedLocation; + readonly provisioningState?: ClusterManagerProvisioningState; + vmSize?: string; +} + +// @public +export type ClusterManagerConnectionStatus = string; + +// @public +export type ClusterManagerDetailedStatus = string; + +// @public +export interface ClusterManagerList { + nextLink?: string; + value?: ClusterManager[]; +} + +// @public +export interface ClusterManagerPatchParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ClusterManagerProvisioningState = string; + +// @public +export interface ClusterManagers { + beginCreateOrUpdate(resourceGroupName: string, clusterManagerName: string, clusterManagerParameters: ClusterManager, options?: ClusterManagersCreateOrUpdateOptionalParams): Promise, ClusterManagersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, clusterManagerName: string, clusterManagerParameters: ClusterManager, options?: ClusterManagersCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterManagerName: string, options?: ClusterManagersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterManagerName: string, options?: ClusterManagersDeleteOptionalParams): Promise; + get(resourceGroupName: string, clusterManagerName: string, options?: ClusterManagersGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ClusterManagersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ClusterManagersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, clusterManagerName: string, options?: ClusterManagersUpdateOptionalParams): Promise; +} + +// @public +export interface ClusterManagersCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface ClusterManagersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClusterManagersCreateOrUpdateResponse = ClusterManager; + +// @public +export interface ClusterManagersDeleteHeaders { + location?: string; +} + +// @public +export interface ClusterManagersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ClusterManagersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClusterManagersGetResponse = ClusterManager; + +// @public +export interface ClusterManagersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClusterManagersListByResourceGroupNextResponse = ClusterManagerList; + +// @public +export interface ClusterManagersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClusterManagersListByResourceGroupResponse = ClusterManagerList; + +// @public +export interface ClusterManagersListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClusterManagersListBySubscriptionNextResponse = ClusterManagerList; + +// @public +export interface ClusterManagersListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClusterManagersListBySubscriptionResponse = ClusterManagerList; + +// @public +export interface ClusterManagersUpdateOptionalParams extends coreClient.OperationOptions { + clusterManagerUpdateParameters?: ClusterManagerPatchParameters; +} + +// @public +export type ClusterManagersUpdateResponse = ClusterManager; + +// @public +export interface ClusterMetricsConfiguration extends TrackedResource { + collectionInterval: number; + readonly detailedStatus?: ClusterMetricsConfigurationDetailedStatus; + readonly detailedStatusMessage?: string; + readonly disabledMetrics?: string[]; + enabledMetrics?: string[]; + extendedLocation: ExtendedLocation; + readonly provisioningState?: ClusterMetricsConfigurationProvisioningState; +} + +// @public +export type ClusterMetricsConfigurationDetailedStatus = string; + +// @public +export interface ClusterMetricsConfigurationList { + nextLink?: string; + value?: ClusterMetricsConfiguration[]; +} + +// @public +export interface ClusterMetricsConfigurationPatchParameters { + collectionInterval?: number; + enabledMetrics?: string[]; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ClusterMetricsConfigurationProvisioningState = string; + +// @public +export interface ClusterPatchParameters { + aggregatorOrSingleRackDefinition?: RackDefinition; + clusterLocation?: string; + clusterServicePrincipal?: ServicePrincipalInformation; + computeDeploymentThreshold?: ValidationThreshold; + computeRackDefinitions?: RackDefinition[]; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ClusterProvisioningState = string; + +// @public +export interface Clusters { + beginCreateOrUpdate(resourceGroupName: string, clusterName: string, clusterParameters: Cluster, options?: ClustersCreateOrUpdateOptionalParams): Promise, ClustersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, clusterName: string, clusterParameters: Cluster, options?: ClustersCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise; + beginDeploy(resourceGroupName: string, clusterName: string, options?: ClustersDeployOptionalParams): Promise, ClustersDeployResponse>>; + beginDeployAndWait(resourceGroupName: string, clusterName: string, options?: ClustersDeployOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, options?: ClustersUpdateOptionalParams): Promise, ClustersUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterName: string, options?: ClustersUpdateOptionalParams): Promise; + beginUpdateVersion(resourceGroupName: string, clusterName: string, clusterUpdateVersionParameters: ClusterUpdateVersionParameters, options?: ClustersUpdateVersionOptionalParams): Promise, ClustersUpdateVersionResponse>>; + beginUpdateVersionAndWait(resourceGroupName: string, clusterName: string, clusterUpdateVersionParameters: ClusterUpdateVersionParameters, options?: ClustersUpdateVersionOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, options?: ClustersGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ClustersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ClustersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ClustersCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface ClustersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClustersCreateOrUpdateResponse = Cluster; + +// @public +export interface ClustersDeleteHeaders { + location?: string; +} + +// @public +export interface ClustersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ClustersDeployHeaders { + location?: string; +} + +// @public +export interface ClustersDeployOptionalParams extends coreClient.OperationOptions { + clusterDeployParameters?: ClusterDeployParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClustersDeployResponse = ClustersDeployHeaders; + +// @public +export interface ClustersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersGetResponse = Cluster; + +// @public +export interface ClustersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListByResourceGroupNextResponse = ClusterList; + +// @public +export interface ClustersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListByResourceGroupResponse = ClusterList; + +// @public +export interface ClustersListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListBySubscriptionNextResponse = ClusterList; + +// @public +export interface ClustersListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ClustersListBySubscriptionResponse = ClusterList; + +// @public +export interface ClustersUpdateHeaders { + location?: string; +} + +// @public +export interface ClustersUpdateOptionalParams extends coreClient.OperationOptions { + clusterUpdateParameters?: ClusterPatchParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClustersUpdateResponse = Cluster; + +// @public +export interface ClustersUpdateVersionHeaders { + location?: string; +} + +// @public +export interface ClustersUpdateVersionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClustersUpdateVersionResponse = ClustersUpdateVersionHeaders; + +// @public +export type ClusterType = string; + +// @public +export interface ClusterUpdateVersionParameters { + targetClusterVersion: string; +} + +// @public +export interface CniBgpConfiguration { + bgpPeers?: BgpPeer[]; + communityAdvertisements?: CommunityAdvertisement[]; + nodeMeshPassword?: string; + serviceExternalPrefixes?: string[]; + serviceLoadBalancerPrefixes?: string[]; +} + +// @public +export interface CommunityAdvertisement { + communities: string[]; + subnetPrefix: string; +} + +// @public +interface Console_2 extends TrackedResource { + readonly detailedStatus?: ConsoleDetailedStatus; + readonly detailedStatusMessage?: string; + enabled: ConsoleEnabled; + expiration?: Date; + extendedLocation: ExtendedLocation; + readonly privateLinkServiceId?: string; + readonly provisioningState?: ConsoleProvisioningState; + sshPublicKey: SshPublicKey; + readonly virtualMachineAccessId?: string; +} +export { Console_2 as Console } + +// @public +export type ConsoleDetailedStatus = string; + +// @public +export type ConsoleEnabled = string; + +// @public +export interface ConsoleList { + nextLink?: string; + value?: Console_2[]; +} + +// @public +export interface ConsolePatchParameters { + enabled?: ConsoleEnabled; + expiration?: Date; + sshPublicKey?: SshPublicKey; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ConsoleProvisioningState = string; + +// @public +export interface Consoles { + beginCreateOrUpdate(resourceGroupName: string, virtualMachineName: string, consoleName: string, consoleParameters: Console_2, options?: ConsolesCreateOrUpdateOptionalParams): Promise, ConsolesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, virtualMachineName: string, consoleName: string, consoleParameters: Console_2, options?: ConsolesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, virtualMachineName: string, consoleName: string, options?: ConsolesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, virtualMachineName: string, consoleName: string, options?: ConsolesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, virtualMachineName: string, consoleName: string, options?: ConsolesUpdateOptionalParams): Promise, ConsolesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, virtualMachineName: string, consoleName: string, options?: ConsolesUpdateOptionalParams): Promise; + get(resourceGroupName: string, virtualMachineName: string, consoleName: string, options?: ConsolesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, virtualMachineName: string, options?: ConsolesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ConsolesCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface ConsolesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConsolesCreateOrUpdateResponse = Console_2; + +// @public +export interface ConsolesDeleteHeaders { + location?: string; +} + +// @public +export interface ConsolesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ConsolesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConsolesGetResponse = Console_2; + +// @public +export interface ConsolesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConsolesListByResourceGroupNextResponse = ConsoleList; + +// @public +export interface ConsolesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConsolesListByResourceGroupResponse = ConsoleList; + +// @public +export interface ConsolesUpdateHeaders { + location?: string; +} + +// @public +export interface ConsolesUpdateOptionalParams extends coreClient.OperationOptions { + consoleUpdateParameters?: ConsolePatchParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ConsolesUpdateResponse = Console_2; + +// @public +export type ControlImpact = string; + +// @public +export type CreatedByType = string; + +// @public +export interface DefaultCniNetwork extends TrackedResource { + readonly clusterId?: string; + readonly cniAsNumber?: number; + cniBgpConfiguration?: CniBgpConfiguration; + readonly detailedStatus?: DefaultCniNetworkDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + readonly fabricBgpPeers?: BgpPeer[]; + readonly hybridAksClustersAssociatedIds?: string[]; + readonly interfaceName?: string; + ipAllocationType?: IpAllocationType; + ipv4ConnectedPrefix?: string; + ipv6ConnectedPrefix?: string; + l3IsolationDomainId: string; + readonly provisioningState?: DefaultCniNetworkProvisioningState; + vlan: number; +} + +// @public +export type DefaultCniNetworkDetailedStatus = string; + +// @public +export interface DefaultCniNetworkList { + nextLink?: string; + value?: DefaultCniNetwork[]; +} + +// @public +export interface DefaultCniNetworkPatchParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type DefaultCniNetworkProvisioningState = string; + +// @public +export interface DefaultCniNetworks { + beginCreateOrUpdate(resourceGroupName: string, defaultCniNetworkName: string, defaultCniNetworkParameters: DefaultCniNetwork, options?: DefaultCniNetworksCreateOrUpdateOptionalParams): Promise, DefaultCniNetworksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, defaultCniNetworkName: string, defaultCniNetworkParameters: DefaultCniNetwork, options?: DefaultCniNetworksCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, defaultCniNetworkName: string, options?: DefaultCniNetworksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, defaultCniNetworkName: string, options?: DefaultCniNetworksDeleteOptionalParams): Promise; + get(resourceGroupName: string, defaultCniNetworkName: string, options?: DefaultCniNetworksGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: DefaultCniNetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: DefaultCniNetworksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, defaultCniNetworkName: string, options?: DefaultCniNetworksUpdateOptionalParams): Promise; +} + +// @public +export interface DefaultCniNetworksCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface DefaultCniNetworksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DefaultCniNetworksCreateOrUpdateResponse = DefaultCniNetwork; + +// @public +export interface DefaultCniNetworksDeleteHeaders { + location?: string; +} + +// @public +export interface DefaultCniNetworksDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DefaultCniNetworksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefaultCniNetworksGetResponse = DefaultCniNetwork; + +// @public +export interface DefaultCniNetworksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefaultCniNetworksListByResourceGroupNextResponse = DefaultCniNetworkList; + +// @public +export interface DefaultCniNetworksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefaultCniNetworksListByResourceGroupResponse = DefaultCniNetworkList; + +// @public +export interface DefaultCniNetworksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefaultCniNetworksListBySubscriptionNextResponse = DefaultCniNetworkList; + +// @public +export interface DefaultCniNetworksListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DefaultCniNetworksListBySubscriptionResponse = DefaultCniNetworkList; + +// @public +export interface DefaultCniNetworksUpdateOptionalParams extends coreClient.OperationOptions { + defaultCniNetworkUpdateParameters?: DefaultCniNetworkPatchParameters; +} + +// @public +export type DefaultCniNetworksUpdateResponse = DefaultCniNetwork; + +// @public +export type DefaultGateway = string; + +// @public +export type DeviceConnectionType = string; + +// @public +export type DiskType = string; + +// @public +export interface EgressEndpoint { + category: string; + endpoints: EndpointDependency[]; +} + +// @public +export interface EndpointDependency { + domainName: string; + port?: number; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ExtendedLocation { + name: string; + type: string; +} + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export interface HardwareInventory { + readonly additionalHostInformation?: string; + readonly interfaces?: HardwareInventoryNetworkInterface[]; + readonly nics?: Nic[]; +} + +// @public +export interface HardwareInventoryNetworkInterface { + readonly linkStatus?: string; + readonly macAddress?: string; + readonly name?: string; + readonly networkInterfaceId?: string; +} + +// @public +export interface HardwareValidationStatus { + readonly lastValidationTime?: Date; + readonly result?: BareMetalMachineHardwareValidationResult; +} + +// @public +export interface HybridAksCluster extends TrackedResource { + associatedNetworkIds: string[]; + readonly cloudServicesNetworkId?: string; + readonly clusterId?: string; + controlPlaneCount: number; + readonly controlPlaneNodes?: NodeConfiguration[]; + readonly defaultCniNetworkId?: string; + readonly detailedStatus?: HybridAksClusterDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + hybridAksProvisionedClusterId: string; + readonly provisioningState?: HybridAksClusterProvisioningState; + readonly volumes?: string[]; + workerCount: number; + readonly workerNodes?: NodeConfiguration[]; +} + +// @public +export type HybridAksClusterDetailedStatus = string; + +// @public +export interface HybridAksClusterList { + nextLink?: string; + value?: HybridAksCluster[]; +} + +// @public +export type HybridAksClusterMachinePowerState = string; + +// @public +export interface HybridAksClusterPatchParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type HybridAksClusterProvisioningState = string; + +// @public +export interface HybridAksClusterRestartNodeParameters { + nodeName: string; +} + +// @public +export interface HybridAksClusters { + beginCreateOrUpdate(resourceGroupName: string, hybridAksClusterName: string, hybridAksClusterParameters: HybridAksCluster, options?: HybridAksClustersCreateOrUpdateOptionalParams): Promise, HybridAksClustersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, hybridAksClusterName: string, hybridAksClusterParameters: HybridAksCluster, options?: HybridAksClustersCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, hybridAksClusterName: string, options?: HybridAksClustersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, hybridAksClusterName: string, options?: HybridAksClustersDeleteOptionalParams): Promise; + beginRestartNode(resourceGroupName: string, hybridAksClusterName: string, hybridAksClusterRestartNodeParameters: HybridAksClusterRestartNodeParameters, options?: HybridAksClustersRestartNodeOptionalParams): Promise, HybridAksClustersRestartNodeResponse>>; + beginRestartNodeAndWait(resourceGroupName: string, hybridAksClusterName: string, hybridAksClusterRestartNodeParameters: HybridAksClusterRestartNodeParameters, options?: HybridAksClustersRestartNodeOptionalParams): Promise; + get(resourceGroupName: string, hybridAksClusterName: string, options?: HybridAksClustersGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: HybridAksClustersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: HybridAksClustersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, hybridAksClusterName: string, options?: HybridAksClustersUpdateOptionalParams): Promise; +} + +// @public +export interface HybridAksClustersCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface HybridAksClustersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type HybridAksClustersCreateOrUpdateResponse = HybridAksCluster; + +// @public +export interface HybridAksClustersDeleteHeaders { + location?: string; +} + +// @public +export interface HybridAksClustersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface HybridAksClustersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridAksClustersGetResponse = HybridAksCluster; + +// @public +export interface HybridAksClustersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridAksClustersListByResourceGroupNextResponse = HybridAksClusterList; + +// @public +export interface HybridAksClustersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridAksClustersListByResourceGroupResponse = HybridAksClusterList; + +// @public +export interface HybridAksClustersListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridAksClustersListBySubscriptionNextResponse = HybridAksClusterList; + +// @public +export interface HybridAksClustersListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridAksClustersListBySubscriptionResponse = HybridAksClusterList; + +// @public +export interface HybridAksClustersRestartNodeHeaders { + location?: string; +} + +// @public +export interface HybridAksClustersRestartNodeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type HybridAksClustersRestartNodeResponse = HybridAksClustersRestartNodeHeaders; + +// @public +export interface HybridAksClustersUpdateOptionalParams extends coreClient.OperationOptions { + hybridAksClusterUpdateParameters?: HybridAksClusterPatchParameters; +} + +// @public +export type HybridAksClustersUpdateResponse = HybridAksCluster; + +// @public +export type HybridAksIpamEnabled = string; + +// @public +export type HybridAksPluginType = string; + +// @public +export interface ImageRepositoryCredentials { + password: string; + registryUrl: string; + username: string; +} + +// @public +export type IpAllocationType = string; + +// @public +export interface KeySetUser { + azureUserName: string; + description?: string; + sshPublicKey: SshPublicKey; +} + +// @public +export interface KeySetUserStatus { + readonly azureUserName?: string; + readonly status?: BareMetalMachineKeySetUserSetupStatus; + readonly statusMessage?: string; +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownBareMetalMachineCordonStatus { + Cordoned = "Cordoned", + Uncordoned = "Uncordoned" +} + +// @public +export enum KnownBareMetalMachineDetailedStatus { + Available = "Available", + Deprovisioning = "Deprovisioning", + Error = "Error", + Preparing = "Preparing", + Provisioned = "Provisioned", + Provisioning = "Provisioning" +} + +// @public +export enum KnownBareMetalMachineEvacuate { + False = "False", + True = "True" +} + +// @public +export enum KnownBareMetalMachineHardwareValidationCategory { + BasicValidation = "BasicValidation" +} + +// @public +export enum KnownBareMetalMachineHardwareValidationResult { + Fail = "Fail", + Pass = "Pass" +} + +// @public +export enum KnownBareMetalMachineKeySetDetailedStatus { + AllActive = "AllActive", + AllInvalid = "AllInvalid", + SomeInvalid = "SomeInvalid", + Validating = "Validating" +} + +// @public +export enum KnownBareMetalMachineKeySetPrivilegeLevel { + Standard = "Standard", + Superuser = "Superuser" +} + +// @public +export enum KnownBareMetalMachineKeySetProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownBareMetalMachineKeySetUserSetupStatus { + Active = "Active", + Invalid = "Invalid" +} + +// @public +export enum KnownBareMetalMachinePowerState { + Off = "Off", + On = "On" +} + +// @public +export enum KnownBareMetalMachineProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownBareMetalMachineReadyState { + False = "False", + True = "True" +} + +// @public +export enum KnownBareMetalMachineSkipShutdown { + False = "False", + True = "True" +} + +// @public +export enum KnownBmcKeySetDetailedStatus { + AllActive = "AllActive", + AllInvalid = "AllInvalid", + SomeInvalid = "SomeInvalid", + Validating = "Validating" +} + +// @public +export enum KnownBmcKeySetPrivilegeLevel { + Administrator = "Administrator", + ReadOnly = "ReadOnly" +} + +// @public +export enum KnownBmcKeySetProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownBootstrapProtocol { + PXE = "PXE" +} + +// @public +export enum KnownCloudServicesNetworkDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownCloudServicesNetworkEnableDefaultEgressEndpoints { + False = "False", + True = "True" +} + +// @public +export enum KnownCloudServicesNetworkProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownClusterConnectionStatus { + Connected = "Connected", + Timeout = "Timeout", + Undefined = "Undefined" +} + +// @public +export enum KnownClusterDetailedStatus { + Degraded = "Degraded", + Deleting = "Deleting", + Deploying = "Deploying", + Disconnected = "Disconnected", + Failed = "Failed", + PendingDeployment = "PendingDeployment", + Running = "Running", + Updating = "Updating" +} + +// @public +export enum KnownClusterManagerConnectionStatus { + Connected = "Connected", + Unreachable = "Unreachable" +} + +// @public +export enum KnownClusterManagerDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning", + ProvisioningFailed = "ProvisioningFailed", + UpdateFailed = "UpdateFailed", + Updating = "Updating" +} + +// @public +export enum KnownClusterManagerProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownClusterMetricsConfigurationDetailedStatus { + Applied = "Applied", + Error = "Error", + Processing = "Processing" +} + +// @public +export enum KnownClusterMetricsConfigurationProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownClusterProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating", + Validating = "Validating" +} + +// @public +export enum KnownClusterType { + MultiRack = "MultiRack", + SingleRack = "SingleRack" +} + +// @public +export enum KnownConsoleDetailedStatus { + Error = "Error", + Ready = "Ready" +} + +// @public +export enum KnownConsoleEnabled { + False = "False", + True = "True" +} + +// @public +export enum KnownConsoleProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownControlImpact { + False = "False", + True = "True" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDefaultCniNetworkDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownDefaultCniNetworkProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownDefaultGateway { + False = "False", + True = "True" +} + +// @public +export enum KnownDeviceConnectionType { + PCI = "PCI" +} + +// @public +export enum KnownDiskType { + HDD = "HDD", + SSD = "SSD" +} + +// @public +export enum KnownHybridAksClusterDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownHybridAksClusterMachinePowerState { + Off = "Off", + On = "On" +} + +// @public +export enum KnownHybridAksClusterProvisioningState { + Canceled = "Canceled", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownHybridAksIpamEnabled { + False = "False", + True = "True" +} + +// @public +export enum KnownHybridAksPluginType { + Dpdk = "DPDK", + OSDevice = "OSDevice", + Sriov = "SRIOV" +} + +// @public +export enum KnownIpAllocationType { + DualStack = "DualStack", + IPV4 = "IPV4", + IPV6 = "IPV6" +} + +// @public +export enum KnownL2NetworkDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownL2NetworkProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownL3NetworkDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownL3NetworkProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownMachineSkuDiskConnectionType { + Pcie = "PCIE", + Raid = "RAID", + SAS = "SAS", + Sata = "SATA" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownOsDiskCreateOption { + Ephemeral = "Ephemeral" +} + +// @public +export enum KnownOsDiskDeleteOption { + Delete = "Delete" +} + +// @public +export enum KnownRackDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownRackProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownRackSkuProvisioningState { + Succeeded = "Succeeded" +} + +// @public +export enum KnownRackSkuType { + Aggregator = "Aggregator", + Compute = "Compute", + Single = "Single" +} + +// @public +export enum KnownRemoteVendorManagementFeature { + Supported = "Supported", + Unsupported = "Unsupported" +} + +// @public +export enum KnownRemoteVendorManagementStatus { + Disabled = "Disabled", + Enabled = "Enabled", + Unsupported = "Unsupported" +} + +// @public +export enum KnownSkipShutdown { + False = "False", + True = "True" +} + +// @public +export enum KnownStorageApplianceDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownStorageApplianceHardwareValidationCategory { + BasicValidation = "BasicValidation" +} + +// @public +export enum KnownStorageApplianceProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownTrunkedNetworkDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownTrunkedNetworkProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownValidationThresholdGrouping { + PerCluster = "PerCluster", + PerRack = "PerRack" +} + +// @public +export enum KnownValidationThresholdType { + CountSuccess = "CountSuccess", + PercentSuccess = "PercentSuccess" +} + +// @public +export enum KnownVirtualMachineBootMethod { + Bios = "BIOS", + Uefi = "UEFI" +} + +// @public +export enum KnownVirtualMachineDetailedStatus { + Available = "Available", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownVirtualMachineDeviceModelType { + T1 = "T1", + T2 = "T2" +} + +// @public +export enum KnownVirtualMachineIPAllocationMethod { + Disabled = "Disabled", + Dynamic = "Dynamic", + Static = "Static" +} + +// @public +export enum KnownVirtualMachineIsolateEmulatorThread { + False = "False", + True = "True" +} + +// @public +export enum KnownVirtualMachinePlacementHintPodAffinityScope { + Machine = "Machine", + Rack = "Rack" +} + +// @public +export enum KnownVirtualMachinePlacementHintType { + Affinity = "Affinity", + AntiAffinity = "AntiAffinity" +} + +// @public +export enum KnownVirtualMachinePowerState { + Off = "Off", + On = "On" +} + +// @public +export enum KnownVirtualMachineProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownVirtualMachineSchedulingExecution { + Hard = "Hard", + Soft = "Soft" +} + +// @public +export enum KnownVirtualMachineVirtioInterfaceType { + Modern = "Modern", + Transitional = "Transitional" +} + +// @public +export enum KnownVolumeDetailedStatus { + Active = "Active", + Error = "Error", + Provisioning = "Provisioning" +} + +// @public +export enum KnownVolumeProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Failed = "Failed", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownWorkloadImpact { + False = "False", + True = "True" +} + +// @public +export interface L2Network extends TrackedResource { + readonly clusterId?: string; + readonly detailedStatus?: L2NetworkDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + readonly hybridAksClustersAssociatedIds?: string[]; + hybridAksPluginType?: HybridAksPluginType; + interfaceName?: string; + l2IsolationDomainId: string; + readonly provisioningState?: L2NetworkProvisioningState; + readonly virtualMachinesAssociatedIds?: string[]; +} + +// @public +export type L2NetworkDetailedStatus = string; + +// @public +export interface L2NetworkList { + nextLink?: string; + value?: L2Network[]; +} + +// @public +export interface L2NetworkPatchParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type L2NetworkProvisioningState = string; + +// @public +export interface L2Networks { + beginCreateOrUpdate(resourceGroupName: string, l2NetworkName: string, l2NetworkParameters: L2Network, options?: L2NetworksCreateOrUpdateOptionalParams): Promise, L2NetworksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, l2NetworkName: string, l2NetworkParameters: L2Network, options?: L2NetworksCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, l2NetworkName: string, options?: L2NetworksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, l2NetworkName: string, options?: L2NetworksDeleteOptionalParams): Promise; + get(resourceGroupName: string, l2NetworkName: string, options?: L2NetworksGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: L2NetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: L2NetworksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, l2NetworkName: string, options?: L2NetworksUpdateOptionalParams): Promise; +} + +// @public +export interface L2NetworksCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface L2NetworksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type L2NetworksCreateOrUpdateResponse = L2Network; + +// @public +export interface L2NetworksDeleteHeaders { + location?: string; +} + +// @public +export interface L2NetworksDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface L2NetworksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L2NetworksGetResponse = L2Network; + +// @public +export interface L2NetworksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L2NetworksListByResourceGroupNextResponse = L2NetworkList; + +// @public +export interface L2NetworksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L2NetworksListByResourceGroupResponse = L2NetworkList; + +// @public +export interface L2NetworksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L2NetworksListBySubscriptionNextResponse = L2NetworkList; + +// @public +export interface L2NetworksListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L2NetworksListBySubscriptionResponse = L2NetworkList; + +// @public +export interface L2NetworksUpdateOptionalParams extends coreClient.OperationOptions { + l2NetworkUpdateParameters?: L2NetworkPatchParameters; +} + +// @public +export type L2NetworksUpdateResponse = L2Network; + +// @public +export interface L3Network extends TrackedResource { + readonly clusterId?: string; + readonly detailedStatus?: L3NetworkDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + readonly hybridAksClustersAssociatedIds?: string[]; + hybridAksIpamEnabled?: HybridAksIpamEnabled; + hybridAksPluginType?: HybridAksPluginType; + interfaceName?: string; + ipAllocationType?: IpAllocationType; + ipv4ConnectedPrefix?: string; + ipv6ConnectedPrefix?: string; + l3IsolationDomainId: string; + readonly provisioningState?: L3NetworkProvisioningState; + readonly virtualMachinesAssociatedIds?: string[]; + vlan: number; +} + +// @public +export type L3NetworkDetailedStatus = string; + +// @public +export interface L3NetworkList { + nextLink?: string; + value?: L3Network[]; +} + +// @public +export interface L3NetworkPatchParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type L3NetworkProvisioningState = string; + +// @public +export interface L3Networks { + beginCreateOrUpdate(resourceGroupName: string, l3NetworkName: string, l3NetworkParameters: L3Network, options?: L3NetworksCreateOrUpdateOptionalParams): Promise, L3NetworksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, l3NetworkName: string, l3NetworkParameters: L3Network, options?: L3NetworksCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, l3NetworkName: string, options?: L3NetworksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, l3NetworkName: string, options?: L3NetworksDeleteOptionalParams): Promise; + get(resourceGroupName: string, l3NetworkName: string, options?: L3NetworksGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: L3NetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: L3NetworksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, l3NetworkName: string, options?: L3NetworksUpdateOptionalParams): Promise; +} + +// @public +export interface L3NetworksCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface L3NetworksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type L3NetworksCreateOrUpdateResponse = L3Network; + +// @public +export interface L3NetworksDeleteHeaders { + location?: string; +} + +// @public +export interface L3NetworksDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface L3NetworksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L3NetworksGetResponse = L3Network; + +// @public +export interface L3NetworksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L3NetworksListByResourceGroupNextResponse = L3NetworkList; + +// @public +export interface L3NetworksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L3NetworksListByResourceGroupResponse = L3NetworkList; + +// @public +export interface L3NetworksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L3NetworksListBySubscriptionNextResponse = L3NetworkList; + +// @public +export interface L3NetworksListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type L3NetworksListBySubscriptionResponse = L3NetworkList; + +// @public +export interface L3NetworksUpdateOptionalParams extends coreClient.OperationOptions { + l3NetworkUpdateParameters?: L3NetworkPatchParameters; +} + +// @public +export type L3NetworksUpdateResponse = L3Network; + +// @public +export interface LldpNeighbor { + readonly portDescription?: string; + readonly portName?: string; + readonly systemDescription?: string; + readonly systemName?: string; +} + +// @public +export interface MachineDisk { + readonly capacityGB?: number; + readonly connection?: MachineSkuDiskConnectionType; + readonly type?: DiskType; +} + +// @public +export type MachineSkuDiskConnectionType = string; + +// @public +export interface MachineSkuSlot { + readonly bootstrapProtocol?: BootstrapProtocol; + readonly cpuCores?: number; + readonly cpuSockets?: number; + readonly disks?: MachineDisk[]; + readonly generation?: string; + readonly hardwareVersion?: string; + readonly memoryCapacityGB?: number; + readonly model?: string; + readonly networkInterfaces?: NetworkInterface[]; + readonly rackSlot?: number; + readonly totalThreads?: number; + readonly vendor?: string; +} + +// @public +export interface ManagedResourceGroupConfiguration { + location?: string; + name?: string; +} + +// @public +export interface MetricsConfigurations { + beginCreateOrUpdate(resourceGroupName: string, clusterName: string, metricsConfigurationName: string, metricsConfigurationParameters: ClusterMetricsConfiguration, options?: MetricsConfigurationsCreateOrUpdateOptionalParams): Promise, MetricsConfigurationsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, clusterName: string, metricsConfigurationName: string, metricsConfigurationParameters: ClusterMetricsConfiguration, options?: MetricsConfigurationsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, metricsConfigurationName: string, options?: MetricsConfigurationsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, metricsConfigurationName: string, options?: MetricsConfigurationsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, metricsConfigurationName: string, options?: MetricsConfigurationsUpdateOptionalParams): Promise, MetricsConfigurationsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, clusterName: string, metricsConfigurationName: string, options?: MetricsConfigurationsUpdateOptionalParams): Promise; + get(resourceGroupName: string, clusterName: string, metricsConfigurationName: string, options?: MetricsConfigurationsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, clusterName: string, options?: MetricsConfigurationsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MetricsConfigurationsCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface MetricsConfigurationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MetricsConfigurationsCreateOrUpdateResponse = ClusterMetricsConfiguration; + +// @public +export interface MetricsConfigurationsDeleteHeaders { + location?: string; +} + +// @public +export interface MetricsConfigurationsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface MetricsConfigurationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricsConfigurationsGetResponse = ClusterMetricsConfiguration; + +// @public +export interface MetricsConfigurationsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricsConfigurationsListByResourceGroupNextResponse = ClusterMetricsConfigurationList; + +// @public +export interface MetricsConfigurationsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetricsConfigurationsListByResourceGroupResponse = ClusterMetricsConfigurationList; + +// @public +export interface MetricsConfigurationsUpdateHeaders { + location?: string; +} + +// @public +export interface MetricsConfigurationsUpdateOptionalParams extends coreClient.OperationOptions { + metricsConfigurationUpdateParameters?: ClusterMetricsConfigurationPatchParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MetricsConfigurationsUpdateResponse = ClusterMetricsConfiguration; + +// @public +export interface NetworkAttachment { + attachedNetworkId: string; + defaultGateway?: DefaultGateway; + ipAllocationMethod: VirtualMachineIPAllocationMethod; + ipv4Address?: string; + ipv6Address?: string; + readonly macAddress?: string; + networkAttachmentName?: string; +} + +// @public (undocumented) +export class NetworkCloud extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: NetworkCloudOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + bareMetalMachineKeySets: BareMetalMachineKeySets; + // (undocumented) + bareMetalMachines: BareMetalMachines; + // (undocumented) + bmcKeySets: BmcKeySets; + // (undocumented) + cloudServicesNetworks: CloudServicesNetworks; + // (undocumented) + clusterManagers: ClusterManagers; + // (undocumented) + clusters: Clusters; + // (undocumented) + consoles: Consoles; + // (undocumented) + defaultCniNetworks: DefaultCniNetworks; + // (undocumented) + hybridAksClusters: HybridAksClusters; + // (undocumented) + l2Networks: L2Networks; + // (undocumented) + l3Networks: L3Networks; + // (undocumented) + metricsConfigurations: MetricsConfigurations; + // (undocumented) + operations: Operations; + // (undocumented) + racks: Racks; + // (undocumented) + rackSkus: RackSkus; + // (undocumented) + storageAppliances: StorageAppliances; + // (undocumented) + subscriptionId: string; + // (undocumented) + trunkedNetworks: TrunkedNetworks; + // (undocumented) + virtualMachines: VirtualMachines; + // (undocumented) + volumes: Volumes; +} + +// @public +export interface NetworkCloudOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface NetworkInterface { + readonly address?: string; + readonly deviceConnectionType?: DeviceConnectionType; + readonly model?: string; + readonly physicalSlot?: number; + readonly portCount?: number; + readonly portSpeed?: number; + readonly vendor?: string; +} + +// @public +export interface Nic { + readonly lldpNeighbor?: LldpNeighbor; + readonly macAddress?: string; + readonly name?: string; +} + +// @public +interface Node_2 { + readonly bareMetalMachineId?: string; + readonly imageId?: string; + readonly networkAttachments?: NetworkAttachment[]; + readonly nodeName?: string; + readonly powerState?: HybridAksClusterMachinePowerState; +} +export { Node_2 as Node } + +// @public +export interface NodeConfiguration { + readonly agentPoolId?: string; + readonly agentPoolName?: string; + readonly cpuCores?: number; + readonly diskSizeGB?: number; + readonly memorySizeGB?: number; + readonly nodePoolName?: string; + readonly nodes?: Node_2[]; + readonly vmCount?: number; + readonly vmSize?: string; +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + +// @public +export interface OsDisk { + createOption?: OsDiskCreateOption; + deleteOption?: OsDiskDeleteOption; + diskSizeGB: number; +} + +// @public +export type OsDiskCreateOption = string; + +// @public +export type OsDiskDeleteOption = string; + +// @public +export interface Rack extends TrackedResource { + availabilityZone: string; + readonly clusterId?: string; + readonly detailedStatus?: RackDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + readonly provisioningState?: RackProvisioningState; + rackLocation: string; + rackSerialNumber: string; + rackSkuId: string; +} + +// @public +export interface RackDefinition { + availabilityZone?: string; + bareMetalMachineConfigurationData?: BareMetalMachineConfigurationData[]; + networkRackId: string; + rackLocation?: string; + rackSerialNumber: string; + rackSkuId: string; + storageApplianceConfigurationData?: StorageApplianceConfigurationData[]; +} + +// @public +export type RackDetailedStatus = string; + +// @public +export interface RackList { + nextLink?: string; + value?: Rack[]; +} + +// @public +export interface RackPatchParameters { + rackLocation?: string; + rackSerialNumber?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type RackProvisioningState = string; + +// @public +export interface Racks { + beginCreateOrUpdate(resourceGroupName: string, rackName: string, rackParameters: Rack, options?: RacksCreateOrUpdateOptionalParams): Promise, RacksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, rackName: string, rackParameters: Rack, options?: RacksCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, rackName: string, options?: RacksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, rackName: string, options?: RacksDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, rackName: string, options?: RacksUpdateOptionalParams): Promise, RacksUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, rackName: string, options?: RacksUpdateOptionalParams): Promise; + get(resourceGroupName: string, rackName: string, options?: RacksGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: RacksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: RacksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RacksCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface RacksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RacksCreateOrUpdateResponse = Rack; + +// @public +export interface RacksDeleteHeaders { + location?: string; +} + +// @public +export interface RacksDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface RacksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RacksGetResponse = Rack; + +// @public +export interface RackSku extends Resource { + readonly computeMachines?: MachineSkuSlot[]; + readonly controllerMachines?: MachineSkuSlot[]; + readonly description?: string; + readonly maxClusterSlots?: number; + readonly provisioningState?: RackSkuProvisioningState; + readonly rackType?: RackSkuType; + readonly storageAppliances?: StorageApplianceSkuSlot[]; + readonly supportedRackSkuIds?: string[]; +} + +// @public +export interface RackSkuList { + nextLink?: string; + value?: RackSku[]; +} + +// @public +export type RackSkuProvisioningState = string; + +// @public +export interface RackSkus { + get(rackSkuName: string, options?: RackSkusGetOptionalParams): Promise; + listBySubscription(options?: RackSkusListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RackSkusGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RackSkusGetResponse = RackSku; + +// @public +export interface RackSkusListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RackSkusListBySubscriptionNextResponse = RackSkuList; + +// @public +export interface RackSkusListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RackSkusListBySubscriptionResponse = RackSkuList; + +// @public +export type RackSkuType = string; + +// @public +export interface RacksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RacksListByResourceGroupNextResponse = RackList; + +// @public +export interface RacksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RacksListByResourceGroupResponse = RackList; + +// @public +export interface RacksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RacksListBySubscriptionNextResponse = RackList; + +// @public +export interface RacksListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RacksListBySubscriptionResponse = RackList; + +// @public +export interface RacksUpdateHeaders { + location?: string; +} + +// @public +export interface RacksUpdateOptionalParams extends coreClient.OperationOptions { + rackUpdateParameters?: RackPatchParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RacksUpdateResponse = Rack; + +// @public +export type RemoteVendorManagementFeature = string; + +// @public +export type RemoteVendorManagementStatus = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ServicePrincipalInformation { + applicationId: string; + password: string; + principalId: string; + tenantId: string; +} + +// @public +export type SkipShutdown = string; + +// @public +export interface SshPublicKey { + keyData: string; +} + +// @public +export interface StorageAppliance extends TrackedResource { + administratorCredentials: AdministrativeCredentials; + readonly capacity?: number; + readonly capacityUsed?: number; + readonly clusterId?: string; + readonly detailedStatus?: StorageApplianceDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + readonly managementIpv4Address?: string; + readonly provisioningState?: StorageApplianceProvisioningState; + rackId: string; + rackSlot: number; + readonly remoteVendorManagementFeature?: RemoteVendorManagementFeature; + readonly remoteVendorManagementStatus?: RemoteVendorManagementStatus; + serialNumber: string; + storageApplianceSkuId: string; +} + +// @public +export interface StorageApplianceCommandSpecification { + arguments?: string[]; + command: string; +} + +// @public +export interface StorageApplianceConfigurationData { + adminCredentials: AdministrativeCredentials; + rackSlot: number; + serialNumber: string; + storageApplianceName?: string; +} + +// @public +export type StorageApplianceDetailedStatus = string; + +// @public +export interface StorageApplianceEnableRemoteVendorManagementParameters { + supportEndpoints?: string[]; +} + +// @public +export type StorageApplianceHardwareValidationCategory = string; + +// @public +export interface StorageApplianceList { + nextLink?: string; + value?: StorageAppliance[]; +} + +// @public +export interface StorageAppliancePatchParameters { + serialNumber?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type StorageApplianceProvisioningState = string; + +// @public +export interface StorageApplianceRunReadCommandsParameters { + commands: StorageApplianceCommandSpecification[]; + limitTimeSeconds: number; +} + +// @public +export interface StorageAppliances { + beginCreateOrUpdate(resourceGroupName: string, storageApplianceName: string, storageApplianceParameters: StorageAppliance, options?: StorageAppliancesCreateOrUpdateOptionalParams): Promise, StorageAppliancesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, storageApplianceName: string, storageApplianceParameters: StorageAppliance, options?: StorageAppliancesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, storageApplianceName: string, options?: StorageAppliancesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, storageApplianceName: string, options?: StorageAppliancesDeleteOptionalParams): Promise; + beginDisableRemoteVendorManagement(resourceGroupName: string, storageApplianceName: string, options?: StorageAppliancesDisableRemoteVendorManagementOptionalParams): Promise, StorageAppliancesDisableRemoteVendorManagementResponse>>; + beginDisableRemoteVendorManagementAndWait(resourceGroupName: string, storageApplianceName: string, options?: StorageAppliancesDisableRemoteVendorManagementOptionalParams): Promise; + beginEnableRemoteVendorManagement(resourceGroupName: string, storageApplianceName: string, options?: StorageAppliancesEnableRemoteVendorManagementOptionalParams): Promise, StorageAppliancesEnableRemoteVendorManagementResponse>>; + beginEnableRemoteVendorManagementAndWait(resourceGroupName: string, storageApplianceName: string, options?: StorageAppliancesEnableRemoteVendorManagementOptionalParams): Promise; + beginRunReadCommands(resourceGroupName: string, storageApplianceName: string, storageApplianceRunReadCommandsParameters: StorageApplianceRunReadCommandsParameters, options?: StorageAppliancesRunReadCommandsOptionalParams): Promise, StorageAppliancesRunReadCommandsResponse>>; + beginRunReadCommandsAndWait(resourceGroupName: string, storageApplianceName: string, storageApplianceRunReadCommandsParameters: StorageApplianceRunReadCommandsParameters, options?: StorageAppliancesRunReadCommandsOptionalParams): Promise; + beginUpdate(resourceGroupName: string, storageApplianceName: string, options?: StorageAppliancesUpdateOptionalParams): Promise, StorageAppliancesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, storageApplianceName: string, options?: StorageAppliancesUpdateOptionalParams): Promise; + beginValidateHardware(resourceGroupName: string, storageApplianceName: string, storageApplianceValidateHardwareParameters: StorageApplianceValidateHardwareParameters, options?: StorageAppliancesValidateHardwareOptionalParams): Promise, StorageAppliancesValidateHardwareResponse>>; + beginValidateHardwareAndWait(resourceGroupName: string, storageApplianceName: string, storageApplianceValidateHardwareParameters: StorageApplianceValidateHardwareParameters, options?: StorageAppliancesValidateHardwareOptionalParams): Promise; + get(resourceGroupName: string, storageApplianceName: string, options?: StorageAppliancesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: StorageAppliancesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: StorageAppliancesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface StorageAppliancesCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface StorageAppliancesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageAppliancesCreateOrUpdateResponse = StorageAppliance; + +// @public +export interface StorageAppliancesDeleteHeaders { + location?: string; +} + +// @public +export interface StorageAppliancesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface StorageAppliancesDisableRemoteVendorManagementHeaders { + location?: string; +} + +// @public +export interface StorageAppliancesDisableRemoteVendorManagementOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageAppliancesDisableRemoteVendorManagementResponse = StorageAppliancesDisableRemoteVendorManagementHeaders; + +// @public +export interface StorageAppliancesEnableRemoteVendorManagementHeaders { + location?: string; +} + +// @public +export interface StorageAppliancesEnableRemoteVendorManagementOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + storageApplianceEnableRemoteVendorManagementParameters?: StorageApplianceEnableRemoteVendorManagementParameters; + updateIntervalInMs?: number; +} + +// @public +export type StorageAppliancesEnableRemoteVendorManagementResponse = StorageAppliancesEnableRemoteVendorManagementHeaders; + +// @public +export interface StorageAppliancesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAppliancesGetResponse = StorageAppliance; + +// @public +export interface StorageApplianceSkuSlot { + readonly capacityGB?: number; + readonly model?: string; + readonly rackSlot?: number; +} + +// @public +export interface StorageAppliancesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAppliancesListByResourceGroupNextResponse = StorageApplianceList; + +// @public +export interface StorageAppliancesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAppliancesListByResourceGroupResponse = StorageApplianceList; + +// @public +export interface StorageAppliancesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAppliancesListBySubscriptionNextResponse = StorageApplianceList; + +// @public +export interface StorageAppliancesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageAppliancesListBySubscriptionResponse = StorageApplianceList; + +// @public +export interface StorageAppliancesRunReadCommandsHeaders { + location?: string; +} + +// @public +export interface StorageAppliancesRunReadCommandsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageAppliancesRunReadCommandsResponse = StorageAppliancesRunReadCommandsHeaders; + +// @public +export interface StorageAppliancesUpdateHeaders { + location?: string; +} + +// @public +export interface StorageAppliancesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + storageApplianceUpdateParameters?: StorageAppliancePatchParameters; + updateIntervalInMs?: number; +} + +// @public +export type StorageAppliancesUpdateResponse = StorageAppliance; + +// @public +export interface StorageAppliancesValidateHardwareHeaders { + location?: string; +} + +// @public +export interface StorageAppliancesValidateHardwareOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageAppliancesValidateHardwareResponse = StorageAppliancesValidateHardwareHeaders; + +// @public +export interface StorageApplianceValidateHardwareParameters { + validationCategory: StorageApplianceHardwareValidationCategory; +} + +// @public +export interface StorageProfile { + osDisk: OsDisk; + volumeAttachments?: string[]; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TagsParameter { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface TrunkedNetwork extends TrackedResource { + readonly clusterId?: string; + readonly detailedStatus?: TrunkedNetworkDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + readonly hybridAksClustersAssociatedIds?: string[]; + hybridAksPluginType?: HybridAksPluginType; + interfaceName?: string; + isolationDomainIds: string[]; + readonly provisioningState?: TrunkedNetworkProvisioningState; + readonly virtualMachinesAssociatedIds?: string[]; + vlans: number[]; +} + +// @public +export type TrunkedNetworkDetailedStatus = string; + +// @public +export interface TrunkedNetworkList { + nextLink?: string; + value?: TrunkedNetwork[]; +} + +// @public +export interface TrunkedNetworkPatchParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type TrunkedNetworkProvisioningState = string; + +// @public +export interface TrunkedNetworks { + beginCreateOrUpdate(resourceGroupName: string, trunkedNetworkName: string, trunkedNetworkParameters: TrunkedNetwork, options?: TrunkedNetworksCreateOrUpdateOptionalParams): Promise, TrunkedNetworksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, trunkedNetworkName: string, trunkedNetworkParameters: TrunkedNetwork, options?: TrunkedNetworksCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, trunkedNetworkName: string, options?: TrunkedNetworksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, trunkedNetworkName: string, options?: TrunkedNetworksDeleteOptionalParams): Promise; + get(resourceGroupName: string, trunkedNetworkName: string, options?: TrunkedNetworksGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: TrunkedNetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: TrunkedNetworksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, trunkedNetworkName: string, options?: TrunkedNetworksUpdateOptionalParams): Promise; +} + +// @public +export interface TrunkedNetworksCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface TrunkedNetworksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type TrunkedNetworksCreateOrUpdateResponse = TrunkedNetwork; + +// @public +export interface TrunkedNetworksDeleteHeaders { + location?: string; +} + +// @public +export interface TrunkedNetworksDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface TrunkedNetworksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TrunkedNetworksGetResponse = TrunkedNetwork; + +// @public +export interface TrunkedNetworksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TrunkedNetworksListByResourceGroupNextResponse = TrunkedNetworkList; + +// @public +export interface TrunkedNetworksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TrunkedNetworksListByResourceGroupResponse = TrunkedNetworkList; + +// @public +export interface TrunkedNetworksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TrunkedNetworksListBySubscriptionNextResponse = TrunkedNetworkList; + +// @public +export interface TrunkedNetworksListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TrunkedNetworksListBySubscriptionResponse = TrunkedNetworkList; + +// @public +export interface TrunkedNetworksUpdateOptionalParams extends coreClient.OperationOptions { + trunkedNetworkUpdateParameters?: TrunkedNetworkPatchParameters; +} + +// @public +export type TrunkedNetworksUpdateResponse = TrunkedNetwork; + +// @public +export interface ValidationThreshold { + grouping: ValidationThresholdGrouping; + type: ValidationThresholdType; + value: number; +} + +// @public +export type ValidationThresholdGrouping = string; + +// @public +export type ValidationThresholdType = string; + +// @public +export interface VirtualMachine extends TrackedResource { + adminUsername: string; + readonly bareMetalMachineId?: string; + bootMethod?: VirtualMachineBootMethod; + cloudServicesNetworkAttachment: NetworkAttachment; + readonly clusterId?: string; + cpuCores: number; + readonly detailedStatus?: VirtualMachineDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + isolateEmulatorThread?: VirtualMachineIsolateEmulatorThread; + memorySizeGB: number; + networkAttachments?: NetworkAttachment[]; + networkData?: string; + placementHints?: VirtualMachinePlacementHint[]; + readonly powerState?: VirtualMachinePowerState; + readonly provisioningState?: VirtualMachineProvisioningState; + sshPublicKeys?: SshPublicKey[]; + storageProfile: StorageProfile; + userData?: string; + virtioInterface?: VirtualMachineVirtioInterfaceType; + vmDeviceModel?: VirtualMachineDeviceModelType; + vmImage: string; + vmImageRepositoryCredentials?: ImageRepositoryCredentials; + readonly volumes?: string[]; +} + +// @public +export type VirtualMachineBootMethod = string; + +// @public +export type VirtualMachineDetailedStatus = string; + +// @public +export type VirtualMachineDeviceModelType = string; + +// @public +export type VirtualMachineIPAllocationMethod = string; + +// @public +export type VirtualMachineIsolateEmulatorThread = string; + +// @public +export interface VirtualMachineList { + nextLink?: string; + value?: VirtualMachine[]; +} + +// @public +export interface VirtualMachinePatchParameters { + tags?: { + [propertyName: string]: string; + }; + vmImageRepositoryCredentials?: ImageRepositoryCredentials; +} + +// @public +export interface VirtualMachinePlacementHint { + hintType: VirtualMachinePlacementHintType; + resourceId: string; + schedulingExecution: VirtualMachineSchedulingExecution; + scope: VirtualMachinePlacementHintPodAffinityScope; +} + +// @public +export type VirtualMachinePlacementHintPodAffinityScope = string; + +// @public +export type VirtualMachinePlacementHintType = string; + +// @public +export interface VirtualMachinePowerOffParameters { + skipShutdown?: SkipShutdown; +} + +// @public +export type VirtualMachinePowerState = string; + +// @public +export type VirtualMachineProvisioningState = string; + +// @public +export interface VirtualMachines { + beginAttachVolume(resourceGroupName: string, virtualMachineName: string, virtualMachineAttachVolumeParameters: VirtualMachineVolumeParameters, options?: VirtualMachinesAttachVolumeOptionalParams): Promise, VirtualMachinesAttachVolumeResponse>>; + beginAttachVolumeAndWait(resourceGroupName: string, virtualMachineName: string, virtualMachineAttachVolumeParameters: VirtualMachineVolumeParameters, options?: VirtualMachinesAttachVolumeOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, virtualMachineName: string, virtualMachineParameters: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise, VirtualMachinesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, virtualMachineName: string, virtualMachineParameters: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesDeleteOptionalParams): Promise; + beginDetachVolume(resourceGroupName: string, virtualMachineName: string, virtualMachineDetachVolumeParameters: VirtualMachineVolumeParameters, options?: VirtualMachinesDetachVolumeOptionalParams): Promise, VirtualMachinesDetachVolumeResponse>>; + beginDetachVolumeAndWait(resourceGroupName: string, virtualMachineName: string, virtualMachineDetachVolumeParameters: VirtualMachineVolumeParameters, options?: VirtualMachinesDetachVolumeOptionalParams): Promise; + beginPowerOff(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesPowerOffOptionalParams): Promise, VirtualMachinesPowerOffResponse>>; + beginPowerOffAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesPowerOffOptionalParams): Promise; + beginReimage(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesReimageOptionalParams): Promise, VirtualMachinesReimageResponse>>; + beginReimageAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesReimageOptionalParams): Promise; + beginRestart(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesRestartOptionalParams): Promise, VirtualMachinesRestartResponse>>; + beginRestartAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesRestartOptionalParams): Promise; + beginStart(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise, VirtualMachinesStartResponse>>; + beginStartAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesStartOptionalParams): Promise; + beginUpdate(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesUpdateOptionalParams): Promise, VirtualMachinesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesUpdateOptionalParams): Promise; + get(resourceGroupName: string, virtualMachineName: string, options?: VirtualMachinesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: VirtualMachinesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: VirtualMachinesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VirtualMachinesAttachVolumeHeaders { + location?: string; +} + +// @public +export interface VirtualMachinesAttachVolumeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesAttachVolumeResponse = VirtualMachinesAttachVolumeHeaders; + +// @public +export type VirtualMachineSchedulingExecution = string; + +// @public +export interface VirtualMachinesCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface VirtualMachinesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesCreateOrUpdateResponse = VirtualMachine; + +// @public +export interface VirtualMachinesDeleteHeaders { + location?: string; +} + +// @public +export interface VirtualMachinesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesDetachVolumeHeaders { + location?: string; +} + +// @public +export interface VirtualMachinesDetachVolumeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesDetachVolumeResponse = VirtualMachinesDetachVolumeHeaders; + +// @public +export interface VirtualMachinesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesGetResponse = VirtualMachine; + +// @public +export interface VirtualMachinesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesListByResourceGroupNextResponse = VirtualMachineList; + +// @public +export interface VirtualMachinesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesListByResourceGroupResponse = VirtualMachineList; + +// @public +export interface VirtualMachinesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesListBySubscriptionNextResponse = VirtualMachineList; + +// @public +export interface VirtualMachinesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualMachinesListBySubscriptionResponse = VirtualMachineList; + +// @public +export interface VirtualMachinesPowerOffHeaders { + location?: string; +} + +// @public +export interface VirtualMachinesPowerOffOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; + virtualMachinePowerOffParameters?: VirtualMachinePowerOffParameters; +} + +// @public +export type VirtualMachinesPowerOffResponse = VirtualMachinesPowerOffHeaders; + +// @public +export interface VirtualMachinesReimageHeaders { + location?: string; +} + +// @public +export interface VirtualMachinesReimageOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesReimageResponse = VirtualMachinesReimageHeaders; + +// @public +export interface VirtualMachinesRestartHeaders { + location?: string; +} + +// @public +export interface VirtualMachinesRestartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesRestartResponse = VirtualMachinesRestartHeaders; + +// @public +export interface VirtualMachinesStartHeaders { + location?: string; +} + +// @public +export interface VirtualMachinesStartOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualMachinesStartResponse = VirtualMachinesStartHeaders; + +// @public +export interface VirtualMachinesUpdateHeaders { + location?: string; +} + +// @public +export interface VirtualMachinesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; + virtualMachineUpdateParameters?: VirtualMachinePatchParameters; +} + +// @public +export type VirtualMachinesUpdateResponse = VirtualMachine; + +// @public +export type VirtualMachineVirtioInterfaceType = string; + +// @public +export interface VirtualMachineVolumeParameters { + volumeId: string; +} + +// @public +export interface Volume extends TrackedResource { + readonly attachedTo?: string[]; + readonly detailedStatus?: VolumeDetailedStatus; + readonly detailedStatusMessage?: string; + extendedLocation: ExtendedLocation; + readonly provisioningState?: VolumeProvisioningState; + readonly serialNumber?: string; + sizeMiB: number; +} + +// @public +export type VolumeDetailedStatus = string; + +// @public +export interface VolumeList { + nextLink?: string; + value?: Volume[]; +} + +// @public +export interface VolumePatchParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type VolumeProvisioningState = string; + +// @public +export interface Volumes { + beginCreateOrUpdate(resourceGroupName: string, volumeName: string, volumeParameters: Volume, options?: VolumesCreateOrUpdateOptionalParams): Promise, VolumesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, volumeName: string, volumeParameters: Volume, options?: VolumesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise; + get(resourceGroupName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: VolumesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: VolumesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, volumeName: string, options?: VolumesUpdateOptionalParams): Promise; +} + +// @public +export interface VolumesCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface VolumesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VolumesCreateOrUpdateResponse = Volume; + +// @public +export interface VolumesDeleteHeaders { + location?: string; +} + +// @public +export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VolumesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesGetResponse = Volume; + +// @public +export interface VolumesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListByResourceGroupNextResponse = VolumeList; + +// @public +export interface VolumesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListByResourceGroupResponse = VolumeList; + +// @public +export interface VolumesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListBySubscriptionNextResponse = VolumeList; + +// @public +export interface VolumesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListBySubscriptionResponse = VolumeList; + +// @public +export interface VolumesUpdateOptionalParams extends coreClient.OperationOptions { + volumeUpdateParameters?: VolumePatchParameters; +} + +// @public +export type VolumesUpdateResponse = Volume; + +// @public +export type WorkloadImpact = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/networkcloud/arm-networkcloud/rollup.config.js b/sdk/networkcloud/arm-networkcloud/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/rollup.config.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs(), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/networkcloud/arm-networkcloud/sample.env b/sdk/networkcloud/arm-networkcloud/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..0d7b130c90e7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsCreateOrUpdateSample.ts @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BareMetalMachineKeySet, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @summary Create a new bare metal machine key set or update the existing one for the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Create.json + */ +async function createOrUpdateBareMetalMachineKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const bareMetalMachineKeySetParameters: BareMetalMachineKeySet = { + azureGroupId: "f110271b-XXXX-4163-9b99-214d91660f0e", + expiration: new Date("2022-12-31T23:59:59.008Z"), + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + jumpHostsAllowed: ["192.0.2.1", "192.0.2.5"], + location: "location", + osGroupName: "standardAccessGroup", + privilegeLevel: "Standard", + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + }, + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsDeleteSample.ts new file mode 100644 index 000000000000..4b4df293fa7d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the bare metal machine key set of the provided cluster. + * + * @summary Delete the bare metal machine key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Delete.json + */ +async function deleteBareMetalMachineKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.beginDeleteAndWait( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName + ); + console.log(result); +} + +async function main() { + deleteBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsGetSample.ts new file mode 100644 index 000000000000..292e7db65d27 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get bare metal machine key set of the provided cluster. + * + * @summary Get bare metal machine key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Get.json + */ +async function getBareMetalMachineKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.get( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName + ); + console.log(result); +} + +async function main() { + getBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsListByResourceGroupSample.ts new file mode 100644 index 000000000000..80f5ae210121 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsListByResourceGroupSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @summary Get a list of bare metal machine key sets of the cluster in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_ListByResourceGroup.json + */ +async function listBareMetalMachineKeySetOfClusterForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bareMetalMachineKeySets.listByResourceGroup( + resourceGroupName, + clusterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBareMetalMachineKeySetOfClusterForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsUpdateSample.ts new file mode 100644 index 000000000000..ea55372fe66c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachineKeySetsUpdateSample.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineKeySetPatchParameters, + BareMetalMachineKeySetsUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Patch.json + */ +async function patchBareMetalMachineKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const bareMetalMachineKeySetUpdateParameters: BareMetalMachineKeySetPatchParameters = { + expiration: new Date("2022-12-31T23:59:59.008Z"), + jumpHostsAllowed: ["192.0.2.1", "192.0.2.5"], + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + }, + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + } + ] + }; + const options: BareMetalMachineKeySetsUpdateOptionalParams = { + bareMetalMachineKeySetUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.beginUpdateAndWait( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + options + ); + console.log(result); +} + +async function main() { + patchBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesCordonSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesCordonSample.ts new file mode 100644 index 000000000000..9f0c7b443201 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesCordonSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineCordonParameters, + BareMetalMachinesCordonOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cordon the provided bare metal machine's Kubernetes node. + * + * @summary Cordon the provided bare metal machine's Kubernetes node. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Cordon.json + */ +async function cordonBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineCordonParameters: BareMetalMachineCordonParameters = { + evacuate: "True" + }; + const options: BareMetalMachinesCordonOptionalParams = { + bareMetalMachineCordonParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginCordonAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + cordonBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4c981508dfe3 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesCreateOrUpdateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BareMetalMachine, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Create.json + */ +async function createOrUpdateBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineParameters: BareMetalMachine = { + bmcConnectionString: "bmcconnectionstring", + bmcCredentials: { password: "{password}", username: "bmcuser" }, + bmcMacAddress: "00:00:4f:00:57:00", + bootMacAddress: "00:00:4e:00:58:af", + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + machineDetails: "User-provided machine details.", + machineName: "r01c001", + machineSkuId: "684E-3B16-399E", + rackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName", + rackSlot: 1, + serialNumber: "BM1219XXX", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesDeleteSample.ts new file mode 100644 index 000000000000..dc8d8ff13346 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Delete.json + */ +async function deleteBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginDeleteAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + deleteBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesGetSample.ts new file mode 100644 index 000000000000..20f071068f48 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided bare metal machine. + * + * @summary Get properties of the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Get.json + */ +async function getBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.get( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + getBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesListByResourceGroupSample.ts new file mode 100644 index 000000000000..47ff11a6227b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of bare metal machines in the provided resource group. + * + * @summary Get a list of bare metal machines in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListByResourceGroup.json + */ +async function listBareMetalMachinesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bareMetalMachines.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBareMetalMachinesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesListBySubscriptionSample.ts new file mode 100644 index 000000000000..2f53e7a9d79a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of bare metal machines in the provided subscription. + * + * @summary Get a list of bare metal machines in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListBySubscription.json + */ +async function listBareMetalMachinesForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bareMetalMachines.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBareMetalMachinesForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesPowerOffSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesPowerOffSample.ts new file mode 100644 index 000000000000..4f118e62e147 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesPowerOffSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachinePowerOffParameters, + BareMetalMachinesPowerOffOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Power off the provided bare metal machine. + * + * @summary Power off the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_PowerOff.json + */ +async function powerOffBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachinePowerOffParameters: BareMetalMachinePowerOffParameters = { + skipShutdown: "True" + }; + const options: BareMetalMachinesPowerOffOptionalParams = { + bareMetalMachinePowerOffParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginPowerOffAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + powerOffBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesReimageSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesReimageSample.ts new file mode 100644 index 000000000000..500b86ba8b64 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesReimageSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Reimage the provided bare metal machine. + * + * @summary Reimage the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Reimage.json + */ +async function reimageBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginReimageAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + reimageBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesReplaceSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesReplaceSample.ts new file mode 100644 index 000000000000..c7212b3d39b8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesReplaceSample.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineReplaceParameters, + BareMetalMachinesReplaceOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Replace the provided bare metal machine. + * + * @summary Replace the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Replace.json + */ +async function replaceBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineReplaceParameters: BareMetalMachineReplaceParameters = { + bmcCredentials: { password: "{password}", username: "bmcuser" }, + bmcMacAddress: "00:00:4f:00:57:ad", + bootMacAddress: "00:00:4e:00:58:af", + machineName: "name", + serialNumber: "BM1219XXX" + }; + const options: BareMetalMachinesReplaceOptionalParams = { + bareMetalMachineReplaceParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginReplaceAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + replaceBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRestartSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRestartSample.ts new file mode 100644 index 000000000000..ebbe461ecd95 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRestartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restart the provided bare metal machine. + * + * @summary Restart the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Restart.json + */ +async function restartBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRestartAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + restartBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunCommandSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunCommandSample.ts new file mode 100644 index 000000000000..dadaca0afa09 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunCommandSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineRunCommandParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunCommand.json + */ +async function runCommandOnBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineRunCommandParameters: BareMetalMachineRunCommandParameters = { + arguments: ["--argument1", "argument2"], + limitTimeSeconds: 60, + script: "cHdkCg==" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRunCommandAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunCommandParameters + ); + console.log(result); +} + +async function main() { + runCommandOnBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunDataExtractsSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunDataExtractsSample.ts new file mode 100644 index 000000000000..490cb272b05a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunDataExtractsSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineRunDataExtractsParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunDataExtracts.json + */ +async function runDataExtractionOnBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineRunDataExtractsParameters: BareMetalMachineRunDataExtractsParameters = { + limitTimeSeconds: 60, + commands: [{ command: "networkInfo" }] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRunDataExtractsAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunDataExtractsParameters + ); + console.log(result); +} + +async function main() { + runDataExtractionOnBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunReadCommandsSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunReadCommandsSample.ts new file mode 100644 index 000000000000..772996b91a7c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesRunReadCommandsSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineRunReadCommandsParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunReadCommands.json + */ +async function runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineRunReadCommandsParameters: BareMetalMachineRunReadCommandsParameters = { + limitTimeSeconds: 60, + commands: [ + { arguments: ["pods", "-A"], command: "kubectl get" }, + { arguments: ["192.168.0.99", "-c", "3"], command: "ping" } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRunReadCommandsAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunReadCommandsParameters + ); + console.log(result); +} + +async function main() { + runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesStartSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesStartSample.ts new file mode 100644 index 000000000000..74c46d8f13f1 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesStartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Start the provided bare metal machine. + * + * @summary Start the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Start.json + */ +async function startBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginStartAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + startBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesUncordonSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesUncordonSample.ts new file mode 100644 index 000000000000..1c013812ddb6 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesUncordonSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Uncordon the provided bare metal machine's Kubernetes node. + * + * @summary Uncordon the provided bare metal machine's Kubernetes node. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Uncordon.json + */ +async function uncordonBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginUncordonAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + uncordonBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesUpdateSample.ts new file mode 100644 index 000000000000..5061d64fc740 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesUpdateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachinePatchParameters, + BareMetalMachinesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Patch.json + */ +async function patchBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineUpdateParameters: BareMetalMachinePatchParameters = { + machineDetails: "machinedetails", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: BareMetalMachinesUpdateOptionalParams = { + bareMetalMachineUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginUpdateAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + patchBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesValidateHardwareSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesValidateHardwareSample.ts new file mode 100644 index 000000000000..cbd4442972b7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bareMetalMachinesValidateHardwareSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineValidateHardwareParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validate the hardware of the provided bare metal machine. + * + * @summary Validate the hardware of the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ValidateHardware.json + */ +async function validateTheBareMetalMachineHardware() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineValidateHardwareParameters: BareMetalMachineValidateHardwareParameters = { + validationCategory: "BasicValidation" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginValidateHardwareAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineValidateHardwareParameters + ); + console.log(result); +} + +async function main() { + validateTheBareMetalMachineHardware(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..cf9d48b62726 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsCreateOrUpdateSample.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BmcKeySet, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @summary Create a new baseboard management controller key set or update the existing one for the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Create.json + */ +async function createOrUpdateBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const bmcKeySetParameters: BmcKeySet = { + azureGroupId: "f110271b-XXXX-4163-9b99-214d91660f0e", + expiration: new Date("2022-12-31T23:59:59.008Z"), + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + privilegeLevel: "Administrator", + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + }, + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + bmcKeySetName, + bmcKeySetParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsDeleteSample.ts new file mode 100644 index 000000000000..bbfce0bc586f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the baseboard management controller key set of the provided cluster. + * + * @summary Delete the baseboard management controller key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Delete.json + */ +async function deleteBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.beginDeleteAndWait( + resourceGroupName, + clusterName, + bmcKeySetName + ); + console.log(result); +} + +async function main() { + deleteBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsGetSample.ts new file mode 100644 index 000000000000..5fefae63a853 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get baseboard management controller key set of the provided cluster. + * + * @summary Get baseboard management controller key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Get.json + */ +async function getBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.get( + resourceGroupName, + clusterName, + bmcKeySetName + ); + console.log(result); +} + +async function main() { + getBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsListByResourceGroupSample.ts new file mode 100644 index 000000000000..ad4c210d26b0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsListByResourceGroupSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @summary Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_ListByResourceGroup.json + */ +async function listBaseboardManagementControllerKeySetOfClusterForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bmcKeySets.listByResourceGroup( + resourceGroupName, + clusterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBaseboardManagementControllerKeySetOfClusterForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsUpdateSample.ts new file mode 100644 index 000000000000..92c7e4b07f5a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/bmcKeySetsUpdateSample.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BmcKeySetPatchParameters, + BmcKeySetsUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Patch.json + */ +async function patchBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const bmcKeySetUpdateParameters: BmcKeySetPatchParameters = { + expiration: new Date("2022-12-31T23:59:59.008Z"), + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + }, + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + } + ] + }; + const options: BmcKeySetsUpdateOptionalParams = { bmcKeySetUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.beginUpdateAndWait( + resourceGroupName, + clusterName, + bmcKeySetName, + options + ); + console.log(result); +} + +async function main() { + patchBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..98f3571cc5cf --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksCreateOrUpdateSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CloudServicesNetwork, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new cloud services network or update the properties of the existing cloud services network. + * + * @summary Create a new cloud services network or update the properties of the existing cloud services network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Create.json + */ +async function createOrUpdateCloudServicesNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const cloudServicesNetworkParameters: CloudServicesNetwork = { + additionalEgressEndpoints: [ + { + category: "azure-resource-management", + endpoints: [ + { + domainName: "https://storageaccountex.blob.core.windows.net", + port: 443 + } + ] + } + ], + enableDefaultEgressEndpoints: "False", + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServicesNetworkName, + cloudServicesNetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksDeleteSample.ts new file mode 100644 index 000000000000..2c63832861a0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided cloud services network. + * + * @summary Delete the provided cloud services network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Delete.json + */ +async function deleteCloudServicesNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.beginDeleteAndWait( + resourceGroupName, + cloudServicesNetworkName + ); + console.log(result); +} + +async function main() { + deleteCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksGetSample.ts new file mode 100644 index 000000000000..139f29e30a59 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided cloud services network. + * + * @summary Get properties of the provided cloud services network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Get.json + */ +async function getCloudServicesNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.get( + resourceGroupName, + cloudServicesNetworkName + ); + console.log(result); +} + +async function main() { + getCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..0ceca38f79ad --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of cloud services networks in the provided resource group. + * + * @summary Get a list of cloud services networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListByResourceGroup.json + */ +async function listCloudServicesNetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServicesNetworks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listCloudServicesNetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..f6769d5d3a78 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of cloud services networks in the provided subscription. + * + * @summary Get a list of cloud services networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListBySubscription.json + */ +async function listCloudServicesNetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServicesNetworks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listCloudServicesNetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksUpdateSample.ts new file mode 100644 index 000000000000..08c1998a176a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/cloudServicesNetworksUpdateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CloudServicesNetworkPatchParameters, + CloudServicesNetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently. + * + * @summary Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Patch.json + */ +async function patchCloudServicesNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const cloudServicesNetworkUpdateParameters: CloudServicesNetworkPatchParameters = { + additionalEgressEndpoints: [ + { + category: "azure-resource-management", + endpoints: [ + { + domainName: "https://storageaccountex.blob.core.windows.net", + port: 443 + } + ] + } + ], + enableDefaultEgressEndpoints: "False", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: CloudServicesNetworksUpdateOptionalParams = { + cloudServicesNetworkUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.beginUpdateAndWait( + resourceGroupName, + cloudServicesNetworkName, + options + ); + console.log(result); +} + +async function main() { + patchCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..124495f1da24 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersCreateOrUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ClusterManager, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @summary Create a new cluster manager or update properties of the cluster manager if it exists. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Create.json + */ +async function createOrUpdateClusterManager() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const clusterManagerParameters: ClusterManager = { + analyticsWorkspaceId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName", + fabricControllerId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName", + location: "location", + managedResourceGroupConfiguration: { + name: "my-managed-rg", + location: "East US" + }, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterManagerName, + clusterManagerParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersDeleteSample.ts new file mode 100644 index 000000000000..baf043da370f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided cluster manager. + * + * @summary Delete the provided cluster manager. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Delete.json + */ +async function deleteClusterManager() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.beginDeleteAndWait( + resourceGroupName, + clusterManagerName + ); + console.log(result); +} + +async function main() { + deleteClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersGetSample.ts new file mode 100644 index 000000000000..35d32d932b94 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the properties of the provided cluster manager. + * + * @summary Get the properties of the provided cluster manager. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Get.json + */ +async function getClusterManager() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.get( + resourceGroupName, + clusterManagerName + ); + console.log(result); +} + +async function main() { + getClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersListByResourceGroupSample.ts new file mode 100644 index 000000000000..f3b8d7cc2893 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of cluster managers in the provided resource group. + * + * @summary Get a list of cluster managers in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListByResourceGroup.json + */ +async function listClusterManagersForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusterManagers.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClusterManagersForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersListBySubscriptionSample.ts new file mode 100644 index 000000000000..da7b7ec0a349 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of cluster managers in the provided subscription. + * + * @summary Get a list of cluster managers in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListBySubscription.json + */ +async function listClusterManagersForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusterManagers.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClusterManagersForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersUpdateSample.ts new file mode 100644 index 000000000000..bda5db4d5c37 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clusterManagersUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterManagerPatchParameters, + ClusterManagersUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently. + * + * @summary Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Patch.json + */ +async function patchClusterManager() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const clusterManagerUpdateParameters: ClusterManagerPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: ClusterManagersUpdateOptionalParams = { + clusterManagerUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.update( + resourceGroupName, + clusterManagerName, + options + ); + console.log(result); +} + +async function main() { + patchClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clustersCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..8a887b3f5944 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersCreateOrUpdateSample.ts @@ -0,0 +1,148 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Cluster, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new cluster or update the properties of the cluster if it exists. + * + * @summary Create a new cluster or update the properties of the cluster if it exists. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Create.json + */ +async function createOrUpdateCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterParameters: Cluster = { + aggregatorOrSingleRackDefinition: { + bareMetalMachineConfigurationData: [ + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:FF", + bootMacAddress: "00:BB:CC:DD:EE:FF", + machineDetails: "extraDetails", + machineName: "bmmName1", + rackSlot: 1, + serialNumber: "BM1219XXX" + }, + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:00", + bootMacAddress: "00:BB:CC:DD:EE:00", + machineDetails: "extraDetails", + machineName: "bmmName2", + rackSlot: 2, + serialNumber: "BM1219YYY" + } + ], + networkRackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName", + rackLocation: "Foo Datacenter, Floor 3, Aisle 9, Rack 2", + rackSerialNumber: "AA1234", + rackSkuId: + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName", + storageApplianceConfigurationData: [ + { + adminCredentials: { password: "{password}", username: "username" }, + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceName: "vmName" + } + ] + }, + analyticsWorkspaceId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName", + clusterLocation: "Foo Street, 3rd Floor, row 9", + clusterServicePrincipal: { + applicationId: "12345678-1234-1234-1234-123456789012", + password: "{password}", + principalId: "00000008-0004-0004-0004-000000000012", + tenantId: "80000000-4000-4000-4000-120000000000" + }, + clusterType: "SingleRack", + clusterVersion: "1.0.0", + computeDeploymentThreshold: { + type: "PercentSuccess", + grouping: "PerCluster", + value: 90 + }, + computeRackDefinitions: [ + { + bareMetalMachineConfigurationData: [ + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:FF", + bootMacAddress: "00:BB:CC:DD:EE:FF", + machineDetails: "extraDetails", + machineName: "bmmName1", + rackSlot: 1, + serialNumber: "BM1219XXX" + }, + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:00", + bootMacAddress: "00:BB:CC:DD:EE:00", + machineDetails: "extraDetails", + machineName: "bmmName2", + rackSlot: 2, + serialNumber: "BM1219YYY" + } + ], + networkRackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName", + rackLocation: "Foo Datacenter, Floor 3, Aisle 9, Rack 2", + rackSerialNumber: "AA1234", + rackSkuId: + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName", + storageApplianceConfigurationData: [ + { + adminCredentials: { password: "{password}", username: "username" }, + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceName: "vmName" + } + ] + } + ], + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + managedResourceGroupConfiguration: { + name: "my-managed-rg", + location: "East US" + }, + networkFabricId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + clusterParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clustersDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersDeleteSample.ts new file mode 100644 index 000000000000..7cac27450065 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided cluster. + * + * @summary Delete the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Delete.json + */ +async function deleteCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginDeleteAndWait( + resourceGroupName, + clusterName + ); + console.log(result); +} + +async function main() { + deleteCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clustersDeploySample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersDeploySample.ts new file mode 100644 index 000000000000..52ce2d98252d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersDeploySample.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterDeployParameters, + ClustersDeployOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deploy the cluster to the provided rack. + * + * @summary Deploy the cluster to the provided rack. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy.json + */ +async function deployCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterDeployParameters: ClusterDeployParameters = {}; + const options: ClustersDeployOptionalParams = { clusterDeployParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginDeployAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +/** + * This sample demonstrates how to Deploy the cluster to the provided rack. + * + * @summary Deploy the cluster to the provided rack. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy_SkipValidation.json + */ +async function deployClusterSkippingValidation() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterDeployParameters: ClusterDeployParameters = { + skipValidationsForMachines: ["bmmName1"] + }; + const options: ClustersDeployOptionalParams = { clusterDeployParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginDeployAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +async function main() { + deployCluster(); + deployClusterSkippingValidation(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clustersGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersGetSample.ts new file mode 100644 index 000000000000..2a2a80fc9df5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided cluster. + * + * @summary Get properties of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Get.json + */ +async function getCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.get(resourceGroupName, clusterName); + console.log(result); +} + +async function main() { + getCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clustersListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..cd0fb1922112 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of clusters in the provided resource group. + * + * @summary Get a list of clusters in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListByResourceGroup.json + */ +async function listClustersForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClustersForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clustersListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersListBySubscriptionSample.ts new file mode 100644 index 000000000000..640521d8fbfa --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of clusters in the provided subscription. + * + * @summary Get a list of clusters in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListBySubscription.json + */ +async function listClustersForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusters.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClustersForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clustersUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersUpdateSample.ts new file mode 100644 index 000000000000..fc049b98b1e0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersUpdateSample.ts @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterPatchParameters, + ClustersUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * + * @summary Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json + */ +async function patchClusterAggregatorOrSingleRackDefinition() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterUpdateParameters: ClusterPatchParameters = { + aggregatorOrSingleRackDefinition: { + bareMetalMachineConfigurationData: [ + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:FF", + bootMacAddress: "00:BB:CC:DD:EE:FF", + machineDetails: "extraDetails", + machineName: "bmmName1", + rackSlot: 1, + serialNumber: "BM1219XXX" + }, + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:00", + bootMacAddress: "00:BB:CC:DD:EE:00", + machineDetails: "extraDetails", + machineName: "bmmName2", + rackSlot: 2, + serialNumber: "BM1219YYY" + } + ], + networkRackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName", + rackLocation: "Foo Datacenter, Floor 3, Aisle 9, Rack 2", + rackSerialNumber: "newSerialNumber", + rackSkuId: + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName", + storageApplianceConfigurationData: [ + { + adminCredentials: { password: "{password}", username: "username" }, + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceName: "vmName" + } + ] + }, + computeDeploymentThreshold: { + type: "PercentSuccess", + grouping: "PerCluster", + value: 90 + }, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: ClustersUpdateOptionalParams = { clusterUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginUpdateAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +/** + * This sample demonstrates how to Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * + * @summary Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_Location.json + */ +async function patchClusterLocation() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterUpdateParameters: ClusterPatchParameters = { + clusterLocation: "Foo Street, 3rd Floor, row 9", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: ClustersUpdateOptionalParams = { clusterUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginUpdateAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +async function main() { + patchClusterAggregatorOrSingleRackDefinition(); + patchClusterLocation(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/clustersUpdateVersionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersUpdateVersionSample.ts new file mode 100644 index 000000000000..74b86c1057a0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/clustersUpdateVersionSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterUpdateVersionParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update the version of the provided cluster to one of the available supported versions. + * + * @summary Update the version of the provided cluster to one of the available supported versions. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_UpdateVersion.json + */ +async function updateClusterVersion() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterUpdateVersionParameters: ClusterUpdateVersionParameters = { + targetClusterVersion: "2.0" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginUpdateVersionAndWait( + resourceGroupName, + clusterName, + clusterUpdateVersionParameters + ); + console.log(result); +} + +async function main() { + updateClusterVersion(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/consolesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ea9919ac544d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesCreateOrUpdateSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Console, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @summary Create a new virtual machine console or update the properties of the existing virtual machine console. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Create.json + */ +async function createOrUpdateVirtualMachineConsole() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const consoleParameters: Console = { + enabled: "True", + expiration: new Date("2022-06-01T01:27:03.008Z"), + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + }, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.beginCreateOrUpdateAndWait( + resourceGroupName, + virtualMachineName, + consoleName, + consoleParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/consolesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesDeleteSample.ts new file mode 100644 index 000000000000..22c15c4a8c9d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided virtual machine console. + * + * @summary Delete the provided virtual machine console. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Delete.json + */ +async function deleteVirtualMachineConsole() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.beginDeleteAndWait( + resourceGroupName, + virtualMachineName, + consoleName + ); + console.log(result); +} + +async function main() { + deleteVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/consolesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesGetSample.ts new file mode 100644 index 000000000000..9e4b242515fc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided virtual machine console. + * + * @summary Get properties of the provided virtual machine console. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Get.json + */ +async function getVirtualMachineConsole() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.get( + resourceGroupName, + virtualMachineName, + consoleName + ); + console.log(result); +} + +async function main() { + getVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/consolesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesListByResourceGroupSample.ts new file mode 100644 index 000000000000..f4de06a4d4e2 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesListByResourceGroupSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of virtual machine consoles in the provided resource group. + * + * @summary Get a list of virtual machine consoles in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_ListByResourceGroup.json + */ +async function listVirtualMachineConsolesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.consoles.listByResourceGroup( + resourceGroupName, + virtualMachineName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVirtualMachineConsolesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/consolesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesUpdateSample.ts new file mode 100644 index 000000000000..6ed3af395227 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/consolesUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConsolePatchParameters, + ConsolesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Patch.json + */ +async function patchVirtualMachineConsole() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const consoleUpdateParameters: ConsolePatchParameters = { + enabled: "True", + expiration: new Date("2022-06-01T01:27:03.008Z"), + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + }, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: ConsolesUpdateOptionalParams = { consoleUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.beginUpdateAndWait( + resourceGroupName, + virtualMachineName, + consoleName, + options + ); + console.log(result); +} + +async function main() { + patchVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..59f909958225 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksCreateOrUpdateSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { DefaultCniNetwork, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new default CNI network or update the properties of the existing default CNI network. + * + * @summary Create a new default CNI network or update the properties of the existing default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Create.json + */ +async function createOrUpdateDefaultCniNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const defaultCniNetworkParameters: DefaultCniNetwork = { + cniBgpConfiguration: { + bgpPeers: [{ asNumber: 64497, peerIp: "203.0.113.254" }], + communityAdvertisements: [ + { communities: ["64512:100"], subnetPrefix: "192.0.2.0/27" } + ], + serviceExternalPrefixes: ["192.0.2.0/28"], + serviceLoadBalancerPrefixes: ["192.0.2.16/28"] + }, + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + ipAllocationType: "DualStack", + ipv4ConnectedPrefix: "203.0.113.0/24", + ipv6ConnectedPrefix: "2001:db8:0:3::/64", + l3IsolationDomainId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + vlan: 12 + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.beginCreateOrUpdateAndWait( + resourceGroupName, + defaultCniNetworkName, + defaultCniNetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksDeleteSample.ts new file mode 100644 index 000000000000..d453475c9011 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided default CNI network. + * + * @summary Delete the provided default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Delete.json + */ +async function deleteDefaultCniNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.beginDeleteAndWait( + resourceGroupName, + defaultCniNetworkName + ); + console.log(result); +} + +async function main() { + deleteDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksGetSample.ts new file mode 100644 index 000000000000..31ae97c88f8e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided default CNI network. + * + * @summary Get properties of the provided default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Get.json + */ +async function getDefaultCniNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.get( + resourceGroupName, + defaultCniNetworkName + ); + console.log(result); +} + +async function main() { + getDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..ade795e7cdc1 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of default CNI networks in the provided resource group. + * + * @summary Get a list of default CNI networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListByResourceGroup.json + */ +async function listDefaultCniNetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.defaultCniNetworks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listDefaultCniNetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..b878b94983cf --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of default CNI networks in the provided subscription. + * + * @summary Get a list of default CNI networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListBySubscription.json + */ +async function listDefaultCniNetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.defaultCniNetworks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listDefaultCniNetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksUpdateSample.ts new file mode 100644 index 000000000000..938d9dfafc62 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/defaultCniNetworksUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DefaultCniNetworkPatchParameters, + DefaultCniNetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided default CNI network. + * + * @summary Update tags associated with the provided default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Patch.json + */ +async function patchDefaultCniNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const defaultCniNetworkUpdateParameters: DefaultCniNetworkPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: DefaultCniNetworksUpdateOptionalParams = { + defaultCniNetworkUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.update( + resourceGroupName, + defaultCniNetworkName, + options + ); + console.log(result); +} + +async function main() { + patchDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f7c28554538b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersCreateOrUpdateSample.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridAksCluster, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Create.json + */ +async function createOrUpdateHybridAksProvisionedClusterData() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const hybridAksClusterParameters: HybridAksCluster = { + associatedNetworkIds: [ + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName" + ], + controlPlaneCount: 4, + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + hybridAksProvisionedClusterId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + workerCount: 8 + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + hybridAksClusterName, + hybridAksClusterParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersDeleteSample.ts new file mode 100644 index 000000000000..b946f6239bba --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Delete.json + */ +async function deleteHybridAksProvisionedClusterData() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.beginDeleteAndWait( + resourceGroupName, + hybridAksClusterName + ); + console.log(result); +} + +async function main() { + deleteHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersGetSample.ts new file mode 100644 index 000000000000..c1ee530d21d5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @summary Get the additional details related to the provided Hybrid AKS provisioned cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Get.json + */ +async function getHybridAksProvisionedClusterData() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.get( + resourceGroupName, + hybridAksClusterName + ); + console.log(result); +} + +async function main() { + getHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..43382219149f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @summary Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListByResourceGroup.json + */ +async function listHybridAksProvisionedClustersDataForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridAksClusters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listHybridAksProvisionedClustersDataForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersListBySubscriptionSample.ts new file mode 100644 index 000000000000..b4633672ff2e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @summary Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListBySubscription.json + */ +async function listHybridAksProvisionedClustersDataForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridAksClusters.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listHybridAksProvisionedClustersDataForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersRestartNodeSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersRestartNodeSample.ts new file mode 100644 index 000000000000..f022124b75b0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersRestartNodeSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + HybridAksClusterRestartNodeParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restart a targeted node of a Hybrid AKS cluster. + * + * @summary Restart a targeted node of a Hybrid AKS cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_RestartNode.json + */ +async function restartAHybridAksClusterNode() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const hybridAksClusterRestartNodeParameters: HybridAksClusterRestartNodeParameters = { + nodeName: "nodeName" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.beginRestartNodeAndWait( + resourceGroupName, + hybridAksClusterName, + hybridAksClusterRestartNodeParameters + ); + console.log(result); +} + +async function main() { + restartAHybridAksClusterNode(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersUpdateSample.ts new file mode 100644 index 000000000000..7171934ac698 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/hybridAksClustersUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + HybridAksClusterPatchParameters, + HybridAksClustersUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @summary Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Patch.json + */ +async function patchHybridAksProvisionedClusterData() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const hybridAksClusterUpdateParameters: HybridAksClusterPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: HybridAksClustersUpdateOptionalParams = { + hybridAksClusterUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.update( + resourceGroupName, + hybridAksClusterName, + options + ); + console.log(result); +} + +async function main() { + patchHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..868f622c5614 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksCreateOrUpdateSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { L2Network, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @summary Create a new layer 2 (L2) network or update the properties of the existing network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Create.json + */ +async function createOrUpdateL2Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const l2NetworkParameters: L2Network = { + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + hybridAksPluginType: "DPDK", + interfaceName: "eth0", + l2IsolationDomainId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.beginCreateOrUpdateAndWait( + resourceGroupName, + l2NetworkName, + l2NetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksDeleteSample.ts new file mode 100644 index 000000000000..aeab550418b0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided layer 2 (L2) network. + * + * @summary Delete the provided layer 2 (L2) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Delete.json + */ +async function deleteL2Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.beginDeleteAndWait( + resourceGroupName, + l2NetworkName + ); + console.log(result); +} + +async function main() { + deleteL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksGetSample.ts new file mode 100644 index 000000000000..65243d7a24dc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided layer 2 (L2) network. + * + * @summary Get properties of the provided layer 2 (L2) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Get.json + */ +async function getL2Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.get(resourceGroupName, l2NetworkName); + console.log(result); +} + +async function main() { + getL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..7176631e8d8c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of layer 2 (L2) networks in the provided resource group. + * + * @summary Get a list of layer 2 (L2) networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListByResourceGroup.json + */ +async function listL2NetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l2Networks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL2NetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..6b5f23e56e6a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of layer 2 (L2) networks in the provided subscription. + * + * @summary Get a list of layer 2 (L2) networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListBySubscription.json + */ +async function listL2NetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l2Networks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL2NetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksUpdateSample.ts new file mode 100644 index 000000000000..1c479207fddd --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l2NetworksUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + L2NetworkPatchParameters, + L2NetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided layer 2 (L2) network. + * + * @summary Update tags associated with the provided layer 2 (L2) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Patch.json + */ +async function patchL2Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const l2NetworkUpdateParameters: L2NetworkPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: L2NetworksUpdateOptionalParams = { l2NetworkUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.update( + resourceGroupName, + l2NetworkName, + options + ); + console.log(result); +} + +async function main() { + patchL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e9c035522882 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksCreateOrUpdateSample.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { L3Network, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @summary Create a new layer 3 (L3) network or update the properties of the existing network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Create.json + */ +async function createOrUpdateL3Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const l3NetworkParameters: L3Network = { + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + hybridAksIpamEnabled: "True", + hybridAksPluginType: "DPDK", + interfaceName: "eth0", + ipAllocationType: "DualStack", + ipv4ConnectedPrefix: "198.51.100.0/24", + ipv6ConnectedPrefix: "2001:db8::/64", + l3IsolationDomainId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + vlan: 12 + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.beginCreateOrUpdateAndWait( + resourceGroupName, + l3NetworkName, + l3NetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksDeleteSample.ts new file mode 100644 index 000000000000..1b4a804f4e59 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided layer 3 (L3) network. + * + * @summary Delete the provided layer 3 (L3) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Delete.json + */ +async function deleteL3Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.beginDeleteAndWait( + resourceGroupName, + l3NetworkName + ); + console.log(result); +} + +async function main() { + deleteL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksGetSample.ts new file mode 100644 index 000000000000..5f9218c96ee7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided layer 3 (L3) network. + * + * @summary Get properties of the provided layer 3 (L3) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Get.json + */ +async function getL3Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.get(resourceGroupName, l3NetworkName); + console.log(result); +} + +async function main() { + getL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..14e03decf9ed --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of layer 3 (L3) networks in the provided resource group. + * + * @summary Get a list of layer 3 (L3) networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListByResourceGroup.json + */ +async function listL3NetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l3Networks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL3NetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..23f6acf2b665 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of layer 3 (L3) networks in the provided subscription. + * + * @summary Get a list of layer 3 (L3) networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListBySubscription.json + */ +async function listL3NetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l3Networks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL3NetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksUpdateSample.ts new file mode 100644 index 000000000000..a7765938cbf7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/l3NetworksUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + L3NetworkPatchParameters, + L3NetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided layer 3 (L3) network. + * + * @summary Update tags associated with the provided layer 3 (L3) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Patch.json + */ +async function patchL3Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const l3NetworkUpdateParameters: L3NetworkPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: L3NetworksUpdateOptionalParams = { l3NetworkUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.update( + resourceGroupName, + l3NetworkName, + options + ); + console.log(result); +} + +async function main() { + patchL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..34fffb603c85 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsCreateOrUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterMetricsConfiguration, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update the metrics configuration of the provided cluster. + * + * @summary Update the metrics configuration of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Update.json + */ +async function updateMetricsConfigurationOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const metricsConfigurationParameters: ClusterMetricsConfiguration = { + collectionInterval: 15, + enabledMetrics: ["metric1", "metric2"], + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationParameters + ); + console.log(result); +} + +async function main() { + updateMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsDeleteSample.ts new file mode 100644 index 000000000000..2c42e753e258 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the metrics configuration of the provided cluster. + * + * @summary Delete the metrics configuration of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Delete.json + */ +async function deleteMetricsConfigurationOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.beginDeleteAndWait( + resourceGroupName, + clusterName, + metricsConfigurationName + ); + console.log(result); +} + +async function main() { + deleteMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsGetSample.ts new file mode 100644 index 000000000000..84951cfc543a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get metrics configuration of the provided cluster. + * + * @summary Get metrics configuration of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Get.json + */ +async function getMetricsConfigurationOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.get( + resourceGroupName, + clusterName, + metricsConfigurationName + ); + console.log(result); +} + +async function main() { + getMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsListByResourceGroupSample.ts new file mode 100644 index 000000000000..e7cb9e42535e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsListByResourceGroupSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of metrics configurations of the clusters in the provided resource group. + * + * @summary Get a list of metrics configurations of the clusters in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_ListByResourceGroup.json + */ +async function listMetricsConfigurationsOfClusterForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.metricsConfigurations.listByResourceGroup( + resourceGroupName, + clusterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listMetricsConfigurationsOfClusterForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsUpdateSample.ts new file mode 100644 index 000000000000..9b73a550f432 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/metricsConfigurationsUpdateSample.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterMetricsConfigurationPatchParameters, + MetricsConfigurationsUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. + * + * @summary Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Patch.json + */ +async function patchMetricsConfigurationOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const metricsConfigurationUpdateParameters: ClusterMetricsConfigurationPatchParameters = { + collectionInterval: 15, + enabledMetrics: ["metric1", "metric2"], + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: MetricsConfigurationsUpdateOptionalParams = { + metricsConfigurationUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.beginUpdateAndWait( + resourceGroupName, + clusterName, + metricsConfigurationName, + options + ); + console.log(result); +} + +async function main() { + patchMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/operationsListSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/operationsListSample.ts new file mode 100644 index 000000000000..f2487d6bcaa1 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/operationsListSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * + * @summary Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Operations_List.json + */ +async function listResourceProviderOperations() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listResourceProviderOperations(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/rackSkusGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/rackSkusGetSample.ts new file mode 100644 index 000000000000..fd9027a6a838 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/rackSkusGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the properties of the provided rack SKU. + * + * @summary Get the properties of the provided rack SKU. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_Get.json + */ +async function getRackSkuResource() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const rackSkuName = "rackSkuName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.rackSkus.get(rackSkuName); + console.log(result); +} + +async function main() { + getRackSkuResource(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/rackSkusListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/rackSkusListBySubscriptionSample.ts new file mode 100644 index 000000000000..8a16c35bc073 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/rackSkusListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of rack SKUs in the provided subscription. + * + * @summary Get a list of rack SKUs in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_ListBySubscription.json + */ +async function listRackSkUsForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.rackSkus.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listRackSkUsForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/racksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/racksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7f61d2fbd0dd --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/racksCreateOrUpdateSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Rack, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Create.json + */ +async function createOrUpdateRack() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const rackParameters: Rack = { + availabilityZone: "1", + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + rackLocation: "Rack 28", + rackSerialNumber: "RACK_SERIAL_NUMBER", + rackSkuId: "RACK-TYPE-1", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.beginCreateOrUpdateAndWait( + resourceGroupName, + rackName, + rackParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/racksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/racksDeleteSample.ts new file mode 100644 index 000000000000..4fa8970cdc7d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/racksDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided rack. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @summary Delete the provided rack. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Delete.json + */ +async function deleteRack() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.beginDeleteAndWait( + resourceGroupName, + rackName + ); + console.log(result); +} + +async function main() { + deleteRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/racksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/racksGetSample.ts new file mode 100644 index 000000000000..a99825f3146d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/racksGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided rack. + * + * @summary Get properties of the provided rack. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Get.json + */ +async function getRack() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.get(resourceGroupName, rackName); + console.log(result); +} + +async function main() { + getRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/racksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/racksListByResourceGroupSample.ts new file mode 100644 index 000000000000..8356f212ce21 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/racksListByResourceGroupSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of racks in the provided resource group. + * + * @summary Get a list of racks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListByResourceGroup.json + */ +async function listRacksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.racks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listRacksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/racksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/racksListBySubscriptionSample.ts new file mode 100644 index 000000000000..d55a5cda9dc9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/racksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of racks in the provided subscription. + * + * @summary Get a list of racks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListBySubscription.json + */ +async function listRacksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.racks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listRacksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/racksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/racksUpdateSample.ts new file mode 100644 index 000000000000..ad4b90978e9a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/racksUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RackPatchParameters, + RacksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently. + * + * @summary Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Patch.json + */ +async function patchRack() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const rackUpdateParameters: RackPatchParameters = { + rackLocation: "Rack 2B", + rackSerialNumber: "RACK_SERIAL_NUMBER", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: RacksUpdateOptionalParams = { rackUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.beginUpdateAndWait( + resourceGroupName, + rackName, + options + ); + console.log(result); +} + +async function main() { + patchRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..71d9b1b7e132 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesCreateOrUpdateSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { StorageAppliance, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Create.json + */ +async function createOrUpdateStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceParameters: StorageAppliance = { + administratorCredentials: { password: "{password}", username: "adminUser" }, + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + rackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName", + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceSkuId: "684E-3B16-399E", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginCreateOrUpdateAndWait( + resourceGroupName, + storageApplianceName, + storageApplianceParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesDeleteSample.ts new file mode 100644 index 000000000000..03f31a889cf8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided storage appliance. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @summary Delete the provided storage appliance. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Delete.json + */ +async function deleteStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginDeleteAndWait( + resourceGroupName, + storageApplianceName + ); + console.log(result); +} + +async function main() { + deleteStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesDisableRemoteVendorManagementSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesDisableRemoteVendorManagementSample.ts new file mode 100644 index 000000000000..7c75be1eabd6 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesDisableRemoteVendorManagementSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Disable remote vendor management of the provided storage appliance. + * + * @summary Disable remote vendor management of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_DisableRemoteVendorManagement.json + */ +async function turnOffRemoteVendorManagementForStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginDisableRemoteVendorManagementAndWait( + resourceGroupName, + storageApplianceName + ); + console.log(result); +} + +async function main() { + turnOffRemoteVendorManagementForStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesEnableRemoteVendorManagementSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesEnableRemoteVendorManagementSample.ts new file mode 100644 index 000000000000..7d6502a4eb4c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesEnableRemoteVendorManagementSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageApplianceEnableRemoteVendorManagementParameters, + StorageAppliancesEnableRemoteVendorManagementOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Enable remote vendor management of the provided storage appliance. + * + * @summary Enable remote vendor management of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_EnableRemoteVendorManagement.json + */ +async function turnOnRemoteVendorManagementForStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceEnableRemoteVendorManagementParameters: StorageApplianceEnableRemoteVendorManagementParameters = { + supportEndpoints: ["10.0.0.0/24"] + }; + const options: StorageAppliancesEnableRemoteVendorManagementOptionalParams = { + storageApplianceEnableRemoteVendorManagementParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginEnableRemoteVendorManagementAndWait( + resourceGroupName, + storageApplianceName, + options + ); + console.log(result); +} + +async function main() { + turnOnRemoteVendorManagementForStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesGetSample.ts new file mode 100644 index 000000000000..211fd65deef5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided storage appliance. + * + * @summary Get properties of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Get.json + */ +async function getStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.get( + resourceGroupName, + storageApplianceName + ); + console.log(result); +} + +async function main() { + getStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesListByResourceGroupSample.ts new file mode 100644 index 000000000000..98e90b049759 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of storage appliances in the provided resource group. + * + * @summary Get a list of storage appliances in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListByResourceGroup.json + */ +async function listStorageAppliancesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAppliances.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listStorageAppliancesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesListBySubscriptionSample.ts new file mode 100644 index 000000000000..e8d47f90dec4 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of storage appliances in the provided subscription. + * + * @summary Get a list of storage appliances in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListBySubscription.json + */ +async function listStorageAppliancesForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAppliances.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listStorageAppliancesForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesRunReadCommandsSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesRunReadCommandsSample.ts new file mode 100644 index 000000000000..cdce95fe1b07 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesRunReadCommandsSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageApplianceRunReadCommandsParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Run and retrieve output from read only commands on the provided storage appliance. + * + * @summary Run and retrieve output from read only commands on the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_RunReadCommands.json + */ +async function runAndRetrieveOutputFromReadOnlyCommandsOnStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceRunReadCommandsParameters: StorageApplianceRunReadCommandsParameters = { + limitTimeSeconds: 60, + commands: [{ command: "AlertList" }] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginRunReadCommandsAndWait( + resourceGroupName, + storageApplianceName, + storageApplianceRunReadCommandsParameters + ); + console.log(result); +} + +async function main() { + runAndRetrieveOutputFromReadOnlyCommandsOnStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesUpdateSample.ts new file mode 100644 index 000000000000..0d8591fc7da0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesUpdateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageAppliancePatchParameters, + StorageAppliancesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Patch.json + */ +async function patchStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceUpdateParameters: StorageAppliancePatchParameters = { + serialNumber: "BM1219XXX", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: StorageAppliancesUpdateOptionalParams = { + storageApplianceUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginUpdateAndWait( + resourceGroupName, + storageApplianceName, + options + ); + console.log(result); +} + +async function main() { + patchStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesValidateHardwareSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesValidateHardwareSample.ts new file mode 100644 index 000000000000..62dc4119a5df --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/storageAppliancesValidateHardwareSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageApplianceValidateHardwareParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validate the hardware of the provided storage appliance. + * + * @summary Validate the hardware of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ValidateHardware.json + */ +async function validateTheStorageApplianceHardware() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceValidateHardwareParameters: StorageApplianceValidateHardwareParameters = { + validationCategory: "BasicValidation" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginValidateHardwareAndWait( + resourceGroupName, + storageApplianceName, + storageApplianceValidateHardwareParameters + ); + console.log(result); +} + +async function main() { + validateTheStorageApplianceHardware(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..428150f74d1e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksCreateOrUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { TrunkedNetwork, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new trunked network or update the properties of the existing trunked network. + * + * @summary Create a new trunked network or update the properties of the existing trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Create.json + */ +async function createOrUpdateTrunkedNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const trunkedNetworkParameters: TrunkedNetwork = { + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + hybridAksPluginType: "DPDK", + interfaceName: "eth0", + isolationDomainIds: [ + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName" + ], + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + vlans: [12, 14] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.beginCreateOrUpdateAndWait( + resourceGroupName, + trunkedNetworkName, + trunkedNetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksDeleteSample.ts new file mode 100644 index 000000000000..81b93471dddc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided trunked network. + * + * @summary Delete the provided trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Delete.json + */ +async function deleteTrunkedNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.beginDeleteAndWait( + resourceGroupName, + trunkedNetworkName + ); + console.log(result); +} + +async function main() { + deleteTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksGetSample.ts new file mode 100644 index 000000000000..e4fd1bb18d0a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided trunked network. + * + * @summary Get properties of the provided trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Get.json + */ +async function getTrunkedNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.get( + resourceGroupName, + trunkedNetworkName + ); + console.log(result); +} + +async function main() { + getTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..2a9f62e3f9e7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of trunked networks in the provided resource group. + * + * @summary Get a list of trunked networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListByResourceGroup.json + */ +async function listTrunkedNetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.trunkedNetworks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listTrunkedNetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..c160313b62c2 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of trunked networks in the provided subscription. + * + * @summary Get a list of trunked networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListBySubscription.json + */ +async function listTrunkedNetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.trunkedNetworks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listTrunkedNetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksUpdateSample.ts new file mode 100644 index 000000000000..0bfeba084f82 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/trunkedNetworksUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TrunkedNetworkPatchParameters, + TrunkedNetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided trunked network. + * + * @summary Update tags associated with the provided trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Patch.json + */ +async function patchTrunkedNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const trunkedNetworkUpdateParameters: TrunkedNetworkPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: TrunkedNetworksUpdateOptionalParams = { + trunkedNetworkUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.update( + resourceGroupName, + trunkedNetworkName, + options + ); + console.log(result); +} + +async function main() { + patchTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesAttachVolumeSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesAttachVolumeSample.ts new file mode 100644 index 000000000000..5a2f0de88211 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesAttachVolumeSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineVolumeParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Attach volume to the provided virtual machine. + * + * @summary Attach volume to the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_AttachVolume.json + */ +async function attachVolumeToVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineAttachVolumeParameters: VirtualMachineVolumeParameters = { + volumeId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginAttachVolumeAndWait( + resourceGroupName, + virtualMachineName, + virtualMachineAttachVolumeParameters + ); + console.log(result); +} + +async function main() { + attachVolumeToVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4c3a0e711102 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesCreateOrUpdateSample.ts @@ -0,0 +1,106 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VirtualMachine, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new virtual machine or update the properties of the existing virtual machine. + * + * @summary Create a new virtual machine or update the properties of the existing virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Create.json + */ +async function createOrUpdateVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineParameters: VirtualMachine = { + adminUsername: "username", + bootMethod: "UEFI", + cloudServicesNetworkAttachment: { + attachedNetworkId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName", + ipAllocationMethod: "Dynamic" + }, + cpuCores: 2, + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + memorySizeGB: 8, + networkAttachments: [ + { + attachedNetworkId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName", + defaultGateway: "True", + ipAllocationMethod: "Dynamic", + ipv4Address: "198.51.100.1", + ipv6Address: "2001:0db8:0000:0000:0000:0000:0000:0000", + networkAttachmentName: "netAttachName01" + } + ], + networkData: "bmV0d29ya0RhdGVTYW1wbGU=", + placementHints: [ + { + hintType: "Affinity", + resourceId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName", + schedulingExecution: "Hard", + scope: "" + } + ], + sshPublicKeys: [ + { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + ], + storageProfile: { + osDisk: { + createOption: "Ephemeral", + deleteOption: "Delete", + diskSizeGB: 120 + }, + volumeAttachments: [ + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName" + ] + }, + tags: { key1: "myvalue1", key2: "myvalue2" }, + userData: "dXNlckRhdGVTYW1wbGU=", + vmDeviceModel: "T2", + vmImage: "myacr.azurecr.io/foobar:latest", + vmImageRepositoryCredentials: { + password: "{password}", + registryUrl: "myacr.azurecr.io", + username: "myuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + virtualMachineName, + virtualMachineParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesDeleteSample.ts new file mode 100644 index 000000000000..1fee1584a2f4 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided virtual machine. + * + * @summary Delete the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Delete.json + */ +async function deleteVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginDeleteAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + deleteVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesDetachVolumeSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesDetachVolumeSample.ts new file mode 100644 index 000000000000..ec9aa0c71bbd --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesDetachVolumeSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineVolumeParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Detach volume from the provided virtual machine. + * + * @summary Detach volume from the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_DetachVolume.json + */ +async function detachVolumeFromVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineDetachVolumeParameters: VirtualMachineVolumeParameters = { + volumeId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginDetachVolumeAndWait( + resourceGroupName, + virtualMachineName, + virtualMachineDetachVolumeParameters + ); + console.log(result); +} + +async function main() { + detachVolumeFromVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesGetSample.ts new file mode 100644 index 000000000000..03bb08fecb05 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided virtual machine. + * + * @summary Get properties of the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Get.json + */ +async function getVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.get( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + getVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesListByResourceGroupSample.ts new file mode 100644 index 000000000000..d9106c5bf6fa --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of virtual machines in the provided resource group. + * + * @summary Get a list of virtual machines in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListByResourceGroup.json + */ +async function listVirtualMachinesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVirtualMachinesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesListBySubscriptionSample.ts new file mode 100644 index 000000000000..167c1858a550 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of virtual machines in the provided subscription. + * + * @summary Get a list of virtual machines in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListBySubscription.json + */ +async function listVirtualMachinesForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVirtualMachinesForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesPowerOffSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesPowerOffSample.ts new file mode 100644 index 000000000000..a9e8eac857a8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesPowerOffSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachinePowerOffParameters, + VirtualMachinesPowerOffOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Power off the provided virtual machine. + * + * @summary Power off the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_PowerOff.json + */ +async function powerOffVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachinePowerOffParameters: VirtualMachinePowerOffParameters = { + skipShutdown: "True" + }; + const options: VirtualMachinesPowerOffOptionalParams = { + virtualMachinePowerOffParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginPowerOffAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +async function main() { + powerOffVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesReimageSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesReimageSample.ts new file mode 100644 index 000000000000..36d10e47c01c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesReimageSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Reimage the provided virtual machine. + * + * @summary Reimage the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Reimage.json + */ +async function reimageVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginReimageAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + reimageVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesRestartSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesRestartSample.ts new file mode 100644 index 000000000000..73b006e7b6c9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesRestartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restart the provided virtual machine. + * + * @summary Restart the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Restart.json + */ +async function restartVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + restartVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesStartSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesStartSample.ts new file mode 100644 index 000000000000..ded904978d26 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesStartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Start the provided virtual machine. + * + * @summary Start the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Start.json + */ +async function startVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + startVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesUpdateSample.ts new file mode 100644 index 000000000000..3d62e929d404 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/virtualMachinesUpdateSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachinePatchParameters, + VirtualMachinesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Patch.json + */ +async function patchVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineUpdateParameters: VirtualMachinePatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + vmImageRepositoryCredentials: { + password: "{password}", + registryUrl: "myacr.azurecr.io", + username: "myuser" + } + }; + const options: VirtualMachinesUpdateOptionalParams = { + virtualMachineUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +async function main() { + patchVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/volumesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..587708e7ed9b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesCreateOrUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Volume, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new volume or update the properties of the existing one. + * + * @summary Create a new volume or update the properties of the existing one. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Create.json + */ +async function createOrUpdateVolume() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const volumeParameters: Volume = { + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + sizeMiB: 10000, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.beginCreateOrUpdateAndWait( + resourceGroupName, + volumeName, + volumeParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/volumesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesDeleteSample.ts new file mode 100644 index 000000000000..4fbfe199dc86 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided volume. + * + * @summary Delete the provided volume. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Delete.json + */ +async function deleteVolume() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + volumeName + ); + console.log(result); +} + +async function main() { + deleteVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/volumesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesGetSample.ts new file mode 100644 index 000000000000..56e8eff0c6bf --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided volume. + * + * @summary Get properties of the provided volume. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Get.json + */ +async function getVolume() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.get(resourceGroupName, volumeName); + console.log(result); +} + +async function main() { + getVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/volumesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesListByResourceGroupSample.ts new file mode 100644 index 000000000000..15b04dab2d33 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of volumes in the provided resource group. + * + * @summary Get a list of volumes in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListByResourceGroup.json + */ +async function listVolumesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVolumesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/volumesListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesListBySubscriptionSample.ts new file mode 100644 index 000000000000..1e85a8afa4e4 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of volumes in the provided subscription. + * + * @summary Get a list of volumes in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListBySubscription.json + */ +async function listVolumeForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVolumeForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples-dev/volumesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesUpdateSample.ts new file mode 100644 index 000000000000..5794b0ce9a29 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples-dev/volumesUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VolumePatchParameters, + VolumesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided volume. + * + * @summary Update tags associated with the provided volume. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Patch.json + */ +async function patchVolume() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const volumeUpdateParameters: VolumePatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: VolumesUpdateOptionalParams = { volumeUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.update( + resourceGroupName, + volumeName, + options + ); + console.log(result); +} + +async function main() { + patchVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/README.md b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/README.md new file mode 100644 index 000000000000..35bd1e191bb0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/README.md @@ -0,0 +1,298 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [bareMetalMachineKeySetsCreateOrUpdateSample.js][baremetalmachinekeysetscreateorupdatesample] | Create a new bare metal machine key set or update the existing one for the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Create.json | +| [bareMetalMachineKeySetsDeleteSample.js][baremetalmachinekeysetsdeletesample] | Delete the bare metal machine key set of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Delete.json | +| [bareMetalMachineKeySetsGetSample.js][baremetalmachinekeysetsgetsample] | Get bare metal machine key set of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Get.json | +| [bareMetalMachineKeySetsListByResourceGroupSample.js][baremetalmachinekeysetslistbyresourcegroupsample] | Get a list of bare metal machine key sets of the cluster in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_ListByResourceGroup.json | +| [bareMetalMachineKeySetsUpdateSample.js][baremetalmachinekeysetsupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Patch.json | +| [bareMetalMachinesCordonSample.js][baremetalmachinescordonsample] | Cordon the provided bare metal machine's Kubernetes node. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Cordon.json | +| [bareMetalMachinesCreateOrUpdateSample.js][baremetalmachinescreateorupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Create.json | +| [bareMetalMachinesDeleteSample.js][baremetalmachinesdeletesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Delete.json | +| [bareMetalMachinesGetSample.js][baremetalmachinesgetsample] | Get properties of the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Get.json | +| [bareMetalMachinesListByResourceGroupSample.js][baremetalmachineslistbyresourcegroupsample] | Get a list of bare metal machines in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListByResourceGroup.json | +| [bareMetalMachinesListBySubscriptionSample.js][baremetalmachineslistbysubscriptionsample] | Get a list of bare metal machines in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListBySubscription.json | +| [bareMetalMachinesPowerOffSample.js][baremetalmachinespoweroffsample] | Power off the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_PowerOff.json | +| [bareMetalMachinesReimageSample.js][baremetalmachinesreimagesample] | Reimage the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Reimage.json | +| [bareMetalMachinesReplaceSample.js][baremetalmachinesreplacesample] | Replace the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Replace.json | +| [bareMetalMachinesRestartSample.js][baremetalmachinesrestartsample] | Restart the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Restart.json | +| [bareMetalMachinesRunCommandSample.js][baremetalmachinesruncommandsample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunCommand.json | +| [bareMetalMachinesRunDataExtractsSample.js][baremetalmachinesrundataextractssample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunDataExtracts.json | +| [bareMetalMachinesRunReadCommandsSample.js][baremetalmachinesrunreadcommandssample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunReadCommands.json | +| [bareMetalMachinesStartSample.js][baremetalmachinesstartsample] | Start the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Start.json | +| [bareMetalMachinesUncordonSample.js][baremetalmachinesuncordonsample] | Uncordon the provided bare metal machine's Kubernetes node. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Uncordon.json | +| [bareMetalMachinesUpdateSample.js][baremetalmachinesupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Patch.json | +| [bareMetalMachinesValidateHardwareSample.js][baremetalmachinesvalidatehardwaresample] | Validate the hardware of the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ValidateHardware.json | +| [bmcKeySetsCreateOrUpdateSample.js][bmckeysetscreateorupdatesample] | Create a new baseboard management controller key set or update the existing one for the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Create.json | +| [bmcKeySetsDeleteSample.js][bmckeysetsdeletesample] | Delete the baseboard management controller key set of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Delete.json | +| [bmcKeySetsGetSample.js][bmckeysetsgetsample] | Get baseboard management controller key set of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Get.json | +| [bmcKeySetsListByResourceGroupSample.js][bmckeysetslistbyresourcegroupsample] | Get a list of baseboard management controller key sets of the cluster in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_ListByResourceGroup.json | +| [bmcKeySetsUpdateSample.js][bmckeysetsupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Patch.json | +| [cloudServicesNetworksCreateOrUpdateSample.js][cloudservicesnetworkscreateorupdatesample] | Create a new cloud services network or update the properties of the existing cloud services network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Create.json | +| [cloudServicesNetworksDeleteSample.js][cloudservicesnetworksdeletesample] | Delete the provided cloud services network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Delete.json | +| [cloudServicesNetworksGetSample.js][cloudservicesnetworksgetsample] | Get properties of the provided cloud services network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Get.json | +| [cloudServicesNetworksListByResourceGroupSample.js][cloudservicesnetworkslistbyresourcegroupsample] | Get a list of cloud services networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListByResourceGroup.json | +| [cloudServicesNetworksListBySubscriptionSample.js][cloudservicesnetworkslistbysubscriptionsample] | Get a list of cloud services networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListBySubscription.json | +| [cloudServicesNetworksUpdateSample.js][cloudservicesnetworksupdatesample] | Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Patch.json | +| [clusterManagersCreateOrUpdateSample.js][clustermanagerscreateorupdatesample] | Create a new cluster manager or update properties of the cluster manager if it exists. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Create.json | +| [clusterManagersDeleteSample.js][clustermanagersdeletesample] | Delete the provided cluster manager. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Delete.json | +| [clusterManagersGetSample.js][clustermanagersgetsample] | Get the properties of the provided cluster manager. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Get.json | +| [clusterManagersListByResourceGroupSample.js][clustermanagerslistbyresourcegroupsample] | Get a list of cluster managers in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListByResourceGroup.json | +| [clusterManagersListBySubscriptionSample.js][clustermanagerslistbysubscriptionsample] | Get a list of cluster managers in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListBySubscription.json | +| [clusterManagersUpdateSample.js][clustermanagersupdatesample] | Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Patch.json | +| [clustersCreateOrUpdateSample.js][clusterscreateorupdatesample] | Create a new cluster or update the properties of the cluster if it exists. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Create.json | +| [clustersDeleteSample.js][clustersdeletesample] | Delete the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Delete.json | +| [clustersDeploySample.js][clustersdeploysample] | Deploy the cluster to the provided rack. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy.json | +| [clustersGetSample.js][clustersgetsample] | Get properties of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Get.json | +| [clustersListByResourceGroupSample.js][clusterslistbyresourcegroupsample] | Get a list of clusters in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListByResourceGroup.json | +| [clustersListBySubscriptionSample.js][clusterslistbysubscriptionsample] | Get a list of clusters in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListBySubscription.json | +| [clustersUpdateSample.js][clustersupdatesample] | Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json | +| [clustersUpdateVersionSample.js][clustersupdateversionsample] | Update the version of the provided cluster to one of the available supported versions. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_UpdateVersion.json | +| [consolesCreateOrUpdateSample.js][consolescreateorupdatesample] | Create a new virtual machine console or update the properties of the existing virtual machine console. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Create.json | +| [consolesDeleteSample.js][consolesdeletesample] | Delete the provided virtual machine console. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Delete.json | +| [consolesGetSample.js][consolesgetsample] | Get properties of the provided virtual machine console. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Get.json | +| [consolesListByResourceGroupSample.js][consoleslistbyresourcegroupsample] | Get a list of virtual machine consoles in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_ListByResourceGroup.json | +| [consolesUpdateSample.js][consolesupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Patch.json | +| [defaultCniNetworksCreateOrUpdateSample.js][defaultcninetworkscreateorupdatesample] | Create a new default CNI network or update the properties of the existing default CNI network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Create.json | +| [defaultCniNetworksDeleteSample.js][defaultcninetworksdeletesample] | Delete the provided default CNI network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Delete.json | +| [defaultCniNetworksGetSample.js][defaultcninetworksgetsample] | Get properties of the provided default CNI network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Get.json | +| [defaultCniNetworksListByResourceGroupSample.js][defaultcninetworkslistbyresourcegroupsample] | Get a list of default CNI networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListByResourceGroup.json | +| [defaultCniNetworksListBySubscriptionSample.js][defaultcninetworkslistbysubscriptionsample] | Get a list of default CNI networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListBySubscription.json | +| [defaultCniNetworksUpdateSample.js][defaultcninetworksupdatesample] | Update tags associated with the provided default CNI network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Patch.json | +| [hybridAksClustersCreateOrUpdateSample.js][hybridaksclusterscreateorupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Create.json | +| [hybridAksClustersDeleteSample.js][hybridaksclustersdeletesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Delete.json | +| [hybridAksClustersGetSample.js][hybridaksclustersgetsample] | Get the additional details related to the provided Hybrid AKS provisioned cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Get.json | +| [hybridAksClustersListByResourceGroupSample.js][hybridaksclusterslistbyresourcegroupsample] | Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListByResourceGroup.json | +| [hybridAksClustersListBySubscriptionSample.js][hybridaksclusterslistbysubscriptionsample] | Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListBySubscription.json | +| [hybridAksClustersRestartNodeSample.js][hybridaksclustersrestartnodesample] | Restart a targeted node of a Hybrid AKS cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_RestartNode.json | +| [hybridAksClustersUpdateSample.js][hybridaksclustersupdatesample] | Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Patch.json | +| [l2NetworksCreateOrUpdateSample.js][l2networkscreateorupdatesample] | Create a new layer 2 (L2) network or update the properties of the existing network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Create.json | +| [l2NetworksDeleteSample.js][l2networksdeletesample] | Delete the provided layer 2 (L2) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Delete.json | +| [l2NetworksGetSample.js][l2networksgetsample] | Get properties of the provided layer 2 (L2) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Get.json | +| [l2NetworksListByResourceGroupSample.js][l2networkslistbyresourcegroupsample] | Get a list of layer 2 (L2) networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListByResourceGroup.json | +| [l2NetworksListBySubscriptionSample.js][l2networkslistbysubscriptionsample] | Get a list of layer 2 (L2) networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListBySubscription.json | +| [l2NetworksUpdateSample.js][l2networksupdatesample] | Update tags associated with the provided layer 2 (L2) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Patch.json | +| [l3NetworksCreateOrUpdateSample.js][l3networkscreateorupdatesample] | Create a new layer 3 (L3) network or update the properties of the existing network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Create.json | +| [l3NetworksDeleteSample.js][l3networksdeletesample] | Delete the provided layer 3 (L3) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Delete.json | +| [l3NetworksGetSample.js][l3networksgetsample] | Get properties of the provided layer 3 (L3) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Get.json | +| [l3NetworksListByResourceGroupSample.js][l3networkslistbyresourcegroupsample] | Get a list of layer 3 (L3) networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListByResourceGroup.json | +| [l3NetworksListBySubscriptionSample.js][l3networkslistbysubscriptionsample] | Get a list of layer 3 (L3) networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListBySubscription.json | +| [l3NetworksUpdateSample.js][l3networksupdatesample] | Update tags associated with the provided layer 3 (L3) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Patch.json | +| [metricsConfigurationsCreateOrUpdateSample.js][metricsconfigurationscreateorupdatesample] | Update the metrics configuration of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Update.json | +| [metricsConfigurationsDeleteSample.js][metricsconfigurationsdeletesample] | Delete the metrics configuration of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Delete.json | +| [metricsConfigurationsGetSample.js][metricsconfigurationsgetsample] | Get metrics configuration of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Get.json | +| [metricsConfigurationsListByResourceGroupSample.js][metricsconfigurationslistbyresourcegroupsample] | Get a list of metrics configurations of the clusters in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_ListByResourceGroup.json | +| [metricsConfigurationsUpdateSample.js][metricsconfigurationsupdatesample] | Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Patch.json | +| [operationsListSample.js][operationslistsample] | Get a list of all available resource provider operations. It contains a URL link to get the next set of results. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Operations_List.json | +| [rackSkusGetSample.js][rackskusgetsample] | Get the properties of the provided rack SKU. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_Get.json | +| [rackSkusListBySubscriptionSample.js][rackskuslistbysubscriptionsample] | Get a list of rack SKUs in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_ListBySubscription.json | +| [racksCreateOrUpdateSample.js][rackscreateorupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Create.json | +| [racksDeleteSample.js][racksdeletesample] | Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Delete.json | +| [racksGetSample.js][racksgetsample] | Get properties of the provided rack. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Get.json | +| [racksListByResourceGroupSample.js][rackslistbyresourcegroupsample] | Get a list of racks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListByResourceGroup.json | +| [racksListBySubscriptionSample.js][rackslistbysubscriptionsample] | Get a list of racks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListBySubscription.json | +| [racksUpdateSample.js][racksupdatesample] | Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Patch.json | +| [storageAppliancesCreateOrUpdateSample.js][storageappliancescreateorupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Create.json | +| [storageAppliancesDeleteSample.js][storageappliancesdeletesample] | Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Delete.json | +| [storageAppliancesDisableRemoteVendorManagementSample.js][storageappliancesdisableremotevendormanagementsample] | Disable remote vendor management of the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_DisableRemoteVendorManagement.json | +| [storageAppliancesEnableRemoteVendorManagementSample.js][storageappliancesenableremotevendormanagementsample] | Enable remote vendor management of the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_EnableRemoteVendorManagement.json | +| [storageAppliancesGetSample.js][storageappliancesgetsample] | Get properties of the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Get.json | +| [storageAppliancesListByResourceGroupSample.js][storageapplianceslistbyresourcegroupsample] | Get a list of storage appliances in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListByResourceGroup.json | +| [storageAppliancesListBySubscriptionSample.js][storageapplianceslistbysubscriptionsample] | Get a list of storage appliances in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListBySubscription.json | +| [storageAppliancesRunReadCommandsSample.js][storageappliancesrunreadcommandssample] | Run and retrieve output from read only commands on the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_RunReadCommands.json | +| [storageAppliancesUpdateSample.js][storageappliancesupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Patch.json | +| [storageAppliancesValidateHardwareSample.js][storageappliancesvalidatehardwaresample] | Validate the hardware of the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ValidateHardware.json | +| [trunkedNetworksCreateOrUpdateSample.js][trunkednetworkscreateorupdatesample] | Create a new trunked network or update the properties of the existing trunked network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Create.json | +| [trunkedNetworksDeleteSample.js][trunkednetworksdeletesample] | Delete the provided trunked network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Delete.json | +| [trunkedNetworksGetSample.js][trunkednetworksgetsample] | Get properties of the provided trunked network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Get.json | +| [trunkedNetworksListByResourceGroupSample.js][trunkednetworkslistbyresourcegroupsample] | Get a list of trunked networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListByResourceGroup.json | +| [trunkedNetworksListBySubscriptionSample.js][trunkednetworkslistbysubscriptionsample] | Get a list of trunked networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListBySubscription.json | +| [trunkedNetworksUpdateSample.js][trunkednetworksupdatesample] | Update tags associated with the provided trunked network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Patch.json | +| [virtualMachinesAttachVolumeSample.js][virtualmachinesattachvolumesample] | Attach volume to the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_AttachVolume.json | +| [virtualMachinesCreateOrUpdateSample.js][virtualmachinescreateorupdatesample] | Create a new virtual machine or update the properties of the existing virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Create.json | +| [virtualMachinesDeleteSample.js][virtualmachinesdeletesample] | Delete the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Delete.json | +| [virtualMachinesDetachVolumeSample.js][virtualmachinesdetachvolumesample] | Detach volume from the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_DetachVolume.json | +| [virtualMachinesGetSample.js][virtualmachinesgetsample] | Get properties of the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Get.json | +| [virtualMachinesListByResourceGroupSample.js][virtualmachineslistbyresourcegroupsample] | Get a list of virtual machines in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListByResourceGroup.json | +| [virtualMachinesListBySubscriptionSample.js][virtualmachineslistbysubscriptionsample] | Get a list of virtual machines in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListBySubscription.json | +| [virtualMachinesPowerOffSample.js][virtualmachinespoweroffsample] | Power off the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_PowerOff.json | +| [virtualMachinesReimageSample.js][virtualmachinesreimagesample] | Reimage the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Reimage.json | +| [virtualMachinesRestartSample.js][virtualmachinesrestartsample] | Restart the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Restart.json | +| [virtualMachinesStartSample.js][virtualmachinesstartsample] | Start the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Start.json | +| [virtualMachinesUpdateSample.js][virtualmachinesupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Patch.json | +| [volumesCreateOrUpdateSample.js][volumescreateorupdatesample] | Create a new volume or update the properties of the existing one. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Create.json | +| [volumesDeleteSample.js][volumesdeletesample] | Delete the provided volume. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Delete.json | +| [volumesGetSample.js][volumesgetsample] | Get properties of the provided volume. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Get.json | +| [volumesListByResourceGroupSample.js][volumeslistbyresourcegroupsample] | Get a list of volumes in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListByResourceGroup.json | +| [volumesListBySubscriptionSample.js][volumeslistbysubscriptionsample] | Get a list of volumes in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListBySubscription.json | +| [volumesUpdateSample.js][volumesupdatesample] | Update tags associated with the provided volume. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Patch.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node bareMetalMachineKeySetsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env NETWORKCLOUD_SUBSCRIPTION_ID="" NETWORKCLOUD_RESOURCE_GROUP="" node bareMetalMachineKeySetsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[baremetalmachinekeysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsCreateOrUpdateSample.js +[baremetalmachinekeysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsDeleteSample.js +[baremetalmachinekeysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsGetSample.js +[baremetalmachinekeysetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsListByResourceGroupSample.js +[baremetalmachinekeysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsUpdateSample.js +[baremetalmachinescordonsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCordonSample.js +[baremetalmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCreateOrUpdateSample.js +[baremetalmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesDeleteSample.js +[baremetalmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesGetSample.js +[baremetalmachineslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListByResourceGroupSample.js +[baremetalmachineslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListBySubscriptionSample.js +[baremetalmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesPowerOffSample.js +[baremetalmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReimageSample.js +[baremetalmachinesreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReplaceSample.js +[baremetalmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRestartSample.js +[baremetalmachinesruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunCommandSample.js +[baremetalmachinesrundataextractssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunDataExtractsSample.js +[baremetalmachinesrunreadcommandssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunReadCommandsSample.js +[baremetalmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesStartSample.js +[baremetalmachinesuncordonsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUncordonSample.js +[baremetalmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUpdateSample.js +[baremetalmachinesvalidatehardwaresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesValidateHardwareSample.js +[bmckeysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsCreateOrUpdateSample.js +[bmckeysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsDeleteSample.js +[bmckeysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsGetSample.js +[bmckeysetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsListByResourceGroupSample.js +[bmckeysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsUpdateSample.js +[cloudservicesnetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksCreateOrUpdateSample.js +[cloudservicesnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksDeleteSample.js +[cloudservicesnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksGetSample.js +[cloudservicesnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListByResourceGroupSample.js +[cloudservicesnetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListBySubscriptionSample.js +[cloudservicesnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksUpdateSample.js +[clustermanagerscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersCreateOrUpdateSample.js +[clustermanagersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersDeleteSample.js +[clustermanagersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersGetSample.js +[clustermanagerslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListByResourceGroupSample.js +[clustermanagerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListBySubscriptionSample.js +[clustermanagersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersUpdateSample.js +[clusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersCreateOrUpdateSample.js +[clustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeleteSample.js +[clustersdeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeploySample.js +[clustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersGetSample.js +[clusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListByResourceGroupSample.js +[clusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListBySubscriptionSample.js +[clustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateSample.js +[clustersupdateversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateVersionSample.js +[consolescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesCreateOrUpdateSample.js +[consolesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesDeleteSample.js +[consolesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesGetSample.js +[consoleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesListByResourceGroupSample.js +[consolesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesUpdateSample.js +[defaultcninetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksCreateOrUpdateSample.js +[defaultcninetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksDeleteSample.js +[defaultcninetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksGetSample.js +[defaultcninetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListByResourceGroupSample.js +[defaultcninetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListBySubscriptionSample.js +[defaultcninetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksUpdateSample.js +[hybridaksclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersCreateOrUpdateSample.js +[hybridaksclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersDeleteSample.js +[hybridaksclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersGetSample.js +[hybridaksclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListByResourceGroupSample.js +[hybridaksclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListBySubscriptionSample.js +[hybridaksclustersrestartnodesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersRestartNodeSample.js +[hybridaksclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersUpdateSample.js +[l2networkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksCreateOrUpdateSample.js +[l2networksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksDeleteSample.js +[l2networksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksGetSample.js +[l2networkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListByResourceGroupSample.js +[l2networkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListBySubscriptionSample.js +[l2networksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksUpdateSample.js +[l3networkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksCreateOrUpdateSample.js +[l3networksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksDeleteSample.js +[l3networksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksGetSample.js +[l3networkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListByResourceGroupSample.js +[l3networkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListBySubscriptionSample.js +[l3networksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksUpdateSample.js +[metricsconfigurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsCreateOrUpdateSample.js +[metricsconfigurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsDeleteSample.js +[metricsconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsGetSample.js +[metricsconfigurationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsListByResourceGroupSample.js +[metricsconfigurationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsUpdateSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/operationsListSample.js +[rackskusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusGetSample.js +[rackskuslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusListBySubscriptionSample.js +[rackscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksCreateOrUpdateSample.js +[racksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksDeleteSample.js +[racksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksGetSample.js +[rackslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListByResourceGroupSample.js +[rackslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListBySubscriptionSample.js +[racksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksUpdateSample.js +[storageappliancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesCreateOrUpdateSample.js +[storageappliancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDeleteSample.js +[storageappliancesdisableremotevendormanagementsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDisableRemoteVendorManagementSample.js +[storageappliancesenableremotevendormanagementsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesEnableRemoteVendorManagementSample.js +[storageappliancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesGetSample.js +[storageapplianceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListByResourceGroupSample.js +[storageapplianceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListBySubscriptionSample.js +[storageappliancesrunreadcommandssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesRunReadCommandsSample.js +[storageappliancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesUpdateSample.js +[storageappliancesvalidatehardwaresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesValidateHardwareSample.js +[trunkednetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksCreateOrUpdateSample.js +[trunkednetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksDeleteSample.js +[trunkednetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksGetSample.js +[trunkednetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListByResourceGroupSample.js +[trunkednetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListBySubscriptionSample.js +[trunkednetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksUpdateSample.js +[virtualmachinesattachvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesAttachVolumeSample.js +[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesCreateOrUpdateSample.js +[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDeleteSample.js +[virtualmachinesdetachvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDetachVolumeSample.js +[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesGetSample.js +[virtualmachineslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js +[virtualmachineslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListBySubscriptionSample.js +[virtualmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesPowerOffSample.js +[virtualmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesReimageSample.js +[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesRestartSample.js +[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesStartSample.js +[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesUpdateSample.js +[volumescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesCreateOrUpdateSample.js +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesDeleteSample.js +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesGetSample.js +[volumeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListByResourceGroupSample.js +[volumeslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListBySubscriptionSample.js +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesUpdateSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-networkcloud?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/networkcloud/arm-networkcloud/README.md diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsCreateOrUpdateSample.js new file mode 100644 index 000000000000..682472639307 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsCreateOrUpdateSample.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @summary Create a new bare metal machine key set or update the existing one for the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Create.json + */ +async function createOrUpdateBareMetalMachineKeySetOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const bareMetalMachineKeySetParameters = { + azureGroupId: "f110271b-XXXX-4163-9b99-214d91660f0e", + expiration: new Date("2022-12-31T23:59:59.008Z"), + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + jumpHostsAllowed: ["192.0.2.1", "192.0.2.5"], + location: "location", + osGroupName: "standardAccessGroup", + privilegeLevel: "Standard", + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + }, + { + description: "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsDeleteSample.js new file mode 100644 index 000000000000..74a7568f0684 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsDeleteSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the bare metal machine key set of the provided cluster. + * + * @summary Delete the bare metal machine key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Delete.json + */ +async function deleteBareMetalMachineKeySetOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.beginDeleteAndWait( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName + ); + console.log(result); +} + +async function main() { + deleteBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsGetSample.js new file mode 100644 index 000000000000..c279251b50ab --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsGetSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get bare metal machine key set of the provided cluster. + * + * @summary Get bare metal machine key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Get.json + */ +async function getBareMetalMachineKeySetOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.get( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName + ); + console.log(result); +} + +async function main() { + getBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsListByResourceGroupSample.js new file mode 100644 index 000000000000..e85468ae326b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsListByResourceGroupSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @summary Get a list of bare metal machine key sets of the cluster in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_ListByResourceGroup.json + */ +async function listBareMetalMachineKeySetOfClusterForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bareMetalMachineKeySets.listByResourceGroup( + resourceGroupName, + clusterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBareMetalMachineKeySetOfClusterForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsUpdateSample.js new file mode 100644 index 000000000000..5922bd07ed6a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachineKeySetsUpdateSample.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Patch.json + */ +async function patchBareMetalMachineKeySetOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const bareMetalMachineKeySetUpdateParameters = { + expiration: new Date("2022-12-31T23:59:59.008Z"), + jumpHostsAllowed: ["192.0.2.1", "192.0.2.5"], + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + }, + { + description: "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + }, + ], + }; + const options = { + bareMetalMachineKeySetUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.beginUpdateAndWait( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + options + ); + console.log(result); +} + +async function main() { + patchBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCordonSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCordonSample.js new file mode 100644 index 000000000000..5ecbef491c85 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCordonSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Cordon the provided bare metal machine's Kubernetes node. + * + * @summary Cordon the provided bare metal machine's Kubernetes node. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Cordon.json + */ +async function cordonBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineCordonParameters = { + evacuate: "True", + }; + const options = { + bareMetalMachineCordonParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginCordonAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + cordonBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCreateOrUpdateSample.js new file mode 100644 index 000000000000..4c9f32cf2cf8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesCreateOrUpdateSample.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Create.json + */ +async function createOrUpdateBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineParameters = { + bmcConnectionString: "bmcconnectionstring", + bmcCredentials: { password: "{password}", username: "bmcuser" }, + bmcMacAddress: "00:00:4f:00:57:00", + bootMacAddress: "00:00:4e:00:58:af", + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + machineDetails: "User-provided machine details.", + machineName: "r01c001", + machineSkuId: "684E-3B16-399E", + rackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName", + rackSlot: 1, + serialNumber: "BM1219XXX", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesDeleteSample.js new file mode 100644 index 000000000000..859ac7d008b5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesDeleteSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Delete.json + */ +async function deleteBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginDeleteAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + deleteBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesGetSample.js new file mode 100644 index 000000000000..6b4ecc1287d0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided bare metal machine. + * + * @summary Get properties of the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Get.json + */ +async function getBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.get(resourceGroupName, bareMetalMachineName); + console.log(result); +} + +async function main() { + getBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListByResourceGroupSample.js new file mode 100644 index 000000000000..53854075eec4 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of bare metal machines in the provided resource group. + * + * @summary Get a list of bare metal machines in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListByResourceGroup.json + */ +async function listBareMetalMachinesForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bareMetalMachines.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBareMetalMachinesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListBySubscriptionSample.js new file mode 100644 index 000000000000..2b8b879b7f24 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of bare metal machines in the provided subscription. + * + * @summary Get a list of bare metal machines in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListBySubscription.json + */ +async function listBareMetalMachinesForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bareMetalMachines.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBareMetalMachinesForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesPowerOffSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesPowerOffSample.js new file mode 100644 index 000000000000..75f54b415f3d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesPowerOffSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Power off the provided bare metal machine. + * + * @summary Power off the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_PowerOff.json + */ +async function powerOffBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachinePowerOffParameters = { + skipShutdown: "True", + }; + const options = { + bareMetalMachinePowerOffParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginPowerOffAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + powerOffBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReimageSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReimageSample.js new file mode 100644 index 000000000000..bde63d7f603f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReimageSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Reimage the provided bare metal machine. + * + * @summary Reimage the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Reimage.json + */ +async function reimageBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginReimageAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + reimageBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReplaceSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReplaceSample.js new file mode 100644 index 000000000000..a8c0878e18fe --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesReplaceSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Replace the provided bare metal machine. + * + * @summary Replace the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Replace.json + */ +async function replaceBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineReplaceParameters = { + bmcCredentials: { password: "{password}", username: "bmcuser" }, + bmcMacAddress: "00:00:4f:00:57:ad", + bootMacAddress: "00:00:4e:00:58:af", + machineName: "name", + serialNumber: "BM1219XXX", + }; + const options = { + bareMetalMachineReplaceParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginReplaceAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + replaceBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRestartSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRestartSample.js new file mode 100644 index 000000000000..9f320e6b1f04 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRestartSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Restart the provided bare metal machine. + * + * @summary Restart the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Restart.json + */ +async function restartBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRestartAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + restartBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunCommandSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunCommandSample.js new file mode 100644 index 000000000000..964556e3a3b9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunCommandSample.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunCommand.json + */ +async function runCommandOnBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineRunCommandParameters = { + arguments: ["--argument1", "argument2"], + limitTimeSeconds: 60, + script: "cHdkCg==", + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRunCommandAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunCommandParameters + ); + console.log(result); +} + +async function main() { + runCommandOnBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunDataExtractsSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunDataExtractsSample.js new file mode 100644 index 000000000000..2459232d4c5a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunDataExtractsSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunDataExtracts.json + */ +async function runDataExtractionOnBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineRunDataExtractsParameters = { + limitTimeSeconds: 60, + commands: [{ command: "networkInfo" }], + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRunDataExtractsAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunDataExtractsParameters + ); + console.log(result); +} + +async function main() { + runDataExtractionOnBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunReadCommandsSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunReadCommandsSample.js new file mode 100644 index 000000000000..6c7863fcca8a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesRunReadCommandsSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunReadCommands.json + */ +async function runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineRunReadCommandsParameters = { + limitTimeSeconds: 60, + commands: [ + { arguments: ["pods", "-A"], command: "kubectl get" }, + { arguments: ["192.168.0.99", "-c", "3"], command: "ping" }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRunReadCommandsAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunReadCommandsParameters + ); + console.log(result); +} + +async function main() { + runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesStartSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesStartSample.js new file mode 100644 index 000000000000..ed53738a88fc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesStartSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Start the provided bare metal machine. + * + * @summary Start the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Start.json + */ +async function startBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginStartAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + startBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUncordonSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUncordonSample.js new file mode 100644 index 000000000000..dca5e9c9fdc8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUncordonSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Uncordon the provided bare metal machine's Kubernetes node. + * + * @summary Uncordon the provided bare metal machine's Kubernetes node. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Uncordon.json + */ +async function uncordonBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginUncordonAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + uncordonBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUpdateSample.js new file mode 100644 index 000000000000..637064a7e913 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesUpdateSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Patch.json + */ +async function patchBareMetalMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineUpdateParameters = { + machineDetails: "machinedetails", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { + bareMetalMachineUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginUpdateAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + patchBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesValidateHardwareSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesValidateHardwareSample.js new file mode 100644 index 000000000000..274e97472995 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bareMetalMachinesValidateHardwareSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Validate the hardware of the provided bare metal machine. + * + * @summary Validate the hardware of the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ValidateHardware.json + */ +async function validateTheBareMetalMachineHardware() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineValidateHardwareParameters = { + validationCategory: "BasicValidation", + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginValidateHardwareAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineValidateHardwareParameters + ); + console.log(result); +} + +async function main() { + validateTheBareMetalMachineHardware(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsCreateOrUpdateSample.js new file mode 100644 index 000000000000..5c0e4a39353a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsCreateOrUpdateSample.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @summary Create a new baseboard management controller key set or update the existing one for the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Create.json + */ +async function createOrUpdateBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const bmcKeySetParameters = { + azureGroupId: "f110271b-XXXX-4163-9b99-214d91660f0e", + expiration: new Date("2022-12-31T23:59:59.008Z"), + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + privilegeLevel: "Administrator", + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + }, + { + description: "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + bmcKeySetName, + bmcKeySetParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsDeleteSample.js new file mode 100644 index 000000000000..35506a7fd05a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsDeleteSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the baseboard management controller key set of the provided cluster. + * + * @summary Delete the baseboard management controller key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Delete.json + */ +async function deleteBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.beginDeleteAndWait( + resourceGroupName, + clusterName, + bmcKeySetName + ); + console.log(result); +} + +async function main() { + deleteBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsGetSample.js new file mode 100644 index 000000000000..5c9cc73214cd --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsGetSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get baseboard management controller key set of the provided cluster. + * + * @summary Get baseboard management controller key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Get.json + */ +async function getBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.get(resourceGroupName, clusterName, bmcKeySetName); + console.log(result); +} + +async function main() { + getBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsListByResourceGroupSample.js new file mode 100644 index 000000000000..32076ad68ada --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsListByResourceGroupSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @summary Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_ListByResourceGroup.json + */ +async function listBaseboardManagementControllerKeySetOfClusterForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bmcKeySets.listByResourceGroup(resourceGroupName, clusterName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBaseboardManagementControllerKeySetOfClusterForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsUpdateSample.js new file mode 100644 index 000000000000..df2fbf3bd2ff --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/bmcKeySetsUpdateSample.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Patch.json + */ +async function patchBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const bmcKeySetUpdateParameters = { + expiration: new Date("2022-12-31T23:59:59.008Z"), + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + }, + { + description: "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + }, + ], + }; + const options = { bmcKeySetUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.beginUpdateAndWait( + resourceGroupName, + clusterName, + bmcKeySetName, + options + ); + console.log(result); +} + +async function main() { + patchBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksCreateOrUpdateSample.js new file mode 100644 index 000000000000..a6f7a505d7b7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksCreateOrUpdateSample.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new cloud services network or update the properties of the existing cloud services network. + * + * @summary Create a new cloud services network or update the properties of the existing cloud services network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Create.json + */ +async function createOrUpdateCloudServicesNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const cloudServicesNetworkParameters = { + additionalEgressEndpoints: [ + { + category: "azure-resource-management", + endpoints: [ + { + domainName: "https://storageaccountex.blob.core.windows.net", + port: 443, + }, + ], + }, + ], + enableDefaultEgressEndpoints: "False", + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServicesNetworkName, + cloudServicesNetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksDeleteSample.js new file mode 100644 index 000000000000..1a81133bc775 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksDeleteSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided cloud services network. + * + * @summary Delete the provided cloud services network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Delete.json + */ +async function deleteCloudServicesNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.beginDeleteAndWait( + resourceGroupName, + cloudServicesNetworkName + ); + console.log(result); +} + +async function main() { + deleteCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksGetSample.js new file mode 100644 index 000000000000..28ad2a3e4c30 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksGetSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided cloud services network. + * + * @summary Get properties of the provided cloud services network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Get.json + */ +async function getCloudServicesNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.get( + resourceGroupName, + cloudServicesNetworkName + ); + console.log(result); +} + +async function main() { + getCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListByResourceGroupSample.js new file mode 100644 index 000000000000..23d709cfe0a7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of cloud services networks in the provided resource group. + * + * @summary Get a list of cloud services networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListByResourceGroup.json + */ +async function listCloudServicesNetworksForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServicesNetworks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listCloudServicesNetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListBySubscriptionSample.js new file mode 100644 index 000000000000..64f84721ae51 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of cloud services networks in the provided subscription. + * + * @summary Get a list of cloud services networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListBySubscription.json + */ +async function listCloudServicesNetworksForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServicesNetworks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listCloudServicesNetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksUpdateSample.js new file mode 100644 index 000000000000..864306e36877 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/cloudServicesNetworksUpdateSample.js @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently. + * + * @summary Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Patch.json + */ +async function patchCloudServicesNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const cloudServicesNetworkUpdateParameters = { + additionalEgressEndpoints: [ + { + category: "azure-resource-management", + endpoints: [ + { + domainName: "https://storageaccountex.blob.core.windows.net", + port: 443, + }, + ], + }, + ], + enableDefaultEgressEndpoints: "False", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { + cloudServicesNetworkUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.beginUpdateAndWait( + resourceGroupName, + cloudServicesNetworkName, + options + ); + console.log(result); +} + +async function main() { + patchCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersCreateOrUpdateSample.js new file mode 100644 index 000000000000..7f6544e1e11f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersCreateOrUpdateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @summary Create a new cluster manager or update properties of the cluster manager if it exists. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Create.json + */ +async function createOrUpdateClusterManager() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const clusterManagerParameters = { + analyticsWorkspaceId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName", + fabricControllerId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName", + location: "location", + managedResourceGroupConfiguration: { + name: "my-managed-rg", + location: "East US", + }, + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterManagerName, + clusterManagerParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersDeleteSample.js new file mode 100644 index 000000000000..f3badcab56fa --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersDeleteSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided cluster manager. + * + * @summary Delete the provided cluster manager. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Delete.json + */ +async function deleteClusterManager() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.beginDeleteAndWait( + resourceGroupName, + clusterManagerName + ); + console.log(result); +} + +async function main() { + deleteClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersGetSample.js new file mode 100644 index 000000000000..04a498323fc9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get the properties of the provided cluster manager. + * + * @summary Get the properties of the provided cluster manager. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Get.json + */ +async function getClusterManager() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.get(resourceGroupName, clusterManagerName); + console.log(result); +} + +async function main() { + getClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListByResourceGroupSample.js new file mode 100644 index 000000000000..c67a70a380bf --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of cluster managers in the provided resource group. + * + * @summary Get a list of cluster managers in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListByResourceGroup.json + */ +async function listClusterManagersForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusterManagers.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClusterManagersForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListBySubscriptionSample.js new file mode 100644 index 000000000000..6b9b1eaf2df5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of cluster managers in the provided subscription. + * + * @summary Get a list of cluster managers in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListBySubscription.json + */ +async function listClusterManagersForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusterManagers.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClusterManagersForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersUpdateSample.js new file mode 100644 index 000000000000..aa40358c1c30 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clusterManagersUpdateSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently. + * + * @summary Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Patch.json + */ +async function patchClusterManager() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const clusterManagerUpdateParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { + clusterManagerUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.update( + resourceGroupName, + clusterManagerName, + options + ); + console.log(result); +} + +async function main() { + patchClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersCreateOrUpdateSample.js new file mode 100644 index 000000000000..4c94f84c57bc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersCreateOrUpdateSample.js @@ -0,0 +1,143 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new cluster or update the properties of the cluster if it exists. + * + * @summary Create a new cluster or update the properties of the cluster if it exists. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Create.json + */ +async function createOrUpdateCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterParameters = { + aggregatorOrSingleRackDefinition: { + bareMetalMachineConfigurationData: [ + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:FF", + bootMacAddress: "00:BB:CC:DD:EE:FF", + machineDetails: "extraDetails", + machineName: "bmmName1", + rackSlot: 1, + serialNumber: "BM1219XXX", + }, + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:00", + bootMacAddress: "00:BB:CC:DD:EE:00", + machineDetails: "extraDetails", + machineName: "bmmName2", + rackSlot: 2, + serialNumber: "BM1219YYY", + }, + ], + networkRackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName", + rackLocation: "Foo Datacenter, Floor 3, Aisle 9, Rack 2", + rackSerialNumber: "AA1234", + rackSkuId: + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName", + storageApplianceConfigurationData: [ + { + adminCredentials: { password: "{password}", username: "username" }, + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceName: "vmName", + }, + ], + }, + analyticsWorkspaceId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName", + clusterLocation: "Foo Street, 3rd Floor, row 9", + clusterServicePrincipal: { + applicationId: "12345678-1234-1234-1234-123456789012", + password: "{password}", + principalId: "00000008-0004-0004-0004-000000000012", + tenantId: "80000000-4000-4000-4000-120000000000", + }, + clusterType: "SingleRack", + clusterVersion: "1.0.0", + computeDeploymentThreshold: { + type: "PercentSuccess", + grouping: "PerCluster", + value: 90, + }, + computeRackDefinitions: [ + { + bareMetalMachineConfigurationData: [ + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:FF", + bootMacAddress: "00:BB:CC:DD:EE:FF", + machineDetails: "extraDetails", + machineName: "bmmName1", + rackSlot: 1, + serialNumber: "BM1219XXX", + }, + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:00", + bootMacAddress: "00:BB:CC:DD:EE:00", + machineDetails: "extraDetails", + machineName: "bmmName2", + rackSlot: 2, + serialNumber: "BM1219YYY", + }, + ], + networkRackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName", + rackLocation: "Foo Datacenter, Floor 3, Aisle 9, Rack 2", + rackSerialNumber: "AA1234", + rackSkuId: + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName", + storageApplianceConfigurationData: [ + { + adminCredentials: { password: "{password}", username: "username" }, + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceName: "vmName", + }, + ], + }, + ], + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + managedResourceGroupConfiguration: { + name: "my-managed-rg", + location: "East US", + }, + networkFabricId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + clusterParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeleteSample.js new file mode 100644 index 000000000000..51a6507ec9e3 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided cluster. + * + * @summary Delete the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Delete.json + */ +async function deleteCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginDeleteAndWait(resourceGroupName, clusterName); + console.log(result); +} + +async function main() { + deleteCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeploySample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeploySample.js new file mode 100644 index 000000000000..566351cbfb53 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersDeploySample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deploy the cluster to the provided rack. + * + * @summary Deploy the cluster to the provided rack. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy.json + */ +async function deployCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterDeployParameters = {}; + const options = { clusterDeployParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginDeployAndWait(resourceGroupName, clusterName, options); + console.log(result); +} + +/** + * This sample demonstrates how to Deploy the cluster to the provided rack. + * + * @summary Deploy the cluster to the provided rack. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy_SkipValidation.json + */ +async function deployClusterSkippingValidation() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterDeployParameters = { + skipValidationsForMachines: ["bmmName1"], + }; + const options = { clusterDeployParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginDeployAndWait(resourceGroupName, clusterName, options); + console.log(result); +} + +async function main() { + deployCluster(); + deployClusterSkippingValidation(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersGetSample.js new file mode 100644 index 000000000000..8c2c44feaf21 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided cluster. + * + * @summary Get properties of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Get.json + */ +async function getCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.get(resourceGroupName, clusterName); + console.log(result); +} + +async function main() { + getCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListByResourceGroupSample.js new file mode 100644 index 000000000000..feccfd65460c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of clusters in the provided resource group. + * + * @summary Get a list of clusters in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListByResourceGroup.json + */ +async function listClustersForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusters.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClustersForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListBySubscriptionSample.js new file mode 100644 index 000000000000..cc7cab2b0e23 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of clusters in the provided subscription. + * + * @summary Get a list of clusters in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListBySubscription.json + */ +async function listClustersForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusters.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClustersForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateSample.js new file mode 100644 index 000000000000..e14d6d482be7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateSample.js @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * + * @summary Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json + */ +async function patchClusterAggregatorOrSingleRackDefinition() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterUpdateParameters = { + aggregatorOrSingleRackDefinition: { + bareMetalMachineConfigurationData: [ + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:FF", + bootMacAddress: "00:BB:CC:DD:EE:FF", + machineDetails: "extraDetails", + machineName: "bmmName1", + rackSlot: 1, + serialNumber: "BM1219XXX", + }, + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:00", + bootMacAddress: "00:BB:CC:DD:EE:00", + machineDetails: "extraDetails", + machineName: "bmmName2", + rackSlot: 2, + serialNumber: "BM1219YYY", + }, + ], + networkRackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName", + rackLocation: "Foo Datacenter, Floor 3, Aisle 9, Rack 2", + rackSerialNumber: "newSerialNumber", + rackSkuId: + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName", + storageApplianceConfigurationData: [ + { + adminCredentials: { password: "{password}", username: "username" }, + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceName: "vmName", + }, + ], + }, + computeDeploymentThreshold: { + type: "PercentSuccess", + grouping: "PerCluster", + value: 90, + }, + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { clusterUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginUpdateAndWait(resourceGroupName, clusterName, options); + console.log(result); +} + +/** + * This sample demonstrates how to Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * + * @summary Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_Location.json + */ +async function patchClusterLocation() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterUpdateParameters = { + clusterLocation: "Foo Street, 3rd Floor, row 9", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { clusterUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginUpdateAndWait(resourceGroupName, clusterName, options); + console.log(result); +} + +async function main() { + patchClusterAggregatorOrSingleRackDefinition(); + patchClusterLocation(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateVersionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateVersionSample.js new file mode 100644 index 000000000000..0c28e28ec0c9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/clustersUpdateVersionSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update the version of the provided cluster to one of the available supported versions. + * + * @summary Update the version of the provided cluster to one of the available supported versions. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_UpdateVersion.json + */ +async function updateClusterVersion() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterUpdateVersionParameters = { + targetClusterVersion: "2.0", + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginUpdateVersionAndWait( + resourceGroupName, + clusterName, + clusterUpdateVersionParameters + ); + console.log(result); +} + +async function main() { + updateClusterVersion(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesCreateOrUpdateSample.js new file mode 100644 index 000000000000..85cfd5143751 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesCreateOrUpdateSample.js @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @summary Create a new virtual machine console or update the properties of the existing virtual machine console. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Create.json + */ +async function createOrUpdateVirtualMachineConsole() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const consoleParameters = { + enabled: "True", + expiration: new Date("2022-06-01T01:27:03.008Z"), + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.beginCreateOrUpdateAndWait( + resourceGroupName, + virtualMachineName, + consoleName, + consoleParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesDeleteSample.js new file mode 100644 index 000000000000..662341449017 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesDeleteSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided virtual machine console. + * + * @summary Delete the provided virtual machine console. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Delete.json + */ +async function deleteVirtualMachineConsole() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.beginDeleteAndWait( + resourceGroupName, + virtualMachineName, + consoleName + ); + console.log(result); +} + +async function main() { + deleteVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesGetSample.js new file mode 100644 index 000000000000..a9fb5e9c0b27 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesGetSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided virtual machine console. + * + * @summary Get properties of the provided virtual machine console. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Get.json + */ +async function getVirtualMachineConsole() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.get(resourceGroupName, virtualMachineName, consoleName); + console.log(result); +} + +async function main() { + getVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesListByResourceGroupSample.js new file mode 100644 index 000000000000..00b96d63f737 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesListByResourceGroupSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of virtual machine consoles in the provided resource group. + * + * @summary Get a list of virtual machine consoles in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_ListByResourceGroup.json + */ +async function listVirtualMachineConsolesForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.consoles.listByResourceGroup( + resourceGroupName, + virtualMachineName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVirtualMachineConsolesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesUpdateSample.js new file mode 100644 index 000000000000..e0e8e460ff15 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/consolesUpdateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Patch.json + */ +async function patchVirtualMachineConsole() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const consoleUpdateParameters = { + enabled: "True", + expiration: new Date("2022-06-01T01:27:03.008Z"), + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { consoleUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.beginUpdateAndWait( + resourceGroupName, + virtualMachineName, + consoleName, + options + ); + console.log(result); +} + +async function main() { + patchVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksCreateOrUpdateSample.js new file mode 100644 index 000000000000..bcc86b537e29 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksCreateOrUpdateSample.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new default CNI network or update the properties of the existing default CNI network. + * + * @summary Create a new default CNI network or update the properties of the existing default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Create.json + */ +async function createOrUpdateDefaultCniNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const defaultCniNetworkParameters = { + cniBgpConfiguration: { + bgpPeers: [{ asNumber: 64497, peerIp: "203.0.113.254" }], + communityAdvertisements: [{ communities: ["64512:100"], subnetPrefix: "192.0.2.0/27" }], + serviceExternalPrefixes: ["192.0.2.0/28"], + serviceLoadBalancerPrefixes: ["192.0.2.16/28"], + }, + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + ipAllocationType: "DualStack", + ipv4ConnectedPrefix: "203.0.113.0/24", + ipv6ConnectedPrefix: "2001:db8:0:3::/64", + l3IsolationDomainId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + vlan: 12, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.beginCreateOrUpdateAndWait( + resourceGroupName, + defaultCniNetworkName, + defaultCniNetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksDeleteSample.js new file mode 100644 index 000000000000..410d4fb99e71 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksDeleteSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided default CNI network. + * + * @summary Delete the provided default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Delete.json + */ +async function deleteDefaultCniNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.beginDeleteAndWait( + resourceGroupName, + defaultCniNetworkName + ); + console.log(result); +} + +async function main() { + deleteDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksGetSample.js new file mode 100644 index 000000000000..0907d3da204e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided default CNI network. + * + * @summary Get properties of the provided default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Get.json + */ +async function getDefaultCniNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.get(resourceGroupName, defaultCniNetworkName); + console.log(result); +} + +async function main() { + getDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListByResourceGroupSample.js new file mode 100644 index 000000000000..a8afac2cfbee --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of default CNI networks in the provided resource group. + * + * @summary Get a list of default CNI networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListByResourceGroup.json + */ +async function listDefaultCniNetworksForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.defaultCniNetworks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listDefaultCniNetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListBySubscriptionSample.js new file mode 100644 index 000000000000..1e69bbb12ba3 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of default CNI networks in the provided subscription. + * + * @summary Get a list of default CNI networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListBySubscription.json + */ +async function listDefaultCniNetworksForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.defaultCniNetworks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listDefaultCniNetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksUpdateSample.js new file mode 100644 index 000000000000..582ed2cf0bd8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/defaultCniNetworksUpdateSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update tags associated with the provided default CNI network. + * + * @summary Update tags associated with the provided default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Patch.json + */ +async function patchDefaultCniNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const defaultCniNetworkUpdateParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { + defaultCniNetworkUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.update( + resourceGroupName, + defaultCniNetworkName, + options + ); + console.log(result); +} + +async function main() { + patchDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersCreateOrUpdateSample.js new file mode 100644 index 000000000000..44e6f3b650b4 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersCreateOrUpdateSample.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Create.json + */ +async function createOrUpdateHybridAksProvisionedClusterData() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const hybridAksClusterParameters = { + associatedNetworkIds: [ + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName", + ], + controlPlaneCount: 4, + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + hybridAksProvisionedClusterId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + workerCount: 8, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + hybridAksClusterName, + hybridAksClusterParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersDeleteSample.js new file mode 100644 index 000000000000..89dc0d14999b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersDeleteSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Delete.json + */ +async function deleteHybridAksProvisionedClusterData() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.beginDeleteAndWait( + resourceGroupName, + hybridAksClusterName + ); + console.log(result); +} + +async function main() { + deleteHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersGetSample.js new file mode 100644 index 000000000000..c756d8f146e7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @summary Get the additional details related to the provided Hybrid AKS provisioned cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Get.json + */ +async function getHybridAksProvisionedClusterData() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.get(resourceGroupName, hybridAksClusterName); + console.log(result); +} + +async function main() { + getHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListByResourceGroupSample.js new file mode 100644 index 000000000000..3aaaee63e9a5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @summary Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListByResourceGroup.json + */ +async function listHybridAksProvisionedClustersDataForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridAksClusters.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listHybridAksProvisionedClustersDataForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListBySubscriptionSample.js new file mode 100644 index 000000000000..51ffd64afa6f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @summary Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListBySubscription.json + */ +async function listHybridAksProvisionedClustersDataForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridAksClusters.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listHybridAksProvisionedClustersDataForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersRestartNodeSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersRestartNodeSample.js new file mode 100644 index 000000000000..2093c019c179 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersRestartNodeSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Restart a targeted node of a Hybrid AKS cluster. + * + * @summary Restart a targeted node of a Hybrid AKS cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_RestartNode.json + */ +async function restartAHybridAksClusterNode() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const hybridAksClusterRestartNodeParameters = { + nodeName: "nodeName", + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.beginRestartNodeAndWait( + resourceGroupName, + hybridAksClusterName, + hybridAksClusterRestartNodeParameters + ); + console.log(result); +} + +async function main() { + restartAHybridAksClusterNode(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersUpdateSample.js new file mode 100644 index 000000000000..9124fe2bea32 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/hybridAksClustersUpdateSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @summary Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Patch.json + */ +async function patchHybridAksProvisionedClusterData() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const hybridAksClusterUpdateParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { + hybridAksClusterUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.update( + resourceGroupName, + hybridAksClusterName, + options + ); + console.log(result); +} + +async function main() { + patchHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksCreateOrUpdateSample.js new file mode 100644 index 000000000000..4c18c9f060a8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksCreateOrUpdateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @summary Create a new layer 2 (L2) network or update the properties of the existing network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Create.json + */ +async function createOrUpdateL2Network() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const l2NetworkParameters = { + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + hybridAksPluginType: "DPDK", + interfaceName: "eth0", + l2IsolationDomainId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.beginCreateOrUpdateAndWait( + resourceGroupName, + l2NetworkName, + l2NetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksDeleteSample.js new file mode 100644 index 000000000000..d04b6a7cf567 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided layer 2 (L2) network. + * + * @summary Delete the provided layer 2 (L2) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Delete.json + */ +async function deleteL2Network() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.beginDeleteAndWait(resourceGroupName, l2NetworkName); + console.log(result); +} + +async function main() { + deleteL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksGetSample.js new file mode 100644 index 000000000000..2aa9091628dd --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided layer 2 (L2) network. + * + * @summary Get properties of the provided layer 2 (L2) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Get.json + */ +async function getL2Network() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.get(resourceGroupName, l2NetworkName); + console.log(result); +} + +async function main() { + getL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListByResourceGroupSample.js new file mode 100644 index 000000000000..87a4c050101b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of layer 2 (L2) networks in the provided resource group. + * + * @summary Get a list of layer 2 (L2) networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListByResourceGroup.json + */ +async function listL2NetworksForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l2Networks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL2NetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListBySubscriptionSample.js new file mode 100644 index 000000000000..29af4dddf5db --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of layer 2 (L2) networks in the provided subscription. + * + * @summary Get a list of layer 2 (L2) networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListBySubscription.json + */ +async function listL2NetworksForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l2Networks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL2NetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksUpdateSample.js new file mode 100644 index 000000000000..fb45ba62236f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l2NetworksUpdateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update tags associated with the provided layer 2 (L2) network. + * + * @summary Update tags associated with the provided layer 2 (L2) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Patch.json + */ +async function patchL2Network() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const l2NetworkUpdateParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { l2NetworkUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.update(resourceGroupName, l2NetworkName, options); + console.log(result); +} + +async function main() { + patchL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksCreateOrUpdateSample.js new file mode 100644 index 000000000000..cd360f9fffe3 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksCreateOrUpdateSample.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @summary Create a new layer 3 (L3) network or update the properties of the existing network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Create.json + */ +async function createOrUpdateL3Network() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const l3NetworkParameters = { + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + hybridAksIpamEnabled: "True", + hybridAksPluginType: "DPDK", + interfaceName: "eth0", + ipAllocationType: "DualStack", + ipv4ConnectedPrefix: "198.51.100.0/24", + ipv6ConnectedPrefix: "2001:db8::/64", + l3IsolationDomainId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + vlan: 12, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.beginCreateOrUpdateAndWait( + resourceGroupName, + l3NetworkName, + l3NetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksDeleteSample.js new file mode 100644 index 000000000000..c49ed85d8cf8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided layer 3 (L3) network. + * + * @summary Delete the provided layer 3 (L3) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Delete.json + */ +async function deleteL3Network() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.beginDeleteAndWait(resourceGroupName, l3NetworkName); + console.log(result); +} + +async function main() { + deleteL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksGetSample.js new file mode 100644 index 000000000000..bfacb582286c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided layer 3 (L3) network. + * + * @summary Get properties of the provided layer 3 (L3) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Get.json + */ +async function getL3Network() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.get(resourceGroupName, l3NetworkName); + console.log(result); +} + +async function main() { + getL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListByResourceGroupSample.js new file mode 100644 index 000000000000..410b1f80b563 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of layer 3 (L3) networks in the provided resource group. + * + * @summary Get a list of layer 3 (L3) networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListByResourceGroup.json + */ +async function listL3NetworksForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l3Networks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL3NetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListBySubscriptionSample.js new file mode 100644 index 000000000000..87fbe0e7219c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of layer 3 (L3) networks in the provided subscription. + * + * @summary Get a list of layer 3 (L3) networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListBySubscription.json + */ +async function listL3NetworksForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l3Networks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL3NetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksUpdateSample.js new file mode 100644 index 000000000000..fa50162f5455 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/l3NetworksUpdateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update tags associated with the provided layer 3 (L3) network. + * + * @summary Update tags associated with the provided layer 3 (L3) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Patch.json + */ +async function patchL3Network() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const l3NetworkUpdateParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { l3NetworkUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.update(resourceGroupName, l3NetworkName, options); + console.log(result); +} + +async function main() { + patchL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsCreateOrUpdateSample.js new file mode 100644 index 000000000000..103ee0422571 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsCreateOrUpdateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update the metrics configuration of the provided cluster. + * + * @summary Update the metrics configuration of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Update.json + */ +async function updateMetricsConfigurationOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const metricsConfigurationParameters = { + collectionInterval: 15, + enabledMetrics: ["metric1", "metric2"], + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationParameters + ); + console.log(result); +} + +async function main() { + updateMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsDeleteSample.js new file mode 100644 index 000000000000..98d185e2c54f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsDeleteSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the metrics configuration of the provided cluster. + * + * @summary Delete the metrics configuration of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Delete.json + */ +async function deleteMetricsConfigurationOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.beginDeleteAndWait( + resourceGroupName, + clusterName, + metricsConfigurationName + ); + console.log(result); +} + +async function main() { + deleteMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsGetSample.js new file mode 100644 index 000000000000..3b6f313e937c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsGetSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get metrics configuration of the provided cluster. + * + * @summary Get metrics configuration of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Get.json + */ +async function getMetricsConfigurationOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.get( + resourceGroupName, + clusterName, + metricsConfigurationName + ); + console.log(result); +} + +async function main() { + getMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsListByResourceGroupSample.js new file mode 100644 index 000000000000..2ad5ab788a9d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsListByResourceGroupSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of metrics configurations of the clusters in the provided resource group. + * + * @summary Get a list of metrics configurations of the clusters in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_ListByResourceGroup.json + */ +async function listMetricsConfigurationsOfClusterForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.metricsConfigurations.listByResourceGroup( + resourceGroupName, + clusterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listMetricsConfigurationsOfClusterForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsUpdateSample.js new file mode 100644 index 000000000000..0282d230721a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/metricsConfigurationsUpdateSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. + * + * @summary Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Patch.json + */ +async function patchMetricsConfigurationOfCluster() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const metricsConfigurationUpdateParameters = { + collectionInterval: 15, + enabledMetrics: ["metric1", "metric2"], + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { + metricsConfigurationUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.beginUpdateAndWait( + resourceGroupName, + clusterName, + metricsConfigurationName, + options + ); + console.log(result); +} + +async function main() { + patchMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/operationsListSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/operationsListSample.js new file mode 100644 index 000000000000..97939f9a3356 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/operationsListSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * + * @summary Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Operations_List.json + */ +async function listResourceProviderOperations() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listResourceProviderOperations(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/package.json b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/package.json new file mode 100644 index 000000000000..9e50c954d72f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-networkcloud-js-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript (Beta)", + "engines": { + "node": ">=14.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/networkcloud/arm-networkcloud" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/networkcloud/arm-networkcloud", + "dependencies": { + "@azure/arm-networkcloud": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusGetSample.js new file mode 100644 index 000000000000..a0ead5ff3dcc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusGetSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get the properties of the provided rack SKU. + * + * @summary Get the properties of the provided rack SKU. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_Get.json + */ +async function getRackSkuResource() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const rackSkuName = "rackSkuName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.rackSkus.get(rackSkuName); + console.log(result); +} + +async function main() { + getRackSkuResource(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusListBySubscriptionSample.js new file mode 100644 index 000000000000..e89d12b0321b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/rackSkusListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of rack SKUs in the provided subscription. + * + * @summary Get a list of rack SKUs in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_ListBySubscription.json + */ +async function listRackSkUsForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.rackSkus.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listRackSkUsForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksCreateOrUpdateSample.js new file mode 100644 index 000000000000..813e2b2c5b91 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksCreateOrUpdateSample.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Create.json + */ +async function createOrUpdateRack() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const rackParameters = { + availabilityZone: "1", + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + rackLocation: "Rack 28", + rackSerialNumber: "RACK_SERIAL_NUMBER", + rackSkuId: "RACK-TYPE-1", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.beginCreateOrUpdateAndWait( + resourceGroupName, + rackName, + rackParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksDeleteSample.js new file mode 100644 index 000000000000..a278324f56ca --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksDeleteSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided rack. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @summary Delete the provided rack. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Delete.json + */ +async function deleteRack() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.beginDeleteAndWait(resourceGroupName, rackName); + console.log(result); +} + +async function main() { + deleteRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksGetSample.js new file mode 100644 index 000000000000..984e32e7744b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided rack. + * + * @summary Get properties of the provided rack. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Get.json + */ +async function getRack() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.get(resourceGroupName, rackName); + console.log(result); +} + +async function main() { + getRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListByResourceGroupSample.js new file mode 100644 index 000000000000..3a6111b166b5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of racks in the provided resource group. + * + * @summary Get a list of racks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListByResourceGroup.json + */ +async function listRacksForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.racks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listRacksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListBySubscriptionSample.js new file mode 100644 index 000000000000..45afd7098e0a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of racks in the provided subscription. + * + * @summary Get a list of racks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListBySubscription.json + */ +async function listRacksForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.racks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listRacksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksUpdateSample.js new file mode 100644 index 000000000000..d517b7a60282 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/racksUpdateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently. + * + * @summary Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Patch.json + */ +async function patchRack() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const rackUpdateParameters = { + rackLocation: "Rack 2B", + rackSerialNumber: "RACK_SERIAL_NUMBER", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { rackUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.beginUpdateAndWait(resourceGroupName, rackName, options); + console.log(result); +} + +async function main() { + patchRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/sample.env b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesCreateOrUpdateSample.js new file mode 100644 index 000000000000..f0c556d2864a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesCreateOrUpdateSample.js @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Create.json + */ +async function createOrUpdateStorageAppliance() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceParameters = { + administratorCredentials: { password: "{password}", username: "adminUser" }, + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + rackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName", + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceSkuId: "684E-3B16-399E", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginCreateOrUpdateAndWait( + resourceGroupName, + storageApplianceName, + storageApplianceParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDeleteSample.js new file mode 100644 index 000000000000..a4fb46966cb3 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDeleteSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided storage appliance. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @summary Delete the provided storage appliance. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Delete.json + */ +async function deleteStorageAppliance() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginDeleteAndWait( + resourceGroupName, + storageApplianceName + ); + console.log(result); +} + +async function main() { + deleteStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDisableRemoteVendorManagementSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDisableRemoteVendorManagementSample.js new file mode 100644 index 000000000000..a58ad08eea68 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesDisableRemoteVendorManagementSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Disable remote vendor management of the provided storage appliance. + * + * @summary Disable remote vendor management of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_DisableRemoteVendorManagement.json + */ +async function turnOffRemoteVendorManagementForStorageAppliance() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginDisableRemoteVendorManagementAndWait( + resourceGroupName, + storageApplianceName + ); + console.log(result); +} + +async function main() { + turnOffRemoteVendorManagementForStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesEnableRemoteVendorManagementSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesEnableRemoteVendorManagementSample.js new file mode 100644 index 000000000000..d327fb1250eb --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesEnableRemoteVendorManagementSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Enable remote vendor management of the provided storage appliance. + * + * @summary Enable remote vendor management of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_EnableRemoteVendorManagement.json + */ +async function turnOnRemoteVendorManagementForStorageAppliance() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceEnableRemoteVendorManagementParameters = { + supportEndpoints: ["10.0.0.0/24"], + }; + const options = { + storageApplianceEnableRemoteVendorManagementParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginEnableRemoteVendorManagementAndWait( + resourceGroupName, + storageApplianceName, + options + ); + console.log(result); +} + +async function main() { + turnOnRemoteVendorManagementForStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesGetSample.js new file mode 100644 index 000000000000..57b2d86ab4e5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided storage appliance. + * + * @summary Get properties of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Get.json + */ +async function getStorageAppliance() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.get(resourceGroupName, storageApplianceName); + console.log(result); +} + +async function main() { + getStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListByResourceGroupSample.js new file mode 100644 index 000000000000..e67a9c81334b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of storage appliances in the provided resource group. + * + * @summary Get a list of storage appliances in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListByResourceGroup.json + */ +async function listStorageAppliancesForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAppliances.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listStorageAppliancesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListBySubscriptionSample.js new file mode 100644 index 000000000000..e00bb48053ad --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of storage appliances in the provided subscription. + * + * @summary Get a list of storage appliances in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListBySubscription.json + */ +async function listStorageAppliancesForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAppliances.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listStorageAppliancesForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesRunReadCommandsSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesRunReadCommandsSample.js new file mode 100644 index 000000000000..fb8cf5380569 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesRunReadCommandsSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Run and retrieve output from read only commands on the provided storage appliance. + * + * @summary Run and retrieve output from read only commands on the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_RunReadCommands.json + */ +async function runAndRetrieveOutputFromReadOnlyCommandsOnStorageAppliance() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceRunReadCommandsParameters = { + limitTimeSeconds: 60, + commands: [{ command: "AlertList" }], + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginRunReadCommandsAndWait( + resourceGroupName, + storageApplianceName, + storageApplianceRunReadCommandsParameters + ); + console.log(result); +} + +async function main() { + runAndRetrieveOutputFromReadOnlyCommandsOnStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesUpdateSample.js new file mode 100644 index 000000000000..d12cc028bd44 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesUpdateSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Patch.json + */ +async function patchStorageAppliance() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceUpdateParameters = { + serialNumber: "BM1219XXX", + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { + storageApplianceUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginUpdateAndWait( + resourceGroupName, + storageApplianceName, + options + ); + console.log(result); +} + +async function main() { + patchStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesValidateHardwareSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesValidateHardwareSample.js new file mode 100644 index 000000000000..058037efc068 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/storageAppliancesValidateHardwareSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Validate the hardware of the provided storage appliance. + * + * @summary Validate the hardware of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ValidateHardware.json + */ +async function validateTheStorageApplianceHardware() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceValidateHardwareParameters = { + validationCategory: "BasicValidation", + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginValidateHardwareAndWait( + resourceGroupName, + storageApplianceName, + storageApplianceValidateHardwareParameters + ); + console.log(result); +} + +async function main() { + validateTheStorageApplianceHardware(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksCreateOrUpdateSample.js new file mode 100644 index 000000000000..e0ae5b74eaf2 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksCreateOrUpdateSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new trunked network or update the properties of the existing trunked network. + * + * @summary Create a new trunked network or update the properties of the existing trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Create.json + */ +async function createOrUpdateTrunkedNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const trunkedNetworkParameters = { + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + hybridAksPluginType: "DPDK", + interfaceName: "eth0", + isolationDomainIds: [ + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName", + ], + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + vlans: [12, 14], + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.beginCreateOrUpdateAndWait( + resourceGroupName, + trunkedNetworkName, + trunkedNetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksDeleteSample.js new file mode 100644 index 000000000000..a65eaa109a34 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksDeleteSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided trunked network. + * + * @summary Delete the provided trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Delete.json + */ +async function deleteTrunkedNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.beginDeleteAndWait( + resourceGroupName, + trunkedNetworkName + ); + console.log(result); +} + +async function main() { + deleteTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksGetSample.js new file mode 100644 index 000000000000..6cbbffbe549d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided trunked network. + * + * @summary Get properties of the provided trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Get.json + */ +async function getTrunkedNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.get(resourceGroupName, trunkedNetworkName); + console.log(result); +} + +async function main() { + getTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListByResourceGroupSample.js new file mode 100644 index 000000000000..9d6bcca38b8c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of trunked networks in the provided resource group. + * + * @summary Get a list of trunked networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListByResourceGroup.json + */ +async function listTrunkedNetworksForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.trunkedNetworks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listTrunkedNetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListBySubscriptionSample.js new file mode 100644 index 000000000000..4358db653337 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of trunked networks in the provided subscription. + * + * @summary Get a list of trunked networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListBySubscription.json + */ +async function listTrunkedNetworksForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.trunkedNetworks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listTrunkedNetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksUpdateSample.js new file mode 100644 index 000000000000..dbe8b9e26582 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/trunkedNetworksUpdateSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update tags associated with the provided trunked network. + * + * @summary Update tags associated with the provided trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Patch.json + */ +async function patchTrunkedNetwork() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const trunkedNetworkUpdateParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { + trunkedNetworkUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.update( + resourceGroupName, + trunkedNetworkName, + options + ); + console.log(result); +} + +async function main() { + patchTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesAttachVolumeSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesAttachVolumeSample.js new file mode 100644 index 000000000000..6ffd4f6ce599 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesAttachVolumeSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Attach volume to the provided virtual machine. + * + * @summary Attach volume to the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_AttachVolume.json + */ +async function attachVolumeToVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineAttachVolumeParameters = { + volumeId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName", + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginAttachVolumeAndWait( + resourceGroupName, + virtualMachineName, + virtualMachineAttachVolumeParameters + ); + console.log(result); +} + +async function main() { + attachVolumeToVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesCreateOrUpdateSample.js new file mode 100644 index 000000000000..68629851add9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesCreateOrUpdateSample.js @@ -0,0 +1,101 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new virtual machine or update the properties of the existing virtual machine. + * + * @summary Create a new virtual machine or update the properties of the existing virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Create.json + */ +async function createOrUpdateVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineParameters = { + adminUsername: "username", + bootMethod: "UEFI", + cloudServicesNetworkAttachment: { + attachedNetworkId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName", + ipAllocationMethod: "Dynamic", + }, + cpuCores: 2, + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + memorySizeGB: 8, + networkAttachments: [ + { + attachedNetworkId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName", + defaultGateway: "True", + ipAllocationMethod: "Dynamic", + ipv4Address: "198.51.100.1", + ipv6Address: "2001:0db8:0000:0000:0000:0000:0000:0000", + networkAttachmentName: "netAttachName01", + }, + ], + networkData: "bmV0d29ya0RhdGVTYW1wbGU=", + placementHints: [ + { + hintType: "Affinity", + resourceId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName", + schedulingExecution: "Hard", + scope: "", + }, + ], + sshPublicKeys: [ + { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm", + }, + ], + storageProfile: { + osDisk: { + createOption: "Ephemeral", + deleteOption: "Delete", + diskSizeGB: 120, + }, + volumeAttachments: [ + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName", + ], + }, + tags: { key1: "myvalue1", key2: "myvalue2" }, + userData: "dXNlckRhdGVTYW1wbGU=", + vmDeviceModel: "T2", + vmImage: "myacr.azurecr.io/foobar:latest", + vmImageRepositoryCredentials: { + password: "{password}", + registryUrl: "myacr.azurecr.io", + username: "myuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + virtualMachineName, + virtualMachineParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDeleteSample.js new file mode 100644 index 000000000000..a919d5286c27 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDeleteSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided virtual machine. + * + * @summary Delete the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Delete.json + */ +async function deleteVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginDeleteAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + deleteVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDetachVolumeSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDetachVolumeSample.js new file mode 100644 index 000000000000..5399d070b4bd --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesDetachVolumeSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Detach volume from the provided virtual machine. + * + * @summary Detach volume from the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_DetachVolume.json + */ +async function detachVolumeFromVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineDetachVolumeParameters = { + volumeId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName", + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginDetachVolumeAndWait( + resourceGroupName, + virtualMachineName, + virtualMachineDetachVolumeParameters + ); + console.log(result); +} + +async function main() { + detachVolumeFromVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesGetSample.js new file mode 100644 index 000000000000..617322523c03 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided virtual machine. + * + * @summary Get properties of the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Get.json + */ +async function getVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.get(resourceGroupName, virtualMachineName); + console.log(result); +} + +async function main() { + getVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js new file mode 100644 index 000000000000..7d59deb25c3b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of virtual machines in the provided resource group. + * + * @summary Get a list of virtual machines in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListByResourceGroup.json + */ +async function listVirtualMachinesForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVirtualMachinesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListBySubscriptionSample.js new file mode 100644 index 000000000000..b57aab3c7312 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of virtual machines in the provided subscription. + * + * @summary Get a list of virtual machines in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListBySubscription.json + */ +async function listVirtualMachinesForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVirtualMachinesForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesPowerOffSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesPowerOffSample.js new file mode 100644 index 000000000000..9e76977fc2e7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesPowerOffSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Power off the provided virtual machine. + * + * @summary Power off the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_PowerOff.json + */ +async function powerOffVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachinePowerOffParameters = { + skipShutdown: "True", + }; + const options = { + virtualMachinePowerOffParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginPowerOffAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +async function main() { + powerOffVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesReimageSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesReimageSample.js new file mode 100644 index 000000000000..581e00c612db --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesReimageSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Reimage the provided virtual machine. + * + * @summary Reimage the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Reimage.json + */ +async function reimageVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginReimageAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + reimageVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesRestartSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesRestartSample.js new file mode 100644 index 000000000000..4ce04e17f91d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesRestartSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Restart the provided virtual machine. + * + * @summary Restart the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Restart.json + */ +async function restartVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + restartVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesStartSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesStartSample.js new file mode 100644 index 000000000000..600f82abdef0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesStartSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Start the provided virtual machine. + * + * @summary Start the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Start.json + */ +async function startVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + startVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesUpdateSample.js new file mode 100644 index 000000000000..5b63bebbee7b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/virtualMachinesUpdateSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Patch.json + */ +async function patchVirtualMachine() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineUpdateParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + vmImageRepositoryCredentials: { + password: "{password}", + registryUrl: "myacr.azurecr.io", + username: "myuser", + }, + }; + const options = { + virtualMachineUpdateParameters, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +async function main() { + patchVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesCreateOrUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesCreateOrUpdateSample.js new file mode 100644 index 000000000000..dd5672c27f79 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesCreateOrUpdateSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create a new volume or update the properties of the existing one. + * + * @summary Create a new volume or update the properties of the existing one. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Create.json + */ +async function createOrUpdateVolume() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const volumeParameters = { + extendedLocation: { + name: "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation", + }, + location: "location", + sizeMiB: 10000, + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.beginCreateOrUpdateAndWait( + resourceGroupName, + volumeName, + volumeParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesDeleteSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesDeleteSample.js new file mode 100644 index 000000000000..79c72413ccb0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Delete the provided volume. + * + * @summary Delete the provided volume. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Delete.json + */ +async function deleteVolume() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait(resourceGroupName, volumeName); + console.log(result); +} + +async function main() { + deleteVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesGetSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesGetSample.js new file mode 100644 index 000000000000..a56bbd9623fe --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get properties of the provided volume. + * + * @summary Get properties of the provided volume. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Get.json + */ +async function getVolume() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.get(resourceGroupName, volumeName); + console.log(result); +} + +async function main() { + getVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListByResourceGroupSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListByResourceGroupSample.js new file mode 100644 index 000000000000..75163b8a2319 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListByResourceGroupSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of volumes in the provided resource group. + * + * @summary Get a list of volumes in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListByResourceGroup.json + */ +async function listVolumesForResourceGroup() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVolumesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListBySubscriptionSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListBySubscriptionSample.js new file mode 100644 index 000000000000..ff62257b7eb2 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesListBySubscriptionSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a list of volumes in the provided subscription. + * + * @summary Get a list of volumes in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListBySubscription.json + */ +async function listVolumeForSubscription() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVolumeForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesUpdateSample.js b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesUpdateSample.js new file mode 100644 index 000000000000..f7034f9c5132 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/javascript/volumesUpdateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { NetworkCloud } = require("@azure/arm-networkcloud"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update tags associated with the provided volume. + * + * @summary Update tags associated with the provided volume. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Patch.json + */ +async function patchVolume() { + const subscriptionId = process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const volumeUpdateParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + }; + const options = { volumeUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.update(resourceGroupName, volumeName, options); + console.log(result); +} + +async function main() { + patchVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/README.md b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/README.md new file mode 100644 index 000000000000..2a6b79c83f5d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/README.md @@ -0,0 +1,311 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [bareMetalMachineKeySetsCreateOrUpdateSample.ts][baremetalmachinekeysetscreateorupdatesample] | Create a new bare metal machine key set or update the existing one for the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Create.json | +| [bareMetalMachineKeySetsDeleteSample.ts][baremetalmachinekeysetsdeletesample] | Delete the bare metal machine key set of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Delete.json | +| [bareMetalMachineKeySetsGetSample.ts][baremetalmachinekeysetsgetsample] | Get bare metal machine key set of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Get.json | +| [bareMetalMachineKeySetsListByResourceGroupSample.ts][baremetalmachinekeysetslistbyresourcegroupsample] | Get a list of bare metal machine key sets of the cluster in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_ListByResourceGroup.json | +| [bareMetalMachineKeySetsUpdateSample.ts][baremetalmachinekeysetsupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Patch.json | +| [bareMetalMachinesCordonSample.ts][baremetalmachinescordonsample] | Cordon the provided bare metal machine's Kubernetes node. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Cordon.json | +| [bareMetalMachinesCreateOrUpdateSample.ts][baremetalmachinescreateorupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Create.json | +| [bareMetalMachinesDeleteSample.ts][baremetalmachinesdeletesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Delete.json | +| [bareMetalMachinesGetSample.ts][baremetalmachinesgetsample] | Get properties of the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Get.json | +| [bareMetalMachinesListByResourceGroupSample.ts][baremetalmachineslistbyresourcegroupsample] | Get a list of bare metal machines in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListByResourceGroup.json | +| [bareMetalMachinesListBySubscriptionSample.ts][baremetalmachineslistbysubscriptionsample] | Get a list of bare metal machines in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListBySubscription.json | +| [bareMetalMachinesPowerOffSample.ts][baremetalmachinespoweroffsample] | Power off the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_PowerOff.json | +| [bareMetalMachinesReimageSample.ts][baremetalmachinesreimagesample] | Reimage the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Reimage.json | +| [bareMetalMachinesReplaceSample.ts][baremetalmachinesreplacesample] | Replace the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Replace.json | +| [bareMetalMachinesRestartSample.ts][baremetalmachinesrestartsample] | Restart the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Restart.json | +| [bareMetalMachinesRunCommandSample.ts][baremetalmachinesruncommandsample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunCommand.json | +| [bareMetalMachinesRunDataExtractsSample.ts][baremetalmachinesrundataextractssample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunDataExtracts.json | +| [bareMetalMachinesRunReadCommandsSample.ts][baremetalmachinesrunreadcommandssample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunReadCommands.json | +| [bareMetalMachinesStartSample.ts][baremetalmachinesstartsample] | Start the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Start.json | +| [bareMetalMachinesUncordonSample.ts][baremetalmachinesuncordonsample] | Uncordon the provided bare metal machine's Kubernetes node. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Uncordon.json | +| [bareMetalMachinesUpdateSample.ts][baremetalmachinesupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Patch.json | +| [bareMetalMachinesValidateHardwareSample.ts][baremetalmachinesvalidatehardwaresample] | Validate the hardware of the provided bare metal machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ValidateHardware.json | +| [bmcKeySetsCreateOrUpdateSample.ts][bmckeysetscreateorupdatesample] | Create a new baseboard management controller key set or update the existing one for the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Create.json | +| [bmcKeySetsDeleteSample.ts][bmckeysetsdeletesample] | Delete the baseboard management controller key set of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Delete.json | +| [bmcKeySetsGetSample.ts][bmckeysetsgetsample] | Get baseboard management controller key set of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Get.json | +| [bmcKeySetsListByResourceGroupSample.ts][bmckeysetslistbyresourcegroupsample] | Get a list of baseboard management controller key sets of the cluster in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_ListByResourceGroup.json | +| [bmcKeySetsUpdateSample.ts][bmckeysetsupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Patch.json | +| [cloudServicesNetworksCreateOrUpdateSample.ts][cloudservicesnetworkscreateorupdatesample] | Create a new cloud services network or update the properties of the existing cloud services network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Create.json | +| [cloudServicesNetworksDeleteSample.ts][cloudservicesnetworksdeletesample] | Delete the provided cloud services network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Delete.json | +| [cloudServicesNetworksGetSample.ts][cloudservicesnetworksgetsample] | Get properties of the provided cloud services network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Get.json | +| [cloudServicesNetworksListByResourceGroupSample.ts][cloudservicesnetworkslistbyresourcegroupsample] | Get a list of cloud services networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListByResourceGroup.json | +| [cloudServicesNetworksListBySubscriptionSample.ts][cloudservicesnetworkslistbysubscriptionsample] | Get a list of cloud services networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListBySubscription.json | +| [cloudServicesNetworksUpdateSample.ts][cloudservicesnetworksupdatesample] | Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Patch.json | +| [clusterManagersCreateOrUpdateSample.ts][clustermanagerscreateorupdatesample] | Create a new cluster manager or update properties of the cluster manager if it exists. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Create.json | +| [clusterManagersDeleteSample.ts][clustermanagersdeletesample] | Delete the provided cluster manager. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Delete.json | +| [clusterManagersGetSample.ts][clustermanagersgetsample] | Get the properties of the provided cluster manager. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Get.json | +| [clusterManagersListByResourceGroupSample.ts][clustermanagerslistbyresourcegroupsample] | Get a list of cluster managers in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListByResourceGroup.json | +| [clusterManagersListBySubscriptionSample.ts][clustermanagerslistbysubscriptionsample] | Get a list of cluster managers in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListBySubscription.json | +| [clusterManagersUpdateSample.ts][clustermanagersupdatesample] | Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Patch.json | +| [clustersCreateOrUpdateSample.ts][clusterscreateorupdatesample] | Create a new cluster or update the properties of the cluster if it exists. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Create.json | +| [clustersDeleteSample.ts][clustersdeletesample] | Delete the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Delete.json | +| [clustersDeploySample.ts][clustersdeploysample] | Deploy the cluster to the provided rack. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy.json | +| [clustersGetSample.ts][clustersgetsample] | Get properties of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Get.json | +| [clustersListByResourceGroupSample.ts][clusterslistbyresourcegroupsample] | Get a list of clusters in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListByResourceGroup.json | +| [clustersListBySubscriptionSample.ts][clusterslistbysubscriptionsample] | Get a list of clusters in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListBySubscription.json | +| [clustersUpdateSample.ts][clustersupdatesample] | Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json | +| [clustersUpdateVersionSample.ts][clustersupdateversionsample] | Update the version of the provided cluster to one of the available supported versions. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_UpdateVersion.json | +| [consolesCreateOrUpdateSample.ts][consolescreateorupdatesample] | Create a new virtual machine console or update the properties of the existing virtual machine console. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Create.json | +| [consolesDeleteSample.ts][consolesdeletesample] | Delete the provided virtual machine console. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Delete.json | +| [consolesGetSample.ts][consolesgetsample] | Get properties of the provided virtual machine console. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Get.json | +| [consolesListByResourceGroupSample.ts][consoleslistbyresourcegroupsample] | Get a list of virtual machine consoles in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_ListByResourceGroup.json | +| [consolesUpdateSample.ts][consolesupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Patch.json | +| [defaultCniNetworksCreateOrUpdateSample.ts][defaultcninetworkscreateorupdatesample] | Create a new default CNI network or update the properties of the existing default CNI network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Create.json | +| [defaultCniNetworksDeleteSample.ts][defaultcninetworksdeletesample] | Delete the provided default CNI network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Delete.json | +| [defaultCniNetworksGetSample.ts][defaultcninetworksgetsample] | Get properties of the provided default CNI network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Get.json | +| [defaultCniNetworksListByResourceGroupSample.ts][defaultcninetworkslistbyresourcegroupsample] | Get a list of default CNI networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListByResourceGroup.json | +| [defaultCniNetworksListBySubscriptionSample.ts][defaultcninetworkslistbysubscriptionsample] | Get a list of default CNI networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListBySubscription.json | +| [defaultCniNetworksUpdateSample.ts][defaultcninetworksupdatesample] | Update tags associated with the provided default CNI network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Patch.json | +| [hybridAksClustersCreateOrUpdateSample.ts][hybridaksclusterscreateorupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Create.json | +| [hybridAksClustersDeleteSample.ts][hybridaksclustersdeletesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Delete.json | +| [hybridAksClustersGetSample.ts][hybridaksclustersgetsample] | Get the additional details related to the provided Hybrid AKS provisioned cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Get.json | +| [hybridAksClustersListByResourceGroupSample.ts][hybridaksclusterslistbyresourcegroupsample] | Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListByResourceGroup.json | +| [hybridAksClustersListBySubscriptionSample.ts][hybridaksclusterslistbysubscriptionsample] | Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListBySubscription.json | +| [hybridAksClustersRestartNodeSample.ts][hybridaksclustersrestartnodesample] | Restart a targeted node of a Hybrid AKS cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_RestartNode.json | +| [hybridAksClustersUpdateSample.ts][hybridaksclustersupdatesample] | Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Patch.json | +| [l2NetworksCreateOrUpdateSample.ts][l2networkscreateorupdatesample] | Create a new layer 2 (L2) network or update the properties of the existing network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Create.json | +| [l2NetworksDeleteSample.ts][l2networksdeletesample] | Delete the provided layer 2 (L2) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Delete.json | +| [l2NetworksGetSample.ts][l2networksgetsample] | Get properties of the provided layer 2 (L2) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Get.json | +| [l2NetworksListByResourceGroupSample.ts][l2networkslistbyresourcegroupsample] | Get a list of layer 2 (L2) networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListByResourceGroup.json | +| [l2NetworksListBySubscriptionSample.ts][l2networkslistbysubscriptionsample] | Get a list of layer 2 (L2) networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListBySubscription.json | +| [l2NetworksUpdateSample.ts][l2networksupdatesample] | Update tags associated with the provided layer 2 (L2) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Patch.json | +| [l3NetworksCreateOrUpdateSample.ts][l3networkscreateorupdatesample] | Create a new layer 3 (L3) network or update the properties of the existing network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Create.json | +| [l3NetworksDeleteSample.ts][l3networksdeletesample] | Delete the provided layer 3 (L3) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Delete.json | +| [l3NetworksGetSample.ts][l3networksgetsample] | Get properties of the provided layer 3 (L3) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Get.json | +| [l3NetworksListByResourceGroupSample.ts][l3networkslistbyresourcegroupsample] | Get a list of layer 3 (L3) networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListByResourceGroup.json | +| [l3NetworksListBySubscriptionSample.ts][l3networkslistbysubscriptionsample] | Get a list of layer 3 (L3) networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListBySubscription.json | +| [l3NetworksUpdateSample.ts][l3networksupdatesample] | Update tags associated with the provided layer 3 (L3) network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Patch.json | +| [metricsConfigurationsCreateOrUpdateSample.ts][metricsconfigurationscreateorupdatesample] | Update the metrics configuration of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Update.json | +| [metricsConfigurationsDeleteSample.ts][metricsconfigurationsdeletesample] | Delete the metrics configuration of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Delete.json | +| [metricsConfigurationsGetSample.ts][metricsconfigurationsgetsample] | Get metrics configuration of the provided cluster. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Get.json | +| [metricsConfigurationsListByResourceGroupSample.ts][metricsconfigurationslistbyresourcegroupsample] | Get a list of metrics configurations of the clusters in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_ListByResourceGroup.json | +| [metricsConfigurationsUpdateSample.ts][metricsconfigurationsupdatesample] | Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Patch.json | +| [operationsListSample.ts][operationslistsample] | Get a list of all available resource provider operations. It contains a URL link to get the next set of results. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Operations_List.json | +| [rackSkusGetSample.ts][rackskusgetsample] | Get the properties of the provided rack SKU. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_Get.json | +| [rackSkusListBySubscriptionSample.ts][rackskuslistbysubscriptionsample] | Get a list of rack SKUs in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_ListBySubscription.json | +| [racksCreateOrUpdateSample.ts][rackscreateorupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Create.json | +| [racksDeleteSample.ts][racksdeletesample] | Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Delete.json | +| [racksGetSample.ts][racksgetsample] | Get properties of the provided rack. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Get.json | +| [racksListByResourceGroupSample.ts][rackslistbyresourcegroupsample] | Get a list of racks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListByResourceGroup.json | +| [racksListBySubscriptionSample.ts][rackslistbysubscriptionsample] | Get a list of racks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListBySubscription.json | +| [racksUpdateSample.ts][racksupdatesample] | Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Patch.json | +| [storageAppliancesCreateOrUpdateSample.ts][storageappliancescreateorupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Create.json | +| [storageAppliancesDeleteSample.ts][storageappliancesdeletesample] | Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Delete.json | +| [storageAppliancesDisableRemoteVendorManagementSample.ts][storageappliancesdisableremotevendormanagementsample] | Disable remote vendor management of the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_DisableRemoteVendorManagement.json | +| [storageAppliancesEnableRemoteVendorManagementSample.ts][storageappliancesenableremotevendormanagementsample] | Enable remote vendor management of the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_EnableRemoteVendorManagement.json | +| [storageAppliancesGetSample.ts][storageappliancesgetsample] | Get properties of the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Get.json | +| [storageAppliancesListByResourceGroupSample.ts][storageapplianceslistbyresourcegroupsample] | Get a list of storage appliances in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListByResourceGroup.json | +| [storageAppliancesListBySubscriptionSample.ts][storageapplianceslistbysubscriptionsample] | Get a list of storage appliances in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListBySubscription.json | +| [storageAppliancesRunReadCommandsSample.ts][storageappliancesrunreadcommandssample] | Run and retrieve output from read only commands on the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_RunReadCommands.json | +| [storageAppliancesUpdateSample.ts][storageappliancesupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Patch.json | +| [storageAppliancesValidateHardwareSample.ts][storageappliancesvalidatehardwaresample] | Validate the hardware of the provided storage appliance. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ValidateHardware.json | +| [trunkedNetworksCreateOrUpdateSample.ts][trunkednetworkscreateorupdatesample] | Create a new trunked network or update the properties of the existing trunked network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Create.json | +| [trunkedNetworksDeleteSample.ts][trunkednetworksdeletesample] | Delete the provided trunked network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Delete.json | +| [trunkedNetworksGetSample.ts][trunkednetworksgetsample] | Get properties of the provided trunked network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Get.json | +| [trunkedNetworksListByResourceGroupSample.ts][trunkednetworkslistbyresourcegroupsample] | Get a list of trunked networks in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListByResourceGroup.json | +| [trunkedNetworksListBySubscriptionSample.ts][trunkednetworkslistbysubscriptionsample] | Get a list of trunked networks in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListBySubscription.json | +| [trunkedNetworksUpdateSample.ts][trunkednetworksupdatesample] | Update tags associated with the provided trunked network. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Patch.json | +| [virtualMachinesAttachVolumeSample.ts][virtualmachinesattachvolumesample] | Attach volume to the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_AttachVolume.json | +| [virtualMachinesCreateOrUpdateSample.ts][virtualmachinescreateorupdatesample] | Create a new virtual machine or update the properties of the existing virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Create.json | +| [virtualMachinesDeleteSample.ts][virtualmachinesdeletesample] | Delete the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Delete.json | +| [virtualMachinesDetachVolumeSample.ts][virtualmachinesdetachvolumesample] | Detach volume from the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_DetachVolume.json | +| [virtualMachinesGetSample.ts][virtualmachinesgetsample] | Get properties of the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Get.json | +| [virtualMachinesListByResourceGroupSample.ts][virtualmachineslistbyresourcegroupsample] | Get a list of virtual machines in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListByResourceGroup.json | +| [virtualMachinesListBySubscriptionSample.ts][virtualmachineslistbysubscriptionsample] | Get a list of virtual machines in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListBySubscription.json | +| [virtualMachinesPowerOffSample.ts][virtualmachinespoweroffsample] | Power off the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_PowerOff.json | +| [virtualMachinesReimageSample.ts][virtualmachinesreimagesample] | Reimage the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Reimage.json | +| [virtualMachinesRestartSample.ts][virtualmachinesrestartsample] | Restart the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Restart.json | +| [virtualMachinesStartSample.ts][virtualmachinesstartsample] | Start the provided virtual machine. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Start.json | +| [virtualMachinesUpdateSample.ts][virtualmachinesupdatesample] | 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. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Patch.json | +| [volumesCreateOrUpdateSample.ts][volumescreateorupdatesample] | Create a new volume or update the properties of the existing one. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Create.json | +| [volumesDeleteSample.ts][volumesdeletesample] | Delete the provided volume. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Delete.json | +| [volumesGetSample.ts][volumesgetsample] | Get properties of the provided volume. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Get.json | +| [volumesListByResourceGroupSample.ts][volumeslistbyresourcegroupsample] | Get a list of volumes in the provided resource group. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListByResourceGroup.json | +| [volumesListBySubscriptionSample.ts][volumeslistbysubscriptionsample] | Get a list of volumes in the provided subscription. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListBySubscription.json | +| [volumesUpdateSample.ts][volumesupdatesample] | Update tags associated with the provided volume. x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Patch.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/bareMetalMachineKeySetsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env NETWORKCLOUD_SUBSCRIPTION_ID="" NETWORKCLOUD_RESOURCE_GROUP="" node dist/bareMetalMachineKeySetsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[baremetalmachinekeysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsCreateOrUpdateSample.ts +[baremetalmachinekeysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsDeleteSample.ts +[baremetalmachinekeysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsGetSample.ts +[baremetalmachinekeysetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsListByResourceGroupSample.ts +[baremetalmachinekeysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsUpdateSample.ts +[baremetalmachinescordonsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCordonSample.ts +[baremetalmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCreateOrUpdateSample.ts +[baremetalmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesDeleteSample.ts +[baremetalmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesGetSample.ts +[baremetalmachineslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListByResourceGroupSample.ts +[baremetalmachineslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListBySubscriptionSample.ts +[baremetalmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesPowerOffSample.ts +[baremetalmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReimageSample.ts +[baremetalmachinesreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReplaceSample.ts +[baremetalmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRestartSample.ts +[baremetalmachinesruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunCommandSample.ts +[baremetalmachinesrundataextractssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunDataExtractsSample.ts +[baremetalmachinesrunreadcommandssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunReadCommandsSample.ts +[baremetalmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesStartSample.ts +[baremetalmachinesuncordonsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUncordonSample.ts +[baremetalmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUpdateSample.ts +[baremetalmachinesvalidatehardwaresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesValidateHardwareSample.ts +[bmckeysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsCreateOrUpdateSample.ts +[bmckeysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsDeleteSample.ts +[bmckeysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsGetSample.ts +[bmckeysetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsListByResourceGroupSample.ts +[bmckeysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsUpdateSample.ts +[cloudservicesnetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksCreateOrUpdateSample.ts +[cloudservicesnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksDeleteSample.ts +[cloudservicesnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksGetSample.ts +[cloudservicesnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListByResourceGroupSample.ts +[cloudservicesnetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListBySubscriptionSample.ts +[cloudservicesnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksUpdateSample.ts +[clustermanagerscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersCreateOrUpdateSample.ts +[clustermanagersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersDeleteSample.ts +[clustermanagersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersGetSample.ts +[clustermanagerslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListByResourceGroupSample.ts +[clustermanagerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListBySubscriptionSample.ts +[clustermanagersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersUpdateSample.ts +[clusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersCreateOrUpdateSample.ts +[clustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeleteSample.ts +[clustersdeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeploySample.ts +[clustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersGetSample.ts +[clusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListByResourceGroupSample.ts +[clusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListBySubscriptionSample.ts +[clustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateSample.ts +[clustersupdateversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateVersionSample.ts +[consolescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesCreateOrUpdateSample.ts +[consolesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesDeleteSample.ts +[consolesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesGetSample.ts +[consoleslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesListByResourceGroupSample.ts +[consolesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesUpdateSample.ts +[defaultcninetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksCreateOrUpdateSample.ts +[defaultcninetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksDeleteSample.ts +[defaultcninetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksGetSample.ts +[defaultcninetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListByResourceGroupSample.ts +[defaultcninetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListBySubscriptionSample.ts +[defaultcninetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksUpdateSample.ts +[hybridaksclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersCreateOrUpdateSample.ts +[hybridaksclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersDeleteSample.ts +[hybridaksclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersGetSample.ts +[hybridaksclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListByResourceGroupSample.ts +[hybridaksclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListBySubscriptionSample.ts +[hybridaksclustersrestartnodesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersRestartNodeSample.ts +[hybridaksclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersUpdateSample.ts +[l2networkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksCreateOrUpdateSample.ts +[l2networksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksDeleteSample.ts +[l2networksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksGetSample.ts +[l2networkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListByResourceGroupSample.ts +[l2networkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListBySubscriptionSample.ts +[l2networksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksUpdateSample.ts +[l3networkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksCreateOrUpdateSample.ts +[l3networksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksDeleteSample.ts +[l3networksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksGetSample.ts +[l3networkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListByResourceGroupSample.ts +[l3networkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListBySubscriptionSample.ts +[l3networksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksUpdateSample.ts +[metricsconfigurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsCreateOrUpdateSample.ts +[metricsconfigurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsDeleteSample.ts +[metricsconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsGetSample.ts +[metricsconfigurationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsListByResourceGroupSample.ts +[metricsconfigurationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsUpdateSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/operationsListSample.ts +[rackskusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusGetSample.ts +[rackskuslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusListBySubscriptionSample.ts +[rackscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksCreateOrUpdateSample.ts +[racksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksDeleteSample.ts +[racksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksGetSample.ts +[rackslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListByResourceGroupSample.ts +[rackslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListBySubscriptionSample.ts +[racksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksUpdateSample.ts +[storageappliancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesCreateOrUpdateSample.ts +[storageappliancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDeleteSample.ts +[storageappliancesdisableremotevendormanagementsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDisableRemoteVendorManagementSample.ts +[storageappliancesenableremotevendormanagementsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesEnableRemoteVendorManagementSample.ts +[storageappliancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesGetSample.ts +[storageapplianceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListByResourceGroupSample.ts +[storageapplianceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListBySubscriptionSample.ts +[storageappliancesrunreadcommandssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesRunReadCommandsSample.ts +[storageappliancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesUpdateSample.ts +[storageappliancesvalidatehardwaresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesValidateHardwareSample.ts +[trunkednetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksCreateOrUpdateSample.ts +[trunkednetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksDeleteSample.ts +[trunkednetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksGetSample.ts +[trunkednetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListByResourceGroupSample.ts +[trunkednetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListBySubscriptionSample.ts +[trunkednetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksUpdateSample.ts +[virtualmachinesattachvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesAttachVolumeSample.ts +[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesCreateOrUpdateSample.ts +[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDeleteSample.ts +[virtualmachinesdetachvolumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDetachVolumeSample.ts +[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesGetSample.ts +[virtualmachineslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListByResourceGroupSample.ts +[virtualmachineslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListBySubscriptionSample.ts +[virtualmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesPowerOffSample.ts +[virtualmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesReimageSample.ts +[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesRestartSample.ts +[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesStartSample.ts +[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesUpdateSample.ts +[volumescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesCreateOrUpdateSample.ts +[volumesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesDeleteSample.ts +[volumesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesGetSample.ts +[volumeslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListByResourceGroupSample.ts +[volumeslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListBySubscriptionSample.ts +[volumesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesUpdateSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-networkcloud?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/networkcloud/arm-networkcloud/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/package.json b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/package.json new file mode 100644 index 000000000000..69b55e0de517 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-networkcloud-ts-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript (Beta)", + "engines": { + "node": ">=14.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/networkcloud/arm-networkcloud" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/networkcloud/arm-networkcloud", + "dependencies": { + "@azure/arm-networkcloud": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^14.0.0", + "typescript": "~5.0.0", + "rimraf": "latest" + } +} diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/sample.env b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..0d7b130c90e7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsCreateOrUpdateSample.ts @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BareMetalMachineKeySet, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @summary Create a new bare metal machine key set or update the existing one for the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Create.json + */ +async function createOrUpdateBareMetalMachineKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const bareMetalMachineKeySetParameters: BareMetalMachineKeySet = { + azureGroupId: "f110271b-XXXX-4163-9b99-214d91660f0e", + expiration: new Date("2022-12-31T23:59:59.008Z"), + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + jumpHostsAllowed: ["192.0.2.1", "192.0.2.5"], + location: "location", + osGroupName: "standardAccessGroup", + privilegeLevel: "Standard", + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + }, + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsDeleteSample.ts new file mode 100644 index 000000000000..4b4df293fa7d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the bare metal machine key set of the provided cluster. + * + * @summary Delete the bare metal machine key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Delete.json + */ +async function deleteBareMetalMachineKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.beginDeleteAndWait( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName + ); + console.log(result); +} + +async function main() { + deleteBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsGetSample.ts new file mode 100644 index 000000000000..292e7db65d27 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get bare metal machine key set of the provided cluster. + * + * @summary Get bare metal machine key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Get.json + */ +async function getBareMetalMachineKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.get( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName + ); + console.log(result); +} + +async function main() { + getBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsListByResourceGroupSample.ts new file mode 100644 index 000000000000..80f5ae210121 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsListByResourceGroupSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @summary Get a list of bare metal machine key sets of the cluster in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_ListByResourceGroup.json + */ +async function listBareMetalMachineKeySetOfClusterForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bareMetalMachineKeySets.listByResourceGroup( + resourceGroupName, + clusterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBareMetalMachineKeySetOfClusterForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsUpdateSample.ts new file mode 100644 index 000000000000..ea55372fe66c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachineKeySetsUpdateSample.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineKeySetPatchParameters, + BareMetalMachineKeySetsUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Patch.json + */ +async function patchBareMetalMachineKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bareMetalMachineKeySetName = "bareMetalMachineKeySetName"; + const bareMetalMachineKeySetUpdateParameters: BareMetalMachineKeySetPatchParameters = { + expiration: new Date("2022-12-31T23:59:59.008Z"), + jumpHostsAllowed: ["192.0.2.1", "192.0.2.5"], + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + }, + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + } + ] + }; + const options: BareMetalMachineKeySetsUpdateOptionalParams = { + bareMetalMachineKeySetUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachineKeySets.beginUpdateAndWait( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + options + ); + console.log(result); +} + +async function main() { + patchBareMetalMachineKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCordonSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCordonSample.ts new file mode 100644 index 000000000000..9f0c7b443201 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCordonSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineCordonParameters, + BareMetalMachinesCordonOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cordon the provided bare metal machine's Kubernetes node. + * + * @summary Cordon the provided bare metal machine's Kubernetes node. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Cordon.json + */ +async function cordonBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineCordonParameters: BareMetalMachineCordonParameters = { + evacuate: "True" + }; + const options: BareMetalMachinesCordonOptionalParams = { + bareMetalMachineCordonParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginCordonAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + cordonBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4c981508dfe3 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesCreateOrUpdateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BareMetalMachine, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Create.json + */ +async function createOrUpdateBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineParameters: BareMetalMachine = { + bmcConnectionString: "bmcconnectionstring", + bmcCredentials: { password: "{password}", username: "bmcuser" }, + bmcMacAddress: "00:00:4f:00:57:00", + bootMacAddress: "00:00:4e:00:58:af", + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + machineDetails: "User-provided machine details.", + machineName: "r01c001", + machineSkuId: "684E-3B16-399E", + rackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName", + rackSlot: 1, + serialNumber: "BM1219XXX", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesDeleteSample.ts new file mode 100644 index 000000000000..dc8d8ff13346 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Delete.json + */ +async function deleteBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginDeleteAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + deleteBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesGetSample.ts new file mode 100644 index 000000000000..20f071068f48 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided bare metal machine. + * + * @summary Get properties of the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Get.json + */ +async function getBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.get( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + getBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListByResourceGroupSample.ts new file mode 100644 index 000000000000..47ff11a6227b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of bare metal machines in the provided resource group. + * + * @summary Get a list of bare metal machines in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListByResourceGroup.json + */ +async function listBareMetalMachinesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bareMetalMachines.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBareMetalMachinesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListBySubscriptionSample.ts new file mode 100644 index 000000000000..2f53e7a9d79a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of bare metal machines in the provided subscription. + * + * @summary Get a list of bare metal machines in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListBySubscription.json + */ +async function listBareMetalMachinesForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bareMetalMachines.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBareMetalMachinesForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesPowerOffSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesPowerOffSample.ts new file mode 100644 index 000000000000..4f118e62e147 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesPowerOffSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachinePowerOffParameters, + BareMetalMachinesPowerOffOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Power off the provided bare metal machine. + * + * @summary Power off the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_PowerOff.json + */ +async function powerOffBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachinePowerOffParameters: BareMetalMachinePowerOffParameters = { + skipShutdown: "True" + }; + const options: BareMetalMachinesPowerOffOptionalParams = { + bareMetalMachinePowerOffParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginPowerOffAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + powerOffBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReimageSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReimageSample.ts new file mode 100644 index 000000000000..500b86ba8b64 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReimageSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Reimage the provided bare metal machine. + * + * @summary Reimage the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Reimage.json + */ +async function reimageBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginReimageAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + reimageBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReplaceSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReplaceSample.ts new file mode 100644 index 000000000000..c7212b3d39b8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesReplaceSample.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineReplaceParameters, + BareMetalMachinesReplaceOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Replace the provided bare metal machine. + * + * @summary Replace the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Replace.json + */ +async function replaceBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineReplaceParameters: BareMetalMachineReplaceParameters = { + bmcCredentials: { password: "{password}", username: "bmcuser" }, + bmcMacAddress: "00:00:4f:00:57:ad", + bootMacAddress: "00:00:4e:00:58:af", + machineName: "name", + serialNumber: "BM1219XXX" + }; + const options: BareMetalMachinesReplaceOptionalParams = { + bareMetalMachineReplaceParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginReplaceAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + replaceBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRestartSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRestartSample.ts new file mode 100644 index 000000000000..ebbe461ecd95 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRestartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restart the provided bare metal machine. + * + * @summary Restart the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Restart.json + */ +async function restartBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRestartAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + restartBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunCommandSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunCommandSample.ts new file mode 100644 index 000000000000..dadaca0afa09 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunCommandSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineRunCommandParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunCommand.json + */ +async function runCommandOnBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineRunCommandParameters: BareMetalMachineRunCommandParameters = { + arguments: ["--argument1", "argument2"], + limitTimeSeconds: 60, + script: "cHdkCg==" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRunCommandAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunCommandParameters + ); + console.log(result); +} + +async function main() { + runCommandOnBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunDataExtractsSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunDataExtractsSample.ts new file mode 100644 index 000000000000..490cb272b05a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunDataExtractsSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineRunDataExtractsParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunDataExtracts.json + */ +async function runDataExtractionOnBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineRunDataExtractsParameters: BareMetalMachineRunDataExtractsParameters = { + limitTimeSeconds: 60, + commands: [{ command: "networkInfo" }] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRunDataExtractsAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunDataExtractsParameters + ); + console.log(result); +} + +async function main() { + runDataExtractionOnBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunReadCommandsSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunReadCommandsSample.ts new file mode 100644 index 000000000000..772996b91a7c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesRunReadCommandsSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineRunReadCommandsParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunReadCommands.json + */ +async function runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineRunReadCommandsParameters: BareMetalMachineRunReadCommandsParameters = { + limitTimeSeconds: 60, + commands: [ + { arguments: ["pods", "-A"], command: "kubectl get" }, + { arguments: ["192.168.0.99", "-c", "3"], command: "ping" } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginRunReadCommandsAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunReadCommandsParameters + ); + console.log(result); +} + +async function main() { + runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesStartSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesStartSample.ts new file mode 100644 index 000000000000..74c46d8f13f1 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesStartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Start the provided bare metal machine. + * + * @summary Start the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Start.json + */ +async function startBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginStartAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + startBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUncordonSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUncordonSample.ts new file mode 100644 index 000000000000..1c013812ddb6 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUncordonSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Uncordon the provided bare metal machine's Kubernetes node. + * + * @summary Uncordon the provided bare metal machine's Kubernetes node. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Uncordon.json + */ +async function uncordonBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginUncordonAndWait( + resourceGroupName, + bareMetalMachineName + ); + console.log(result); +} + +async function main() { + uncordonBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUpdateSample.ts new file mode 100644 index 000000000000..5061d64fc740 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesUpdateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachinePatchParameters, + BareMetalMachinesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Patch.json + */ +async function patchBareMetalMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineUpdateParameters: BareMetalMachinePatchParameters = { + machineDetails: "machinedetails", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: BareMetalMachinesUpdateOptionalParams = { + bareMetalMachineUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginUpdateAndWait( + resourceGroupName, + bareMetalMachineName, + options + ); + console.log(result); +} + +async function main() { + patchBareMetalMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesValidateHardwareSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesValidateHardwareSample.ts new file mode 100644 index 000000000000..cbd4442972b7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bareMetalMachinesValidateHardwareSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BareMetalMachineValidateHardwareParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validate the hardware of the provided bare metal machine. + * + * @summary Validate the hardware of the provided bare metal machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ValidateHardware.json + */ +async function validateTheBareMetalMachineHardware() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const bareMetalMachineName = "bareMetalMachineName"; + const bareMetalMachineValidateHardwareParameters: BareMetalMachineValidateHardwareParameters = { + validationCategory: "BasicValidation" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bareMetalMachines.beginValidateHardwareAndWait( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineValidateHardwareParameters + ); + console.log(result); +} + +async function main() { + validateTheBareMetalMachineHardware(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..cf9d48b62726 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsCreateOrUpdateSample.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BmcKeySet, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @summary Create a new baseboard management controller key set or update the existing one for the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Create.json + */ +async function createOrUpdateBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const bmcKeySetParameters: BmcKeySet = { + azureGroupId: "f110271b-XXXX-4163-9b99-214d91660f0e", + expiration: new Date("2022-12-31T23:59:59.008Z"), + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + privilegeLevel: "Administrator", + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + }, + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + } + ] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + bmcKeySetName, + bmcKeySetParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsDeleteSample.ts new file mode 100644 index 000000000000..bbfce0bc586f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the baseboard management controller key set of the provided cluster. + * + * @summary Delete the baseboard management controller key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Delete.json + */ +async function deleteBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.beginDeleteAndWait( + resourceGroupName, + clusterName, + bmcKeySetName + ); + console.log(result); +} + +async function main() { + deleteBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsGetSample.ts new file mode 100644 index 000000000000..5fefae63a853 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get baseboard management controller key set of the provided cluster. + * + * @summary Get baseboard management controller key set of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Get.json + */ +async function getBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.get( + resourceGroupName, + clusterName, + bmcKeySetName + ); + console.log(result); +} + +async function main() { + getBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsListByResourceGroupSample.ts new file mode 100644 index 000000000000..ad4c210d26b0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsListByResourceGroupSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @summary Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_ListByResourceGroup.json + */ +async function listBaseboardManagementControllerKeySetOfClusterForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bmcKeySets.listByResourceGroup( + resourceGroupName, + clusterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listBaseboardManagementControllerKeySetOfClusterForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsUpdateSample.ts new file mode 100644 index 000000000000..92c7e4b07f5a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/bmcKeySetsUpdateSample.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BmcKeySetPatchParameters, + BmcKeySetsUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Patch.json + */ +async function patchBaseboardManagementControllerKeySetOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const bmcKeySetName = "bmcKeySetName"; + const bmcKeySetUpdateParameters: BmcKeySetPatchParameters = { + expiration: new Date("2022-12-31T23:59:59.008Z"), + tags: { key1: "myvalue1", key2: "myvalue2" }, + userList: [ + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userABC", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + }, + { + description: + "Needs access for troubleshooting as a part of the support team", + azureUserName: "userXYZ", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + } + ] + }; + const options: BmcKeySetsUpdateOptionalParams = { bmcKeySetUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.bmcKeySets.beginUpdateAndWait( + resourceGroupName, + clusterName, + bmcKeySetName, + options + ); + console.log(result); +} + +async function main() { + patchBaseboardManagementControllerKeySetOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..98f3571cc5cf --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksCreateOrUpdateSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CloudServicesNetwork, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new cloud services network or update the properties of the existing cloud services network. + * + * @summary Create a new cloud services network or update the properties of the existing cloud services network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Create.json + */ +async function createOrUpdateCloudServicesNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const cloudServicesNetworkParameters: CloudServicesNetwork = { + additionalEgressEndpoints: [ + { + category: "azure-resource-management", + endpoints: [ + { + domainName: "https://storageaccountex.blob.core.windows.net", + port: 443 + } + ] + } + ], + enableDefaultEgressEndpoints: "False", + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.beginCreateOrUpdateAndWait( + resourceGroupName, + cloudServicesNetworkName, + cloudServicesNetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksDeleteSample.ts new file mode 100644 index 000000000000..2c63832861a0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided cloud services network. + * + * @summary Delete the provided cloud services network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Delete.json + */ +async function deleteCloudServicesNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.beginDeleteAndWait( + resourceGroupName, + cloudServicesNetworkName + ); + console.log(result); +} + +async function main() { + deleteCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksGetSample.ts new file mode 100644 index 000000000000..139f29e30a59 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided cloud services network. + * + * @summary Get properties of the provided cloud services network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Get.json + */ +async function getCloudServicesNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.get( + resourceGroupName, + cloudServicesNetworkName + ); + console.log(result); +} + +async function main() { + getCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..0ceca38f79ad --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of cloud services networks in the provided resource group. + * + * @summary Get a list of cloud services networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListByResourceGroup.json + */ +async function listCloudServicesNetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServicesNetworks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listCloudServicesNetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..f6769d5d3a78 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of cloud services networks in the provided subscription. + * + * @summary Get a list of cloud services networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListBySubscription.json + */ +async function listCloudServicesNetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cloudServicesNetworks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listCloudServicesNetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksUpdateSample.ts new file mode 100644 index 000000000000..08c1998a176a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/cloudServicesNetworksUpdateSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CloudServicesNetworkPatchParameters, + CloudServicesNetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently. + * + * @summary Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Patch.json + */ +async function patchCloudServicesNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const cloudServicesNetworkName = "cloudServicesNetworkName"; + const cloudServicesNetworkUpdateParameters: CloudServicesNetworkPatchParameters = { + additionalEgressEndpoints: [ + { + category: "azure-resource-management", + endpoints: [ + { + domainName: "https://storageaccountex.blob.core.windows.net", + port: 443 + } + ] + } + ], + enableDefaultEgressEndpoints: "False", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: CloudServicesNetworksUpdateOptionalParams = { + cloudServicesNetworkUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.cloudServicesNetworks.beginUpdateAndWait( + resourceGroupName, + cloudServicesNetworkName, + options + ); + console.log(result); +} + +async function main() { + patchCloudServicesNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..124495f1da24 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersCreateOrUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ClusterManager, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @summary Create a new cluster manager or update properties of the cluster manager if it exists. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Create.json + */ +async function createOrUpdateClusterManager() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const clusterManagerParameters: ClusterManager = { + analyticsWorkspaceId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName", + fabricControllerId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName", + location: "location", + managedResourceGroupConfiguration: { + name: "my-managed-rg", + location: "East US" + }, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterManagerName, + clusterManagerParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersDeleteSample.ts new file mode 100644 index 000000000000..baf043da370f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided cluster manager. + * + * @summary Delete the provided cluster manager. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Delete.json + */ +async function deleteClusterManager() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.beginDeleteAndWait( + resourceGroupName, + clusterManagerName + ); + console.log(result); +} + +async function main() { + deleteClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersGetSample.ts new file mode 100644 index 000000000000..35d32d932b94 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the properties of the provided cluster manager. + * + * @summary Get the properties of the provided cluster manager. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Get.json + */ +async function getClusterManager() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.get( + resourceGroupName, + clusterManagerName + ); + console.log(result); +} + +async function main() { + getClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListByResourceGroupSample.ts new file mode 100644 index 000000000000..f3b8d7cc2893 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of cluster managers in the provided resource group. + * + * @summary Get a list of cluster managers in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListByResourceGroup.json + */ +async function listClusterManagersForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusterManagers.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClusterManagersForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListBySubscriptionSample.ts new file mode 100644 index 000000000000..da7b7ec0a349 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of cluster managers in the provided subscription. + * + * @summary Get a list of cluster managers in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListBySubscription.json + */ +async function listClusterManagersForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusterManagers.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClusterManagersForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersUpdateSample.ts new file mode 100644 index 000000000000..bda5db4d5c37 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clusterManagersUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterManagerPatchParameters, + ClusterManagersUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently. + * + * @summary Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Patch.json + */ +async function patchClusterManager() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterManagerName = "clusterManagerName"; + const clusterManagerUpdateParameters: ClusterManagerPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: ClusterManagersUpdateOptionalParams = { + clusterManagerUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusterManagers.update( + resourceGroupName, + clusterManagerName, + options + ); + console.log(result); +} + +async function main() { + patchClusterManager(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..8a887b3f5944 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersCreateOrUpdateSample.ts @@ -0,0 +1,148 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Cluster, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new cluster or update the properties of the cluster if it exists. + * + * @summary Create a new cluster or update the properties of the cluster if it exists. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Create.json + */ +async function createOrUpdateCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterParameters: Cluster = { + aggregatorOrSingleRackDefinition: { + bareMetalMachineConfigurationData: [ + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:FF", + bootMacAddress: "00:BB:CC:DD:EE:FF", + machineDetails: "extraDetails", + machineName: "bmmName1", + rackSlot: 1, + serialNumber: "BM1219XXX" + }, + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:00", + bootMacAddress: "00:BB:CC:DD:EE:00", + machineDetails: "extraDetails", + machineName: "bmmName2", + rackSlot: 2, + serialNumber: "BM1219YYY" + } + ], + networkRackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName", + rackLocation: "Foo Datacenter, Floor 3, Aisle 9, Rack 2", + rackSerialNumber: "AA1234", + rackSkuId: + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName", + storageApplianceConfigurationData: [ + { + adminCredentials: { password: "{password}", username: "username" }, + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceName: "vmName" + } + ] + }, + analyticsWorkspaceId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName", + clusterLocation: "Foo Street, 3rd Floor, row 9", + clusterServicePrincipal: { + applicationId: "12345678-1234-1234-1234-123456789012", + password: "{password}", + principalId: "00000008-0004-0004-0004-000000000012", + tenantId: "80000000-4000-4000-4000-120000000000" + }, + clusterType: "SingleRack", + clusterVersion: "1.0.0", + computeDeploymentThreshold: { + type: "PercentSuccess", + grouping: "PerCluster", + value: 90 + }, + computeRackDefinitions: [ + { + bareMetalMachineConfigurationData: [ + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:FF", + bootMacAddress: "00:BB:CC:DD:EE:FF", + machineDetails: "extraDetails", + machineName: "bmmName1", + rackSlot: 1, + serialNumber: "BM1219XXX" + }, + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:00", + bootMacAddress: "00:BB:CC:DD:EE:00", + machineDetails: "extraDetails", + machineName: "bmmName2", + rackSlot: 2, + serialNumber: "BM1219YYY" + } + ], + networkRackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName", + rackLocation: "Foo Datacenter, Floor 3, Aisle 9, Rack 2", + rackSerialNumber: "AA1234", + rackSkuId: + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName", + storageApplianceConfigurationData: [ + { + adminCredentials: { password: "{password}", username: "username" }, + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceName: "vmName" + } + ] + } + ], + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + managedResourceGroupConfiguration: { + name: "my-managed-rg", + location: "East US" + }, + networkFabricId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + clusterParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeleteSample.ts new file mode 100644 index 000000000000..7cac27450065 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided cluster. + * + * @summary Delete the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Delete.json + */ +async function deleteCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginDeleteAndWait( + resourceGroupName, + clusterName + ); + console.log(result); +} + +async function main() { + deleteCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeploySample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeploySample.ts new file mode 100644 index 000000000000..52ce2d98252d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersDeploySample.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterDeployParameters, + ClustersDeployOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deploy the cluster to the provided rack. + * + * @summary Deploy the cluster to the provided rack. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy.json + */ +async function deployCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterDeployParameters: ClusterDeployParameters = {}; + const options: ClustersDeployOptionalParams = { clusterDeployParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginDeployAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +/** + * This sample demonstrates how to Deploy the cluster to the provided rack. + * + * @summary Deploy the cluster to the provided rack. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy_SkipValidation.json + */ +async function deployClusterSkippingValidation() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterDeployParameters: ClusterDeployParameters = { + skipValidationsForMachines: ["bmmName1"] + }; + const options: ClustersDeployOptionalParams = { clusterDeployParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginDeployAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +async function main() { + deployCluster(); + deployClusterSkippingValidation(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersGetSample.ts new file mode 100644 index 000000000000..2a2a80fc9df5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided cluster. + * + * @summary Get properties of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Get.json + */ +async function getCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.get(resourceGroupName, clusterName); + console.log(result); +} + +async function main() { + getCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..cd0fb1922112 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of clusters in the provided resource group. + * + * @summary Get a list of clusters in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListByResourceGroup.json + */ +async function listClustersForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClustersForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListBySubscriptionSample.ts new file mode 100644 index 000000000000..640521d8fbfa --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of clusters in the provided subscription. + * + * @summary Get a list of clusters in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListBySubscription.json + */ +async function listClustersForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.clusters.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listClustersForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateSample.ts new file mode 100644 index 000000000000..fc049b98b1e0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateSample.ts @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterPatchParameters, + ClustersUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * + * @summary Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json + */ +async function patchClusterAggregatorOrSingleRackDefinition() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterUpdateParameters: ClusterPatchParameters = { + aggregatorOrSingleRackDefinition: { + bareMetalMachineConfigurationData: [ + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:FF", + bootMacAddress: "00:BB:CC:DD:EE:FF", + machineDetails: "extraDetails", + machineName: "bmmName1", + rackSlot: 1, + serialNumber: "BM1219XXX" + }, + { + bmcCredentials: { password: "{password}", username: "username" }, + bmcMacAddress: "AA:BB:CC:DD:EE:00", + bootMacAddress: "00:BB:CC:DD:EE:00", + machineDetails: "extraDetails", + machineName: "bmmName2", + rackSlot: 2, + serialNumber: "BM1219YYY" + } + ], + networkRackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName", + rackLocation: "Foo Datacenter, Floor 3, Aisle 9, Rack 2", + rackSerialNumber: "newSerialNumber", + rackSkuId: + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName", + storageApplianceConfigurationData: [ + { + adminCredentials: { password: "{password}", username: "username" }, + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceName: "vmName" + } + ] + }, + computeDeploymentThreshold: { + type: "PercentSuccess", + grouping: "PerCluster", + value: 90 + }, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: ClustersUpdateOptionalParams = { clusterUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginUpdateAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +/** + * This sample demonstrates how to Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * + * @summary Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_Location.json + */ +async function patchClusterLocation() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterUpdateParameters: ClusterPatchParameters = { + clusterLocation: "Foo Street, 3rd Floor, row 9", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: ClustersUpdateOptionalParams = { clusterUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginUpdateAndWait( + resourceGroupName, + clusterName, + options + ); + console.log(result); +} + +async function main() { + patchClusterAggregatorOrSingleRackDefinition(); + patchClusterLocation(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateVersionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateVersionSample.ts new file mode 100644 index 000000000000..74b86c1057a0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/clustersUpdateVersionSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterUpdateVersionParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update the version of the provided cluster to one of the available supported versions. + * + * @summary Update the version of the provided cluster to one of the available supported versions. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_UpdateVersion.json + */ +async function updateClusterVersion() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const clusterUpdateVersionParameters: ClusterUpdateVersionParameters = { + targetClusterVersion: "2.0" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.clusters.beginUpdateVersionAndWait( + resourceGroupName, + clusterName, + clusterUpdateVersionParameters + ); + console.log(result); +} + +async function main() { + updateClusterVersion(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ea9919ac544d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesCreateOrUpdateSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Console, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @summary Create a new virtual machine console or update the properties of the existing virtual machine console. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Create.json + */ +async function createOrUpdateVirtualMachineConsole() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const consoleParameters: Console = { + enabled: "True", + expiration: new Date("2022-06-01T01:27:03.008Z"), + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + }, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.beginCreateOrUpdateAndWait( + resourceGroupName, + virtualMachineName, + consoleName, + consoleParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesDeleteSample.ts new file mode 100644 index 000000000000..22c15c4a8c9d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided virtual machine console. + * + * @summary Delete the provided virtual machine console. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Delete.json + */ +async function deleteVirtualMachineConsole() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.beginDeleteAndWait( + resourceGroupName, + virtualMachineName, + consoleName + ); + console.log(result); +} + +async function main() { + deleteVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesGetSample.ts new file mode 100644 index 000000000000..9e4b242515fc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided virtual machine console. + * + * @summary Get properties of the provided virtual machine console. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Get.json + */ +async function getVirtualMachineConsole() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.get( + resourceGroupName, + virtualMachineName, + consoleName + ); + console.log(result); +} + +async function main() { + getVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesListByResourceGroupSample.ts new file mode 100644 index 000000000000..f4de06a4d4e2 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesListByResourceGroupSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of virtual machine consoles in the provided resource group. + * + * @summary Get a list of virtual machine consoles in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_ListByResourceGroup.json + */ +async function listVirtualMachineConsolesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.consoles.listByResourceGroup( + resourceGroupName, + virtualMachineName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVirtualMachineConsolesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesUpdateSample.ts new file mode 100644 index 000000000000..6ed3af395227 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/consolesUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConsolePatchParameters, + ConsolesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Patch.json + */ +async function patchVirtualMachineConsole() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const consoleName = "default"; + const consoleUpdateParameters: ConsolePatchParameters = { + enabled: "True", + expiration: new Date("2022-06-01T01:27:03.008Z"), + sshPublicKey: { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + }, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: ConsolesUpdateOptionalParams = { consoleUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.consoles.beginUpdateAndWait( + resourceGroupName, + virtualMachineName, + consoleName, + options + ); + console.log(result); +} + +async function main() { + patchVirtualMachineConsole(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..59f909958225 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksCreateOrUpdateSample.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { DefaultCniNetwork, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new default CNI network or update the properties of the existing default CNI network. + * + * @summary Create a new default CNI network or update the properties of the existing default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Create.json + */ +async function createOrUpdateDefaultCniNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const defaultCniNetworkParameters: DefaultCniNetwork = { + cniBgpConfiguration: { + bgpPeers: [{ asNumber: 64497, peerIp: "203.0.113.254" }], + communityAdvertisements: [ + { communities: ["64512:100"], subnetPrefix: "192.0.2.0/27" } + ], + serviceExternalPrefixes: ["192.0.2.0/28"], + serviceLoadBalancerPrefixes: ["192.0.2.16/28"] + }, + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + ipAllocationType: "DualStack", + ipv4ConnectedPrefix: "203.0.113.0/24", + ipv6ConnectedPrefix: "2001:db8:0:3::/64", + l3IsolationDomainId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + vlan: 12 + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.beginCreateOrUpdateAndWait( + resourceGroupName, + defaultCniNetworkName, + defaultCniNetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksDeleteSample.ts new file mode 100644 index 000000000000..d453475c9011 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided default CNI network. + * + * @summary Delete the provided default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Delete.json + */ +async function deleteDefaultCniNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.beginDeleteAndWait( + resourceGroupName, + defaultCniNetworkName + ); + console.log(result); +} + +async function main() { + deleteDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksGetSample.ts new file mode 100644 index 000000000000..31ae97c88f8e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided default CNI network. + * + * @summary Get properties of the provided default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Get.json + */ +async function getDefaultCniNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.get( + resourceGroupName, + defaultCniNetworkName + ); + console.log(result); +} + +async function main() { + getDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..ade795e7cdc1 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of default CNI networks in the provided resource group. + * + * @summary Get a list of default CNI networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListByResourceGroup.json + */ +async function listDefaultCniNetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.defaultCniNetworks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listDefaultCniNetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..b878b94983cf --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of default CNI networks in the provided subscription. + * + * @summary Get a list of default CNI networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListBySubscription.json + */ +async function listDefaultCniNetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.defaultCniNetworks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listDefaultCniNetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksUpdateSample.ts new file mode 100644 index 000000000000..938d9dfafc62 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/defaultCniNetworksUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DefaultCniNetworkPatchParameters, + DefaultCniNetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided default CNI network. + * + * @summary Update tags associated with the provided default CNI network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Patch.json + */ +async function patchDefaultCniNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const defaultCniNetworkName = "defaultCniNetworkName"; + const defaultCniNetworkUpdateParameters: DefaultCniNetworkPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: DefaultCniNetworksUpdateOptionalParams = { + defaultCniNetworkUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.defaultCniNetworks.update( + resourceGroupName, + defaultCniNetworkName, + options + ); + console.log(result); +} + +async function main() { + patchDefaultCniNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f7c28554538b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersCreateOrUpdateSample.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridAksCluster, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Create.json + */ +async function createOrUpdateHybridAksProvisionedClusterData() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const hybridAksClusterParameters: HybridAksCluster = { + associatedNetworkIds: [ + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName" + ], + controlPlaneCount: 4, + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + hybridAksProvisionedClusterId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + workerCount: 8 + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + hybridAksClusterName, + hybridAksClusterParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersDeleteSample.ts new file mode 100644 index 000000000000..b946f6239bba --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Delete.json + */ +async function deleteHybridAksProvisionedClusterData() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.beginDeleteAndWait( + resourceGroupName, + hybridAksClusterName + ); + console.log(result); +} + +async function main() { + deleteHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersGetSample.ts new file mode 100644 index 000000000000..c1ee530d21d5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @summary Get the additional details related to the provided Hybrid AKS provisioned cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Get.json + */ +async function getHybridAksProvisionedClusterData() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.get( + resourceGroupName, + hybridAksClusterName + ); + console.log(result); +} + +async function main() { + getHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..43382219149f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @summary Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListByResourceGroup.json + */ +async function listHybridAksProvisionedClustersDataForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridAksClusters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listHybridAksProvisionedClustersDataForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListBySubscriptionSample.ts new file mode 100644 index 000000000000..b4633672ff2e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @summary Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListBySubscription.json + */ +async function listHybridAksProvisionedClustersDataForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridAksClusters.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listHybridAksProvisionedClustersDataForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersRestartNodeSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersRestartNodeSample.ts new file mode 100644 index 000000000000..f022124b75b0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersRestartNodeSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + HybridAksClusterRestartNodeParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restart a targeted node of a Hybrid AKS cluster. + * + * @summary Restart a targeted node of a Hybrid AKS cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_RestartNode.json + */ +async function restartAHybridAksClusterNode() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const hybridAksClusterRestartNodeParameters: HybridAksClusterRestartNodeParameters = { + nodeName: "nodeName" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.beginRestartNodeAndWait( + resourceGroupName, + hybridAksClusterName, + hybridAksClusterRestartNodeParameters + ); + console.log(result); +} + +async function main() { + restartAHybridAksClusterNode(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersUpdateSample.ts new file mode 100644 index 000000000000..7171934ac698 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/hybridAksClustersUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + HybridAksClusterPatchParameters, + HybridAksClustersUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @summary Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Patch.json + */ +async function patchHybridAksProvisionedClusterData() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const hybridAksClusterName = "hybridAksClusterName"; + const hybridAksClusterUpdateParameters: HybridAksClusterPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: HybridAksClustersUpdateOptionalParams = { + hybridAksClusterUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.hybridAksClusters.update( + resourceGroupName, + hybridAksClusterName, + options + ); + console.log(result); +} + +async function main() { + patchHybridAksProvisionedClusterData(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..868f622c5614 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksCreateOrUpdateSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { L2Network, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @summary Create a new layer 2 (L2) network or update the properties of the existing network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Create.json + */ +async function createOrUpdateL2Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const l2NetworkParameters: L2Network = { + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + hybridAksPluginType: "DPDK", + interfaceName: "eth0", + l2IsolationDomainId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.beginCreateOrUpdateAndWait( + resourceGroupName, + l2NetworkName, + l2NetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksDeleteSample.ts new file mode 100644 index 000000000000..aeab550418b0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided layer 2 (L2) network. + * + * @summary Delete the provided layer 2 (L2) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Delete.json + */ +async function deleteL2Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.beginDeleteAndWait( + resourceGroupName, + l2NetworkName + ); + console.log(result); +} + +async function main() { + deleteL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksGetSample.ts new file mode 100644 index 000000000000..65243d7a24dc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided layer 2 (L2) network. + * + * @summary Get properties of the provided layer 2 (L2) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Get.json + */ +async function getL2Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.get(resourceGroupName, l2NetworkName); + console.log(result); +} + +async function main() { + getL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..7176631e8d8c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of layer 2 (L2) networks in the provided resource group. + * + * @summary Get a list of layer 2 (L2) networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListByResourceGroup.json + */ +async function listL2NetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l2Networks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL2NetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..6b5f23e56e6a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of layer 2 (L2) networks in the provided subscription. + * + * @summary Get a list of layer 2 (L2) networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListBySubscription.json + */ +async function listL2NetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l2Networks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL2NetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksUpdateSample.ts new file mode 100644 index 000000000000..1c479207fddd --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l2NetworksUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + L2NetworkPatchParameters, + L2NetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided layer 2 (L2) network. + * + * @summary Update tags associated with the provided layer 2 (L2) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Patch.json + */ +async function patchL2Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l2NetworkName = "l2NetworkName"; + const l2NetworkUpdateParameters: L2NetworkPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: L2NetworksUpdateOptionalParams = { l2NetworkUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l2Networks.update( + resourceGroupName, + l2NetworkName, + options + ); + console.log(result); +} + +async function main() { + patchL2Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e9c035522882 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksCreateOrUpdateSample.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { L3Network, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @summary Create a new layer 3 (L3) network or update the properties of the existing network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Create.json + */ +async function createOrUpdateL3Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const l3NetworkParameters: L3Network = { + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + hybridAksIpamEnabled: "True", + hybridAksPluginType: "DPDK", + interfaceName: "eth0", + ipAllocationType: "DualStack", + ipv4ConnectedPrefix: "198.51.100.0/24", + ipv6ConnectedPrefix: "2001:db8::/64", + l3IsolationDomainId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName", + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + vlan: 12 + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.beginCreateOrUpdateAndWait( + resourceGroupName, + l3NetworkName, + l3NetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksDeleteSample.ts new file mode 100644 index 000000000000..1b4a804f4e59 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided layer 3 (L3) network. + * + * @summary Delete the provided layer 3 (L3) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Delete.json + */ +async function deleteL3Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.beginDeleteAndWait( + resourceGroupName, + l3NetworkName + ); + console.log(result); +} + +async function main() { + deleteL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksGetSample.ts new file mode 100644 index 000000000000..5f9218c96ee7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided layer 3 (L3) network. + * + * @summary Get properties of the provided layer 3 (L3) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Get.json + */ +async function getL3Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.get(resourceGroupName, l3NetworkName); + console.log(result); +} + +async function main() { + getL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..14e03decf9ed --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of layer 3 (L3) networks in the provided resource group. + * + * @summary Get a list of layer 3 (L3) networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListByResourceGroup.json + */ +async function listL3NetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l3Networks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL3NetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..23f6acf2b665 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of layer 3 (L3) networks in the provided subscription. + * + * @summary Get a list of layer 3 (L3) networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListBySubscription.json + */ +async function listL3NetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.l3Networks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listL3NetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksUpdateSample.ts new file mode 100644 index 000000000000..a7765938cbf7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/l3NetworksUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + L3NetworkPatchParameters, + L3NetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided layer 3 (L3) network. + * + * @summary Update tags associated with the provided layer 3 (L3) network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Patch.json + */ +async function patchL3Network() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const l3NetworkName = "l3NetworkName"; + const l3NetworkUpdateParameters: L3NetworkPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: L3NetworksUpdateOptionalParams = { l3NetworkUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.l3Networks.update( + resourceGroupName, + l3NetworkName, + options + ); + console.log(result); +} + +async function main() { + patchL3Network(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..34fffb603c85 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsCreateOrUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterMetricsConfiguration, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update the metrics configuration of the provided cluster. + * + * @summary Update the metrics configuration of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Update.json + */ +async function updateMetricsConfigurationOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const metricsConfigurationParameters: ClusterMetricsConfiguration = { + collectionInterval: 15, + enabledMetrics: ["metric1", "metric2"], + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.beginCreateOrUpdateAndWait( + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationParameters + ); + console.log(result); +} + +async function main() { + updateMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsDeleteSample.ts new file mode 100644 index 000000000000..2c42e753e258 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the metrics configuration of the provided cluster. + * + * @summary Delete the metrics configuration of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Delete.json + */ +async function deleteMetricsConfigurationOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.beginDeleteAndWait( + resourceGroupName, + clusterName, + metricsConfigurationName + ); + console.log(result); +} + +async function main() { + deleteMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsGetSample.ts new file mode 100644 index 000000000000..84951cfc543a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get metrics configuration of the provided cluster. + * + * @summary Get metrics configuration of the provided cluster. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Get.json + */ +async function getMetricsConfigurationOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.get( + resourceGroupName, + clusterName, + metricsConfigurationName + ); + console.log(result); +} + +async function main() { + getMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsListByResourceGroupSample.ts new file mode 100644 index 000000000000..e7cb9e42535e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsListByResourceGroupSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of metrics configurations of the clusters in the provided resource group. + * + * @summary Get a list of metrics configurations of the clusters in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_ListByResourceGroup.json + */ +async function listMetricsConfigurationsOfClusterForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.metricsConfigurations.listByResourceGroup( + resourceGroupName, + clusterName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listMetricsConfigurationsOfClusterForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsUpdateSample.ts new file mode 100644 index 000000000000..9b73a550f432 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/metricsConfigurationsUpdateSample.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ClusterMetricsConfigurationPatchParameters, + MetricsConfigurationsUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. + * + * @summary Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Patch.json + */ +async function patchMetricsConfigurationOfCluster() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const clusterName = "clusterName"; + const metricsConfigurationName = "default"; + const metricsConfigurationUpdateParameters: ClusterMetricsConfigurationPatchParameters = { + collectionInterval: 15, + enabledMetrics: ["metric1", "metric2"], + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: MetricsConfigurationsUpdateOptionalParams = { + metricsConfigurationUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.metricsConfigurations.beginUpdateAndWait( + resourceGroupName, + clusterName, + metricsConfigurationName, + options + ); + console.log(result); +} + +async function main() { + patchMetricsConfigurationOfCluster(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..f2487d6bcaa1 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/operationsListSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * + * @summary Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Operations_List.json + */ +async function listResourceProviderOperations() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listResourceProviderOperations(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusGetSample.ts new file mode 100644 index 000000000000..fd9027a6a838 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the properties of the provided rack SKU. + * + * @summary Get the properties of the provided rack SKU. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_Get.json + */ +async function getRackSkuResource() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const rackSkuName = "rackSkuName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.rackSkus.get(rackSkuName); + console.log(result); +} + +async function main() { + getRackSkuResource(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusListBySubscriptionSample.ts new file mode 100644 index 000000000000..8a16c35bc073 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/rackSkusListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of rack SKUs in the provided subscription. + * + * @summary Get a list of rack SKUs in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_ListBySubscription.json + */ +async function listRackSkUsForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.rackSkus.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listRackSkUsForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7f61d2fbd0dd --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksCreateOrUpdateSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Rack, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Create.json + */ +async function createOrUpdateRack() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const rackParameters: Rack = { + availabilityZone: "1", + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + rackLocation: "Rack 28", + rackSerialNumber: "RACK_SERIAL_NUMBER", + rackSkuId: "RACK-TYPE-1", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.beginCreateOrUpdateAndWait( + resourceGroupName, + rackName, + rackParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksDeleteSample.ts new file mode 100644 index 000000000000..4fa8970cdc7d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided rack. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @summary Delete the provided rack. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Delete.json + */ +async function deleteRack() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.beginDeleteAndWait( + resourceGroupName, + rackName + ); + console.log(result); +} + +async function main() { + deleteRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksGetSample.ts new file mode 100644 index 000000000000..a99825f3146d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided rack. + * + * @summary Get properties of the provided rack. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Get.json + */ +async function getRack() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.get(resourceGroupName, rackName); + console.log(result); +} + +async function main() { + getRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListByResourceGroupSample.ts new file mode 100644 index 000000000000..8356f212ce21 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListByResourceGroupSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of racks in the provided resource group. + * + * @summary Get a list of racks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListByResourceGroup.json + */ +async function listRacksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.racks.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listRacksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListBySubscriptionSample.ts new file mode 100644 index 000000000000..d55a5cda9dc9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of racks in the provided subscription. + * + * @summary Get a list of racks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListBySubscription.json + */ +async function listRacksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.racks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listRacksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksUpdateSample.ts new file mode 100644 index 000000000000..ad4b90978e9a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/racksUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RackPatchParameters, + RacksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently. + * + * @summary Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Patch.json + */ +async function patchRack() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const rackName = "rackName"; + const rackUpdateParameters: RackPatchParameters = { + rackLocation: "Rack 2B", + rackSerialNumber: "RACK_SERIAL_NUMBER", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: RacksUpdateOptionalParams = { rackUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.racks.beginUpdateAndWait( + resourceGroupName, + rackName, + options + ); + console.log(result); +} + +async function main() { + patchRack(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..71d9b1b7e132 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesCreateOrUpdateSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { StorageAppliance, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Create.json + */ +async function createOrUpdateStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceParameters: StorageAppliance = { + administratorCredentials: { password: "{password}", username: "adminUser" }, + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + rackId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName", + rackSlot: 1, + serialNumber: "BM1219XXX", + storageApplianceSkuId: "684E-3B16-399E", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginCreateOrUpdateAndWait( + resourceGroupName, + storageApplianceName, + storageApplianceParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDeleteSample.ts new file mode 100644 index 000000000000..03f31a889cf8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDeleteSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided storage appliance. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @summary Delete the provided storage appliance. +All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Delete.json + */ +async function deleteStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginDeleteAndWait( + resourceGroupName, + storageApplianceName + ); + console.log(result); +} + +async function main() { + deleteStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDisableRemoteVendorManagementSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDisableRemoteVendorManagementSample.ts new file mode 100644 index 000000000000..7c75be1eabd6 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesDisableRemoteVendorManagementSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Disable remote vendor management of the provided storage appliance. + * + * @summary Disable remote vendor management of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_DisableRemoteVendorManagement.json + */ +async function turnOffRemoteVendorManagementForStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginDisableRemoteVendorManagementAndWait( + resourceGroupName, + storageApplianceName + ); + console.log(result); +} + +async function main() { + turnOffRemoteVendorManagementForStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesEnableRemoteVendorManagementSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesEnableRemoteVendorManagementSample.ts new file mode 100644 index 000000000000..7d6502a4eb4c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesEnableRemoteVendorManagementSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageApplianceEnableRemoteVendorManagementParameters, + StorageAppliancesEnableRemoteVendorManagementOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Enable remote vendor management of the provided storage appliance. + * + * @summary Enable remote vendor management of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_EnableRemoteVendorManagement.json + */ +async function turnOnRemoteVendorManagementForStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceEnableRemoteVendorManagementParameters: StorageApplianceEnableRemoteVendorManagementParameters = { + supportEndpoints: ["10.0.0.0/24"] + }; + const options: StorageAppliancesEnableRemoteVendorManagementOptionalParams = { + storageApplianceEnableRemoteVendorManagementParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginEnableRemoteVendorManagementAndWait( + resourceGroupName, + storageApplianceName, + options + ); + console.log(result); +} + +async function main() { + turnOnRemoteVendorManagementForStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesGetSample.ts new file mode 100644 index 000000000000..211fd65deef5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided storage appliance. + * + * @summary Get properties of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Get.json + */ +async function getStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.get( + resourceGroupName, + storageApplianceName + ); + console.log(result); +} + +async function main() { + getStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListByResourceGroupSample.ts new file mode 100644 index 000000000000..98e90b049759 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of storage appliances in the provided resource group. + * + * @summary Get a list of storage appliances in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListByResourceGroup.json + */ +async function listStorageAppliancesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAppliances.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listStorageAppliancesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListBySubscriptionSample.ts new file mode 100644 index 000000000000..e8d47f90dec4 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of storage appliances in the provided subscription. + * + * @summary Get a list of storage appliances in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListBySubscription.json + */ +async function listStorageAppliancesForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageAppliances.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listStorageAppliancesForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesRunReadCommandsSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesRunReadCommandsSample.ts new file mode 100644 index 000000000000..cdce95fe1b07 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesRunReadCommandsSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageApplianceRunReadCommandsParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Run and retrieve output from read only commands on the provided storage appliance. + * + * @summary Run and retrieve output from read only commands on the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_RunReadCommands.json + */ +async function runAndRetrieveOutputFromReadOnlyCommandsOnStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceRunReadCommandsParameters: StorageApplianceRunReadCommandsParameters = { + limitTimeSeconds: 60, + commands: [{ command: "AlertList" }] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginRunReadCommandsAndWait( + resourceGroupName, + storageApplianceName, + storageApplianceRunReadCommandsParameters + ); + console.log(result); +} + +async function main() { + runAndRetrieveOutputFromReadOnlyCommandsOnStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesUpdateSample.ts new file mode 100644 index 000000000000..0d8591fc7da0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesUpdateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageAppliancePatchParameters, + StorageAppliancesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Patch.json + */ +async function patchStorageAppliance() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceUpdateParameters: StorageAppliancePatchParameters = { + serialNumber: "BM1219XXX", + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: StorageAppliancesUpdateOptionalParams = { + storageApplianceUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginUpdateAndWait( + resourceGroupName, + storageApplianceName, + options + ); + console.log(result); +} + +async function main() { + patchStorageAppliance(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesValidateHardwareSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesValidateHardwareSample.ts new file mode 100644 index 000000000000..62dc4119a5df --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/storageAppliancesValidateHardwareSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageApplianceValidateHardwareParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validate the hardware of the provided storage appliance. + * + * @summary Validate the hardware of the provided storage appliance. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ValidateHardware.json + */ +async function validateTheStorageApplianceHardware() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const storageApplianceName = "storageApplianceName"; + const storageApplianceValidateHardwareParameters: StorageApplianceValidateHardwareParameters = { + validationCategory: "BasicValidation" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.storageAppliances.beginValidateHardwareAndWait( + resourceGroupName, + storageApplianceName, + storageApplianceValidateHardwareParameters + ); + console.log(result); +} + +async function main() { + validateTheStorageApplianceHardware(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..428150f74d1e --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksCreateOrUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { TrunkedNetwork, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new trunked network or update the properties of the existing trunked network. + * + * @summary Create a new trunked network or update the properties of the existing trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Create.json + */ +async function createOrUpdateTrunkedNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const trunkedNetworkParameters: TrunkedNetwork = { + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + hybridAksPluginType: "DPDK", + interfaceName: "eth0", + isolationDomainIds: [ + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName" + ], + location: "location", + tags: { key1: "myvalue1", key2: "myvalue2" }, + vlans: [12, 14] + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.beginCreateOrUpdateAndWait( + resourceGroupName, + trunkedNetworkName, + trunkedNetworkParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksDeleteSample.ts new file mode 100644 index 000000000000..81b93471dddc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided trunked network. + * + * @summary Delete the provided trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Delete.json + */ +async function deleteTrunkedNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.beginDeleteAndWait( + resourceGroupName, + trunkedNetworkName + ); + console.log(result); +} + +async function main() { + deleteTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksGetSample.ts new file mode 100644 index 000000000000..e4fd1bb18d0a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided trunked network. + * + * @summary Get properties of the provided trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Get.json + */ +async function getTrunkedNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.get( + resourceGroupName, + trunkedNetworkName + ); + console.log(result); +} + +async function main() { + getTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..2a9f62e3f9e7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of trunked networks in the provided resource group. + * + * @summary Get a list of trunked networks in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListByResourceGroup.json + */ +async function listTrunkedNetworksForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.trunkedNetworks.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listTrunkedNetworksForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..c160313b62c2 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of trunked networks in the provided subscription. + * + * @summary Get a list of trunked networks in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListBySubscription.json + */ +async function listTrunkedNetworksForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.trunkedNetworks.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listTrunkedNetworksForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksUpdateSample.ts new file mode 100644 index 000000000000..0bfeba084f82 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/trunkedNetworksUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TrunkedNetworkPatchParameters, + TrunkedNetworksUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided trunked network. + * + * @summary Update tags associated with the provided trunked network. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Patch.json + */ +async function patchTrunkedNetwork() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const trunkedNetworkName = "trunkedNetworkName"; + const trunkedNetworkUpdateParameters: TrunkedNetworkPatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: TrunkedNetworksUpdateOptionalParams = { + trunkedNetworkUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.trunkedNetworks.update( + resourceGroupName, + trunkedNetworkName, + options + ); + console.log(result); +} + +async function main() { + patchTrunkedNetwork(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesAttachVolumeSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesAttachVolumeSample.ts new file mode 100644 index 000000000000..5a2f0de88211 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesAttachVolumeSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineVolumeParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Attach volume to the provided virtual machine. + * + * @summary Attach volume to the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_AttachVolume.json + */ +async function attachVolumeToVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineAttachVolumeParameters: VirtualMachineVolumeParameters = { + volumeId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginAttachVolumeAndWait( + resourceGroupName, + virtualMachineName, + virtualMachineAttachVolumeParameters + ); + console.log(result); +} + +async function main() { + attachVolumeToVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4c3a0e711102 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesCreateOrUpdateSample.ts @@ -0,0 +1,106 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { VirtualMachine, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new virtual machine or update the properties of the existing virtual machine. + * + * @summary Create a new virtual machine or update the properties of the existing virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Create.json + */ +async function createOrUpdateVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineParameters: VirtualMachine = { + adminUsername: "username", + bootMethod: "UEFI", + cloudServicesNetworkAttachment: { + attachedNetworkId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName", + ipAllocationMethod: "Dynamic" + }, + cpuCores: 2, + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + memorySizeGB: 8, + networkAttachments: [ + { + attachedNetworkId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName", + defaultGateway: "True", + ipAllocationMethod: "Dynamic", + ipv4Address: "198.51.100.1", + ipv6Address: "2001:0db8:0000:0000:0000:0000:0000:0000", + networkAttachmentName: "netAttachName01" + } + ], + networkData: "bmV0d29ya0RhdGVTYW1wbGU=", + placementHints: [ + { + hintType: "Affinity", + resourceId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName", + schedulingExecution: "Hard", + scope: "" + } + ], + sshPublicKeys: [ + { + keyData: + "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm" + } + ], + storageProfile: { + osDisk: { + createOption: "Ephemeral", + deleteOption: "Delete", + diskSizeGB: 120 + }, + volumeAttachments: [ + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName" + ] + }, + tags: { key1: "myvalue1", key2: "myvalue2" }, + userData: "dXNlckRhdGVTYW1wbGU=", + vmDeviceModel: "T2", + vmImage: "myacr.azurecr.io/foobar:latest", + vmImageRepositoryCredentials: { + password: "{password}", + registryUrl: "myacr.azurecr.io", + username: "myuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginCreateOrUpdateAndWait( + resourceGroupName, + virtualMachineName, + virtualMachineParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDeleteSample.ts new file mode 100644 index 000000000000..1fee1584a2f4 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided virtual machine. + * + * @summary Delete the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Delete.json + */ +async function deleteVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginDeleteAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + deleteVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDetachVolumeSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDetachVolumeSample.ts new file mode 100644 index 000000000000..ec9aa0c71bbd --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesDetachVolumeSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachineVolumeParameters, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Detach volume from the provided virtual machine. + * + * @summary Detach volume from the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_DetachVolume.json + */ +async function detachVolumeFromVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineDetachVolumeParameters: VirtualMachineVolumeParameters = { + volumeId: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName" + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginDetachVolumeAndWait( + resourceGroupName, + virtualMachineName, + virtualMachineDetachVolumeParameters + ); + console.log(result); +} + +async function main() { + detachVolumeFromVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesGetSample.ts new file mode 100644 index 000000000000..03bb08fecb05 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided virtual machine. + * + * @summary Get properties of the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Get.json + */ +async function getVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.get( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + getVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListByResourceGroupSample.ts new file mode 100644 index 000000000000..d9106c5bf6fa --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of virtual machines in the provided resource group. + * + * @summary Get a list of virtual machines in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListByResourceGroup.json + */ +async function listVirtualMachinesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVirtualMachinesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListBySubscriptionSample.ts new file mode 100644 index 000000000000..167c1858a550 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of virtual machines in the provided subscription. + * + * @summary Get a list of virtual machines in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListBySubscription.json + */ +async function listVirtualMachinesForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualMachines.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVirtualMachinesForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesPowerOffSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesPowerOffSample.ts new file mode 100644 index 000000000000..a9e8eac857a8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesPowerOffSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachinePowerOffParameters, + VirtualMachinesPowerOffOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Power off the provided virtual machine. + * + * @summary Power off the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_PowerOff.json + */ +async function powerOffVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachinePowerOffParameters: VirtualMachinePowerOffParameters = { + skipShutdown: "True" + }; + const options: VirtualMachinesPowerOffOptionalParams = { + virtualMachinePowerOffParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginPowerOffAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +async function main() { + powerOffVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesReimageSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesReimageSample.ts new file mode 100644 index 000000000000..36d10e47c01c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesReimageSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Reimage the provided virtual machine. + * + * @summary Reimage the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Reimage.json + */ +async function reimageVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginReimageAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + reimageVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesRestartSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesRestartSample.ts new file mode 100644 index 000000000000..73b006e7b6c9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesRestartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Restart the provided virtual machine. + * + * @summary Restart the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Restart.json + */ +async function restartVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginRestartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + restartVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesStartSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesStartSample.ts new file mode 100644 index 000000000000..ded904978d26 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesStartSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Start the provided virtual machine. + * + * @summary Start the provided virtual machine. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Start.json + */ +async function startVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginStartAndWait( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +async function main() { + startVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesUpdateSample.ts new file mode 100644 index 000000000000..3d62e929d404 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/virtualMachinesUpdateSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualMachinePatchParameters, + VirtualMachinesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to 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. + * + * @summary 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. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Patch.json + */ +async function patchVirtualMachine() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const virtualMachineName = "virtualMachineName"; + const virtualMachineUpdateParameters: VirtualMachinePatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" }, + vmImageRepositoryCredentials: { + password: "{password}", + registryUrl: "myacr.azurecr.io", + username: "myuser" + } + }; + const options: VirtualMachinesUpdateOptionalParams = { + virtualMachineUpdateParameters + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.virtualMachines.beginUpdateAndWait( + resourceGroupName, + virtualMachineName, + options + ); + console.log(result); +} + +async function main() { + patchVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesCreateOrUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..587708e7ed9b --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesCreateOrUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Volume, NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create a new volume or update the properties of the existing one. + * + * @summary Create a new volume or update the properties of the existing one. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Create.json + */ +async function createOrUpdateVolume() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const volumeParameters: Volume = { + extendedLocation: { + name: + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + type: "CustomLocation" + }, + location: "location", + sizeMiB: 10000, + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.beginCreateOrUpdateAndWait( + resourceGroupName, + volumeName, + volumeParameters + ); + console.log(result); +} + +async function main() { + createOrUpdateVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesDeleteSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesDeleteSample.ts new file mode 100644 index 000000000000..4fbfe199dc86 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Delete the provided volume. + * + * @summary Delete the provided volume. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Delete.json + */ +async function deleteVolume() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.beginDeleteAndWait( + resourceGroupName, + volumeName + ); + console.log(result); +} + +async function main() { + deleteVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesGetSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesGetSample.ts new file mode 100644 index 000000000000..56e8eff0c6bf --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get properties of the provided volume. + * + * @summary Get properties of the provided volume. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Get.json + */ +async function getVolume() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.get(resourceGroupName, volumeName); + console.log(result); +} + +async function main() { + getVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListByResourceGroupSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListByResourceGroupSample.ts new file mode 100644 index 000000000000..15b04dab2d33 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListByResourceGroupSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of volumes in the provided resource group. + * + * @summary Get a list of volumes in the provided resource group. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListByResourceGroup.json + */ +async function listVolumesForResourceGroup() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVolumesForResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListBySubscriptionSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListBySubscriptionSample.ts new file mode 100644 index 000000000000..1e85a8afa4e4 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesListBySubscriptionSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { NetworkCloud } from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a list of volumes in the provided subscription. + * + * @summary Get a list of volumes in the provided subscription. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListBySubscription.json + */ +async function listVolumeForSubscription() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.volumes.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listVolumeForSubscription(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesUpdateSample.ts b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesUpdateSample.ts new file mode 100644 index 000000000000..5794b0ce9a29 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/src/volumesUpdateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VolumePatchParameters, + VolumesUpdateOptionalParams, + NetworkCloud +} from "@azure/arm-networkcloud"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update tags associated with the provided volume. + * + * @summary Update tags associated with the provided volume. + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Patch.json + */ +async function patchVolume() { + const subscriptionId = + process.env["NETWORKCLOUD_SUBSCRIPTION_ID"] || "subscriptionId"; + const resourceGroupName = + process.env["NETWORKCLOUD_RESOURCE_GROUP"] || "resourceGroupName"; + const volumeName = "volumeName"; + const volumeUpdateParameters: VolumePatchParameters = { + tags: { key1: "myvalue1", key2: "myvalue2" } + }; + const options: VolumesUpdateOptionalParams = { volumeUpdateParameters }; + const credential = new DefaultAzureCredential(); + const client = new NetworkCloud(credential, subscriptionId); + const result = await client.volumes.update( + resourceGroupName, + volumeName, + options + ); + console.log(result); +} + +async function main() { + patchVolume(); +} + +main().catch(console.error); diff --git a/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/tsconfig.json b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..e26ce2a6d8f7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/samples/v1-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/networkcloud/arm-networkcloud/src/index.ts b/sdk/networkcloud/arm-networkcloud/src/index.ts new file mode 100644 index 000000000000..82fd030bde49 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export { getContinuationToken } from "./pagingHelper"; +export * from "./models"; +export { NetworkCloud } from "./networkCloud"; +export * from "./operationsInterfaces"; diff --git a/sdk/networkcloud/arm-networkcloud/src/lroImpl.ts b/sdk/networkcloud/arm-networkcloud/src/lroImpl.ts new file mode 100644 index 000000000000..dd803cd5e28c --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/models/index.ts b/sdk/networkcloud/arm-networkcloud/src/models/index.ts new file mode 100644 index 000000000000..ec3a1bca04c9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/models/index.ts @@ -0,0 +1,5821 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** BareMetalMachineList represents a list of bare metal machines. */ +export interface BareMetalMachineList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of bare metal machines. */ + value?: BareMetalMachine[]; +} + +/** ExtendedLocation represents the Azure custom location where the resource will be created. */ +export interface ExtendedLocation { + /** The resource ID of the extended location on which the resource will be created. */ + name: string; + /** The extended location type, for example, CustomLocation. */ + type: string; +} + +/** AdministrativeCredentials represents the admin credentials for the device requiring password-based authentication. */ +export interface AdministrativeCredentials { + /** The password of the administrator of the device used during initialization. */ + password: string; + /** The username of the administrator of the device used during initialization. */ + username: string; +} + +/** 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. */ +export interface HardwareInventory { + /** + * Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware and configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalHostInformation?: string; + /** + * The list of network interfaces and associated details for the bare metal machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly interfaces?: HardwareInventoryNetworkInterface[]; + /** + * Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for the bare metal machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nics?: Nic[]; +} + +/** HardwareInventoryNetworkInterface represents the network interface details as part of a hardware inventory. */ +export interface HardwareInventoryNetworkInterface { + /** + * The current status of the link. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly linkStatus?: string; + /** + * The MAC address associated with this interface. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly macAddress?: string; + /** + * The name of the interface. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The resource ID of the network interface for the port on the switch that this machine's interface is connected to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkInterfaceId?: string; +} + +/** Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. */ +export interface Nic { + /** + * The information about the device connected to this NIC. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lldpNeighbor?: LldpNeighbor; + /** + * The MAC address associated with this NIC. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly macAddress?: string; + /** + * The name of the NIC/interface. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; +} + +/** Type Deprecated. Will be removed in an upcoming version. LldpNeighbor represents the details about the device connected to the NIC. */ +export interface LldpNeighbor { + /** + * The descriptive information about the port on the connected device. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly portDescription?: string; + /** + * The system-assigned name of the port on the connected device. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly portName?: string; + /** + * The descriptive information about the connected device. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemDescription?: string; + /** + * The system-assigned name of the connected device. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemName?: string; +} + +/** HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. */ +export interface HardwareValidationStatus { + /** + * The timestamp of the hardware validation execution. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastValidationTime?: Date; + /** + * The outcome of the hardware validation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly result?: BareMetalMachineHardwareValidationResult; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** CloudServicesNetworkList represents a list of cloud services networks. */ +export interface CloudServicesNetworkList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of cloud services networks. */ + value?: CloudServicesNetwork[]; +} + +/** EgressEndpoint represents the connection from a cloud services network to the specified endpoint for a common purpose. */ +export interface 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'. */ + category: string; + /** The list of endpoint dependencies. */ + endpoints: EndpointDependency[]; +} + +/** EndpointDependency represents the definition of an endpoint, including the domain and details. */ +export interface EndpointDependency { + /** The domain name of the dependency. */ + domainName: string; + /** The port of this endpoint. */ + port?: number; +} + +/** ClusterManagerList represents a list of cluster manager objects. */ +export interface ClusterManagerList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of cluster managers. */ + value?: ClusterManager[]; +} + +/** ClusterAvailableVersion represents the cluster version that the cluster manager can be asked to create and manage. */ +export interface ClusterAvailableVersion { + /** + * The last date the version of the platform is supported. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly supportExpiryDate?: string; + /** + * The version of the cluster to be deployed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetClusterVersion?: string; +} + +/** ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. */ +export interface ManagedResourceGroupConfiguration { + /** The location of the managed resource group. If not specified, the location of the parent resource is chosen. */ + location?: string; + /** The name for the managed resource group. If not specified, the unique name is automatically generated. */ + name?: string; +} + +/** ClusterList represents a list of clusters. */ +export interface ClusterList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of clusters. */ + value?: Cluster[]; +} + +/** RackDefinition represents details regarding the rack. */ +export interface RackDefinition { + /** The zone name used for this rack when created. */ + availabilityZone?: string; + /** The unordered list of bare metal machine configuration. */ + bareMetalMachineConfigurationData?: BareMetalMachineConfigurationData[]; + /** The resource ID of the network rack that matches this rack definition. */ + networkRackId: string; + /** The free-form description of the rack's location. */ + rackLocation?: string; + /** 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. */ + rackSerialNumber: string; + /** The resource ID of the sku for the rack being added. */ + rackSkuId: string; + /** The list of storage appliance configuration data for this rack. */ + storageApplianceConfigurationData?: StorageApplianceConfigurationData[]; +} + +/** BareMetalMachineConfigurationData represents configuration for the bare metal machine. */ +export interface BareMetalMachineConfigurationData { + /** + * The connection string for the baseboard management controller including IP address and protocol. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly bmcConnectionString?: string; + /** The credentials of the baseboard management controller on this bare metal machine. */ + bmcCredentials: AdministrativeCredentials; + /** The MAC address of the BMC for this machine. */ + bmcMacAddress: string; + /** The MAC address associated with the PXE NIC card. */ + bootMacAddress: string; + /** The free-form additional information about the machine, e.g. an asset tag. */ + machineDetails?: string; + /** + * The user-provided name for the bare metal machine created from this specification. + * If not provided, the machine name will be generated programmatically. + */ + machineName?: string; + /** The slot the physical machine is in the rack based on the BOM configuration. */ + rackSlot: number; + /** The serial number of the machine. Hardware suppliers may use an alternate value. For example, service tag. */ + serialNumber: string; +} + +/** StorageApplianceConfigurationData represents configuration for the storage application. */ +export interface StorageApplianceConfigurationData { + /** The credentials of the administrative interface on this storage appliance. */ + adminCredentials: AdministrativeCredentials; + /** The slot that storage appliance is in the rack based on the BOM configuration. */ + rackSlot: number; + /** The serial number of the appliance. */ + serialNumber: string; + /** The user-provided name for the storage appliance that will be created from this specification. */ + storageApplianceName?: string; +} + +/** ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. */ +export interface ClusterAvailableUpgradeVersion { + /** + * The indicator of whether the control plane will be impacted during the upgrade. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly controlImpact?: ControlImpact; + /** + * The expected duration needed for this upgrade. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expectedDuration?: string; + /** + * The impact description including the specific details and release notes. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly impactDescription?: string; + /** + * The last date the version of the platform is supported. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly supportExpiryDate?: string; + /** + * The target version this cluster will be upgraded to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetClusterVersion?: string; + /** + * The indicator of whether the workload will be impacted during the upgrade. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly workloadImpact?: WorkloadImpact; +} + +/** ClusterCapacity represents various details regarding compute capacity. */ +export interface ClusterCapacity { + /** The remaining appliance-based storage in GB available for workload use. */ + availableApplianceStorageGB?: number; + /** The remaining number of cores that are available in this cluster for workload use. */ + availableCoreCount?: number; + /** The remaining machine or host-based storage in GB available for workload use. */ + availableHostStorageGB?: number; + /** The remaining memory in GB that are available in this cluster for workload use. */ + availableMemoryGB?: number; + /** The total appliance-based storage in GB supported by this cluster for workload use. */ + totalApplianceStorageGB?: number; + /** The total number of cores that are supported by this cluster for workload use. */ + totalCoreCount?: number; + /** The total machine or host-based storage in GB supported by this cluster for workload use. */ + totalHostStorageGB?: number; + /** The total memory supported by this cluster for workload use. */ + totalMemoryGB?: number; +} + +/** ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc Appliance installation. */ +export interface ServicePrincipalInformation { + /** The application ID, also known as client ID, of the service principal. */ + applicationId: string; + /** The password of the service principal. */ + password: string; + /** The principal ID, also known as the object ID, of the service principal. */ + principalId: string; + /** The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. */ + tenantId: string; +} + +/** ValidationThreshold indicates allowed machine and node hardware and deployment failures. */ +export interface ValidationThreshold { + /** Selection of how the type evaluation is applied to the cluster calculation. */ + grouping: ValidationThresholdGrouping; + /** Selection of how the threshold should be evaluated. */ + type: ValidationThresholdType; + /** The numeric threshold value. */ + value: number; +} + +/** DefaultCniNetworkList represents a list of default CNI networks. */ +export interface DefaultCniNetworkList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of default CNI networks. */ + value?: DefaultCniNetwork[]; +} + +/** CniBgpConfiguration represents the Calico BGP configuration. */ +export interface 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. */ + bgpPeers?: BgpPeer[]; + /** + * 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. + */ + communityAdvertisements?: CommunityAdvertisement[]; + /** The password of the Calico node mesh. It defaults to a randomly-generated string when not provided. */ + nodeMeshPassword?: string; + /** The subnet blocks in CIDR format for Kubernetes service external IPs to be advertised over BGP. */ + serviceExternalPrefixes?: string[]; + /** + * 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. + */ + serviceLoadBalancerPrefixes?: string[]; +} + +/** BgpPeer represents the IP address and ASN(Autonomous System Number) to peer with Hybrid AKS cluster. */ +export interface BgpPeer { + /** The ASN (Autonomous System Number) of the BGP peer. */ + asNumber: number; + /** The password for this peering neighbor. It defaults to no password if not specified. */ + password?: string; + /** 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. */ + peerIp: string; +} + +/** CommunityAdvertisement represents the prefix and the communities that should be associated with that prefix. */ +export interface CommunityAdvertisement { + /** The list of community strings to announce with this prefix. */ + communities: string[]; + /** The subnet in CIDR format for which properties should be advertised. */ + subnetPrefix: string; +} + +/** HybridAksClusterList represents a list of Hybrid AKS clusters. */ +export interface HybridAksClusterList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of additional details related to Hybrid AKS clusters. */ + value?: HybridAksCluster[]; +} + +/** NodeConfiguration contains configuration for a VM associated with a node. */ +export interface NodeConfiguration { + /** + * The resource ID of the agent pool that contains the nodes in this configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly agentPoolId?: string; + /** + * The name of the agent pool that contains the nodes in this configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly agentPoolName?: string; + /** + * The number of CPU cores in the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cpuCores?: number; + /** + * The root disk size of the virtual machine in GB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diskSizeGB?: number; + /** + * The memory size of the virtual machine in GB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memorySizeGB?: number; + /** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nodePoolName?: string; + /** + * The list of nodes that utilize this configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nodes?: Node[]; + /** + * The number of virtual machines that use this configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vmCount?: number; + /** + * The name of the VM size supplied during the creation of the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vmSize?: string; +} + +/** Node denotes the list of node that utilizes configuration. */ +export interface Node { + /** + * The resource ID of the bare metal machine that hosts this node. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly bareMetalMachineId?: string; + /** + * The machine image last used to deploy this node. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly imageId?: string; + /** + * The list of network attachments to the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkAttachments?: NetworkAttachment[]; + /** + * The name of this node, as realized in the Hybrid AKS cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nodeName?: string; + /** + * The power state (On | Off) of the node. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly powerState?: HybridAksClusterMachinePowerState; +} + +/** NetworkAttachment represents the single network attachment. */ +export interface NetworkAttachment { + /** + * The resource ID of the associated network attached to the virtual machine. + * It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + */ + attachedNetworkId: string; + /** + * 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. + */ + 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. + */ + ipAllocationMethod: VirtualMachineIPAllocationMethod; + /** + * 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. + */ + ipv4Address?: string; + /** + * 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. + */ + ipv6Address?: string; + /** + * The MAC address of the interface for the virtual machine that corresponds to this network attachment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly macAddress?: string; + /** + * 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. + */ + networkAttachmentName?: string; +} + +/** L2NetworkList represents a list of L2 networks. */ +export interface L2NetworkList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of L2 networks. */ + value?: L2Network[]; +} + +/** L3NetworkList represents a list of L3 networks. */ +export interface L3NetworkList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of L3 networks. */ + value?: L3Network[]; +} + +/** RackSkuList represents a list of rack SKUs. */ +export interface RackSkuList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of Rack SKUs. */ + value?: RackSku[]; +} + +/** MachineSkuSlot represents a single SKU and rack slot associated with the machine. */ +export interface MachineSkuSlot { + /** + * The position in the rack for the machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly rackSlot?: number; + /** + * The type of bootstrap protocol used. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly bootstrapProtocol?: BootstrapProtocol; + /** + * The count of CPU cores for this machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cpuCores?: number; + /** + * The count of CPU sockets for this machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cpuSockets?: number; + /** + * The list of disks. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly disks?: MachineDisk[]; + /** + * The generation of the architecture. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly generation?: string; + /** + * The hardware version of the machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hardwareVersion?: string; + /** + * The maximum amount of memory in GB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly memoryCapacityGB?: number; + /** + * The model of the machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly model?: string; + /** + * The list of network interfaces. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkInterfaces?: NetworkInterface[]; + /** + * The count of SMT and physical core threads for this machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalThreads?: number; + /** + * The make of the machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vendor?: string; +} + +/** Disk represents the properties of the disk. */ +export interface MachineDisk { + /** + * The maximum amount of storage in GB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capacityGB?: number; + /** + * The connection type of the rack SKU resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly connection?: MachineSkuDiskConnectionType; + /** + * The disk type of rack SKU resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: DiskType; +} + +/** NetworkInterface represents properties of the network interface. */ +export interface NetworkInterface { + /** + * The partial address of Peripheral Component Interconnect (PCI). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly address?: string; + /** + * The connection type of the device. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deviceConnectionType?: DeviceConnectionType; + /** + * The model name of the device. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly model?: string; + /** + * The physical slot for this device. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly physicalSlot?: number; + /** + * The number of ports on the device. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly portCount?: number; + /** + * The maximum amount of data in GB that the line card transmits through a port at any given second. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly portSpeed?: number; + /** + * The vendor name of the device. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vendor?: string; +} + +/** StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. */ +export interface StorageApplianceSkuSlot { + /** + * The position in the rack for the storage appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly rackSlot?: number; + /** + * The maximum capacity of the storage appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capacityGB?: number; + /** + * The model of the storage appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly model?: string; +} + +/** RackList represents a list of racks. */ +export interface RackList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of racks. */ + value?: Rack[]; +} + +/** StorageApplianceList represents a list of storage appliances. */ +export interface StorageApplianceList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of storage appliances. */ + value?: StorageAppliance[]; +} + +/** TrunkedNetworkList represents a list of trunked networks. */ +export interface TrunkedNetworkList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of trunked networks. */ + value?: TrunkedNetwork[]; +} + +/** VirtualMachineList represents a list of virtual machines. */ +export interface VirtualMachineList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of virtual machines. */ + value?: VirtualMachine[]; +} + +/** VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. */ +export interface VirtualMachinePlacementHint { + /** The specification of whether this hint supports affinity or anti-affinity with the referenced resources. */ + hintType: VirtualMachinePlacementHintType; + /** 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. */ + resourceId: string; + /** The indicator of whether the hint is a hard or soft requirement during scheduling. */ + schedulingExecution: VirtualMachineSchedulingExecution; + /** The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case of node affinity. */ + scope: VirtualMachinePlacementHintPodAffinityScope; +} + +/** SshPublicKey represents the public key used to authenticate with the virtual machine through SSH. */ +export interface SshPublicKey { + /** The public ssh key of the user. */ + keyData: string; +} + +/** StorageProfile represents information about a disk. */ +export interface StorageProfile { + /** The disk to use with this virtual machine. */ + osDisk: OsDisk; + /** The resource IDs of volumes that are requested to be attached to the virtual machine. */ + volumeAttachments?: string[]; +} + +/** OsDisk represents configuration of the boot disk. */ +export interface OsDisk { + /** The strategy for creating the OS disk. */ + createOption?: OsDiskCreateOption; + /** The strategy for deleting the OS disk. */ + deleteOption?: OsDiskDeleteOption; + /** The size of the disk in gigabytes. Required if the createOption is Ephemeral. */ + diskSizeGB: number; +} + +/** ImageRepositoryCredentials represents the credentials used to login to the image repository. */ +export interface ImageRepositoryCredentials { + /** The password or token used to access an image in the target repository. */ + password: string; + /** The URL of the authentication server used to validate the repository credentials. */ + registryUrl: string; + /** The username used to access an image in the target repository. */ + username: string; +} + +/** VolumeList represents a list of volumes. */ +export interface VolumeList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of volumes. */ + value?: Volume[]; +} + +/** BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. */ +export interface BareMetalMachinePatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** + * The details provided by the customer during the creation of rack manifests + * that allows for custom data to be associated with this machine. + */ + machineDetails?: string; +} + +/** BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal machine. */ +export interface BareMetalMachineCordonParameters { + /** The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. */ + evacuate?: BareMetalMachineEvacuate; +} + +/** BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. */ +export interface BareMetalMachinePowerOffParameters { + /** The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. */ + skipShutdown?: BareMetalMachineSkipShutdown; +} + +/** BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for another. */ +export interface BareMetalMachineReplaceParameters { + /** The credentials of the baseboard management controller on this bare metal machine. */ + bmcCredentials?: AdministrativeCredentials; + /** The MAC address of the BMC device. */ + bmcMacAddress?: string; + /** The MAC address of a NIC connected to the PXE network. */ + bootMacAddress?: string; + /** The OS-level hostname assigned to this machine. */ + machineName?: string; + /** The serial number of the bare metal machine. */ + serialNumber?: string; +} + +/** BareMetalMachineRunCommandParameters represents the body of the request to execute a script on the bare metal machine. */ +export interface BareMetalMachineRunCommandParameters { + /** The list of string arguments that will be passed to the script in order as separate arguments. */ + arguments?: string[]; + /** + * 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). + */ + limitTimeSeconds: number; + /** The base64 encoded script to execute on the bare metal machine. */ + script: string; +} + +/** BareMetalMachineRunDataExtractsParameters represents the body of request containing list of curated data extraction commands to run on the bare metal machine. */ +export interface BareMetalMachineRunDataExtractsParameters { + /** The list of curated data extraction commands to be executed directly against the target machine. */ + commands: BareMetalMachineCommandSpecification[]; + /** + * 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). + */ + limitTimeSeconds: number; +} + +/** BareMetalMachineCommandSpecification represents the command and optional arguments to exercise against the bare metal machine. */ +export interface BareMetalMachineCommandSpecification { + /** The list of string arguments that will be passed to the script in order as separate arguments. */ + arguments?: string[]; + /** The command to execute against the bare metal machine. */ + command: string; +} + +/** BareMetalMachineRunReadCommandsParameters represents the body of request containing list of read-only commands to run on the bare metal machine. */ +export interface BareMetalMachineRunReadCommandsParameters { + /** The list of read-only commands to be executed directly against the target machine. */ + commands: BareMetalMachineCommandSpecification[]; + /** + * 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). + */ + limitTimeSeconds: number; +} + +/** BareMetalMachineValidateHardwareParameters represents the body of the request to validate the physical hardware of a bare metal machine. */ +export interface BareMetalMachineValidateHardwareParameters { + /** The category of hardware validation to perform. */ + validationCategory: BareMetalMachineHardwareValidationCategory; +} + +/** CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. */ +export interface CloudServicesNetworkPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. */ + additionalEgressEndpoints?: EgressEndpoint[]; + /** The indicator of whether the platform default endpoints are allowed for the egress traffic. */ + enableDefaultEgressEndpoints?: CloudServicesNetworkEnableDefaultEgressEndpoints; +} + +/** ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. */ +export interface ClusterManagerPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; +} + +/** ClusterPatchParameters represents the body of the request to patch the cluster properties. */ +export interface ClusterPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** 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. */ + aggregatorOrSingleRackDefinition?: RackDefinition; + /** The customer-provided location information to identify where the cluster resides. */ + clusterLocation?: string; + /** The service principal to be used by the cluster during Arc Appliance installation. */ + clusterServicePrincipal?: ServicePrincipalInformation; + /** The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. */ + computeDeploymentThreshold?: ValidationThreshold; + /** + * The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + */ + computeRackDefinitions?: RackDefinition[]; +} + +/** BareMetalMachineKeySetList represents a list of bare metal machine key sets. */ +export interface BareMetalMachineKeySetList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of bare metal machine key sets. */ + value?: BareMetalMachineKeySet[]; +} + +/** KeySetUser represents the properties of the user in the key set. */ +export interface KeySetUser { + /** The Azure Active Directory user name (email name). */ + azureUserName: string; + /** The free-form description for this user. */ + description?: string; + /** The SSH public key for this user. */ + sshPublicKey: SshPublicKey; +} + +/** KeySetUserStatus represents the status of the key set user. */ +export interface KeySetUserStatus { + /** + * The Azure Active Directory user name (email name). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureUserName?: string; + /** + * The indicator of whether the user is currently deployed for access. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: BareMetalMachineKeySetUserSetupStatus; + /** + * The additional information describing the current status of this user, if any available. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusMessage?: string; +} + +/** BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. */ +export interface BareMetalMachineKeySetPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** The date and time after which the users in this key set will be removed from the bare metal machines. */ + expiration?: Date; + /** The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. */ + jumpHostsAllowed?: string[]; + /** The unique list of permitted users. */ + userList?: KeySetUser[]; +} + +/** BmcKeySetList represents a list of baseboard management controller key sets. */ +export interface BmcKeySetList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of baseboard management controller key sets. */ + value?: BmcKeySet[]; +} + +/** BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. */ +export interface BmcKeySetPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** The date and time after which the users in this key set will be removed from the baseboard management controllers. */ + expiration?: Date; + /** The unique list of permitted users. */ + userList?: KeySetUser[]; +} + +/** ClusterDeployParameters represents the body of the request to deploy cluster. */ +export interface ClusterDeployParameters { + /** The names of bare metal machines in the cluster that should be skipped during environment validation. */ + skipValidationsForMachines?: string[]; +} + +/** ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. */ +export interface ClusterMetricsConfigurationList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of metrics configurations. */ + value?: ClusterMetricsConfiguration[]; +} + +/** ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. */ +export interface ClusterMetricsConfigurationPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** The interval in minutes by which metrics will be collected. */ + collectionInterval?: number; + /** The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. */ + enabledMetrics?: string[]; +} + +/** ClusterUpdateVersionParameters represents the body of the request to update cluster version. */ +export interface ClusterUpdateVersionParameters { + /** The version to be applied to the cluster during update. */ + targetClusterVersion: string; +} + +/** DefaultCniNetworkPatchParameters represents the body of the request to patch the Default CNI network. */ +export interface DefaultCniNetworkPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; +} + +/** HybridAksClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. */ +export interface HybridAksClusterPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; +} + +/** HybridAksClusterRestartNodeParameters represents the body of the request to restart the node of a Hybrid AKS cluster. */ +export interface HybridAksClusterRestartNodeParameters { + /** The name of the node to restart. */ + nodeName: string; +} + +/** L2NetworkPatchParameters represents the body of the request to patch the L2 network. */ +export interface L2NetworkPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; +} + +/** L3NetworkPatchParameters represents the body of the request to patch the cloud services network. */ +export interface L3NetworkPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; +} + +/** RackPatchParameters represents the body of the request to patch the rack properties. */ +export interface RackPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) */ + rackLocation?: string; + /** The globally unique identifier for the rack. */ + rackSerialNumber?: string; +} + +/** StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. */ +export interface StorageAppliancePatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** The serial number for the storage appliance. */ + serialNumber?: string; +} + +/** StorageApplianceEnableRemoteVendorManagementParameters represents the body of the request to enable remote vendor management of a storage appliance. */ +export interface 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. */ + supportEndpoints?: string[]; +} + +/** StorageApplianceRunReadCommandsParameters represents the body of request containing list of read-only commands to run for a storage appliance. */ +export interface StorageApplianceRunReadCommandsParameters { + /** The list of read-only commands to run. */ + commands: StorageApplianceCommandSpecification[]; + /** + * 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). + */ + limitTimeSeconds: number; +} + +/** StorageApplianceCommandSpecification represents the read-only command and optional arguments to execute against a storage appliance. */ +export interface StorageApplianceCommandSpecification { + /** The list of string arguments that will be passed to the script in order as separate arguments. */ + arguments?: string[]; + /** The read-only command to execute against the storage appliance. */ + command: string; +} + +/** StorageApplianceValidateHardwareParameters represents the body of the request to validate the physical hardware of a storage appliance. */ +export interface StorageApplianceValidateHardwareParameters { + /** The category of hardware validation to perform. */ + validationCategory: StorageApplianceHardwareValidationCategory; +} + +/** TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. */ +export interface TrunkedNetworkPatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; +} + +/** VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. */ +export interface VirtualMachinePatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** The credentials used to login to the image repository that has access to the specified image. */ + vmImageRepositoryCredentials?: ImageRepositoryCredentials; +} + +/** VirtualMachineVolumeParameters represents the body of the request to handle attachment and detachment of volumes for the virtual machine. */ +export interface VirtualMachineVolumeParameters { + /** The resource ID of the volume. */ + volumeId: string; +} + +/** ConsoleList represents a list of virtual machine consoles. */ +export interface ConsoleList { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of virtual machine consoles. */ + value?: Console[]; +} + +/** ConsolePatchParameters represents the body of the request to patch the virtual machine console. */ +export interface ConsolePatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; + /** The credentials used to login to the image repository that has access to the specified image. */ + enabled?: ConsoleEnabled; + /** The date and time after which the key will be disallowed access. */ + expiration?: Date; + /** 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. */ + sshPublicKey?: SshPublicKey; +} + +/** VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. */ +export interface VirtualMachinePowerOffParameters { + /** The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. */ + skipShutdown?: SkipShutdown; +} + +/** VolumePatchParameters represents the body of the request to patch the volume resource. */ +export interface VolumePatchParameters { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; +} + +/** TagsParameter represents the resource tags. */ +export interface TagsParameter { + /** The Azure resource tags that will replace the existing ones. */ + tags?: { [propertyName: string]: string }; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** RackSku represents the SKU information of the rack. */ +export interface RackSku extends Resource { + /** + * The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly computeMachines?: MachineSkuSlot[]; + /** + * The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly controllerMachines?: MachineSkuSlot[]; + /** + * The free-form text describing the rack. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * 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"). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maxClusterSlots?: number; + /** + * The provisioning state of the rack SKU resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: RackSkuProvisioningState; + /** + * The type of the rack. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly rackType?: RackSkuType; + /** + * The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly storageAppliances?: StorageApplianceSkuSlot[]; + /** + * The list of supported SKUs if the rack is an aggregator. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly supportedRackSkuIds?: string[]; +} + +/** BareMetalMachine represents the physical machine in the rack. */ +export interface BareMetalMachine extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** The connection string for the baseboard management controller including IP address and protocol. */ + bmcConnectionString: string; + /** The credentials of the baseboard management controller on this bare metal machine. */ + bmcCredentials: AdministrativeCredentials; + /** The MAC address of the BMC device. */ + bmcMacAddress: string; + /** The MAC address of a NIC connected to the PXE network. */ + bootMacAddress: string; + /** + * The resource ID of the cluster this bare metal machine is associated with. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** + * The cordon status of the bare metal machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cordonStatus?: BareMetalMachineCordonStatus; + /** + * The more detailed status of the bare metal machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: BareMetalMachineDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * The hardware inventory, including information acquired from the model/sku information and from the ironic inspector. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hardwareInventory?: HardwareInventory; + /** + * The details of the latest hardware validation performed for this bare metal machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hardwareValidationStatus?: HardwareValidationStatus; + /** + * The list of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hybridAksClustersAssociatedIds?: string[]; + /** + * The name of this machine represented by the host object in the Cluster's Kubernetes control plane. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly kubernetesNodeName?: string; + /** + * The version of Kubernetes running on this machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly kubernetesVersion?: string; + /** The custom details provided by the customer. */ + machineDetails: string; + /** The OS-level hostname assigned to this machine. */ + machineName: string; + /** The unique internal identifier of the bare metal machine SKU. */ + machineSkuId: string; + /** + * The IPv4 address that is assigned to the bare metal machine during the cluster deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly oamIpv4Address?: string; + /** + * The IPv6 address that is assigned to the bare metal machine during the cluster deployment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly oamIpv6Address?: string; + /** + * The image that is currently provisioned to the OS disk. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osImage?: string; + /** + * The power state derived from the baseboard management controller. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly powerState?: BareMetalMachinePowerState; + /** + * The provisioning state of the bare metal machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: BareMetalMachineProvisioningState; + /** The resource ID of the rack where this bare metal machine resides. */ + rackId: string; + /** The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. */ + rackSlot: number; + /** + * The indicator of whether the bare metal machine is ready to receive workloads. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly readyState?: BareMetalMachineReadyState; + /** The serial number of the bare metal machine. */ + serialNumber: string; + /** + * The discovered value of the machine's service tag. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serviceTag?: string; + /** + * The list of the resource IDs for the VirtualMachines that are hosted on this bare metal machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly virtualMachinesAssociatedIds?: string[]; +} + +/** + * 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. + */ +export interface CloudServicesNetwork extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. */ + additionalEgressEndpoints?: EgressEndpoint[]; + /** + * The resource ID of the Network Cloud cluster this cloud services network is associated with. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** + * The more detailed status of the cloud services network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: CloudServicesNetworkDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** The indicator of whether the platform default endpoints are allowed for the egress traffic. */ + enableDefaultEgressEndpoints?: CloudServicesNetworkEnableDefaultEgressEndpoints; + /** + * The full list of additional and default egress endpoints that are currently enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enabledEgressEndpoints?: EgressEndpoint[]; + /** + * The list of Hybrid AKS cluster resource IDs that are associated with this cloud services network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hybridAksClustersAssociatedIds?: string[]; + /** + * The name of the interface that will be present in the virtual machine to represent this network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly interfaceName?: string; + /** + * The provisioning state of the cloud services network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: CloudServicesNetworkProvisioningState; + /** + * The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this cloud services network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly virtualMachinesAssociatedIds?: string[]; +} + +/** ClusterManager represents a control-plane to manage one or more on-premises clusters. */ +export interface ClusterManager extends TrackedResource { + /** The resource ID of the Log Analytics workspace that is used for the logs collection. */ + analyticsWorkspaceId?: string; + /** 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. */ + availabilityZones?: string[]; + /** + * The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterVersions?: ClusterAvailableVersion[]; + /** + * The detailed status that provides additional information about the cluster manager. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: ClusterManagerDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** The resource ID of the fabric controller that has one to one mapping with the cluster manager. */ + fabricControllerId: string; + /** The configuration of the managed resource group associated with the resource. */ + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + /** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly managerExtendedLocation?: ExtendedLocation; + /** + * The provisioning state of the cluster manager. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ClusterManagerProvisioningState; + /** 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. */ + vmSize?: string; +} + +/** Cluster represents the on-premises Network Cloud cluster. */ +export interface Cluster extends TrackedResource { + /** The extended location of the cluster manager associated with the cluster. */ + extendedLocation: ExtendedLocation; + /** 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. */ + aggregatorOrSingleRackDefinition: RackDefinition; + /** The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. */ + analyticsWorkspaceId: string; + /** + * The list of cluster runtime version upgrades available for this cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly availableUpgradeVersions?: ClusterAvailableUpgradeVersion[]; + /** + * The capacity supported by this cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterCapacity?: ClusterCapacity; + /** + * The latest heartbeat status between the cluster manager and the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterConnectionStatus?: ClusterConnectionStatus; + /** + * 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. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterExtendedLocation?: ExtendedLocation; + /** The customer-provided location information to identify where the cluster resides. */ + clusterLocation?: string; + /** + * The latest connectivity status between cluster manager and the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly 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. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterManagerId?: string; + /** The service principal to be used by the cluster during Arc Appliance installation. */ + clusterServicePrincipal?: ServicePrincipalInformation; + /** The type of rack configuration for the cluster. */ + clusterType: ClusterType; + /** The current runtime version of the cluster. */ + clusterVersion: string; + /** The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. */ + computeDeploymentThreshold?: ValidationThreshold; + /** + * The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + */ + computeRackDefinitions?: RackDefinition[]; + /** + * The current detailed status of the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: ClusterDetailedStatus; + /** + * The descriptive message about the detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * 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). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hybridAksExtendedLocation?: ExtendedLocation; + /** The configuration of the managed resource group associated with the resource. */ + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + /** + * The count of Manual Action Taken (MAT) events that have not been validated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly manualActionCount?: number; + /** The resource ID of the Network Fabric associated with the cluster. */ + networkFabricId: string; + /** + * The provisioning state of the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ClusterProvisioningState; + /** + * The support end date of the runtime version of the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly supportExpiryDate?: string; + /** + * The list of workload resource IDs that are hosted within this cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly workloadResourceIds?: string[]; +} + +/** DefaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created in support of a Hybrid AKS Cluster. */ +export interface DefaultCniNetwork extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** + * The resource ID of the Network Cloud cluster this default CNI network is associated with. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** + * The autonomous system number that the fabric expects to peer with, derived from the associated L3 isolation domain. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cniAsNumber?: number; + /** The Calico BGP configuration. */ + cniBgpConfiguration?: CniBgpConfiguration; + /** + * The more detailed status of the default CNI network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: DefaultCniNetworkDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * The L3 isolation fabric BGP peering connectivity information necessary for BGP peering the Hybrid AKS Cluster with the switch fabric. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly fabricBgpPeers?: BgpPeer[]; + /** + * The list of Hybrid AKS cluster resource ID(s) that are associated with this default CNI network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hybridAksClustersAssociatedIds?: string[]; + /** + * The name of the interface that will be present in the virtual machine to represent this network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly interfaceName?: string; + /** The type of the IP address allocation. */ + ipAllocationType?: IpAllocationType; + /** + * The IPV4 prefix (CIDR) assigned to this default CNI network. It is required when the IP allocation type + * is IPV4 or DualStack. + */ + ipv4ConnectedPrefix?: string; + /** + * The IPV6 prefix (CIDR) assigned to this default CNI network. It is required when the IP allocation type + * is IPV6 or DualStack. + */ + ipv6ConnectedPrefix?: string; + /** The resource ID of the Network Fabric l3IsolationDomain. */ + l3IsolationDomainId: string; + /** + * The provisioning state of the default CNI network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: DefaultCniNetworkProvisioningState; + /** The VLAN from the l3IsolationDomain that is used for this network. */ + vlan: number; +} + +/** The details are specific to the Network Cloud use of the Hybrid AKS cluster. */ +export interface HybridAksCluster extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** 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. */ + associatedNetworkIds: string[]; + /** + * The resource ID of the associated cloud services network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cloudServicesNetworkId?: string; + /** + * The resource ID of the Network Cloud cluster hosting the Hybrid AKS cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** The number of control plane node VMs. */ + controlPlaneCount: number; + /** + * The list of node configurations detailing associated VMs that are part of the control plane nodes of this Hybrid AKS cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly controlPlaneNodes?: NodeConfiguration[]; + /** + * The resource ID of the associated default CNI network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly defaultCniNetworkId?: string; + /** + * The more detailed status of this Hybrid AKS cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: HybridAksClusterDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** The resource ID of the Hybrid AKS cluster that this additional information is for. */ + hybridAksProvisionedClusterId: string; + /** + * The provisioning state of the Hybrid AKS cluster resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: HybridAksClusterProvisioningState; + /** + * The resource IDs of volumes that are attached to the Hybrid AKS cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly volumes?: string[]; + /** The number of worker node VMs. */ + workerCount: number; + /** + * The list of node configurations detailing associated VMs that are part of the worker nodes of this Hybrid AKS cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly workerNodes?: NodeConfiguration[]; +} + +/** L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. */ +export interface L2Network extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** + * The resource ID of the Network Cloud cluster this L2 network is associated with. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** + * The more detailed status of the L2 network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: L2NetworkDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * The list of Hybrid AKS cluster resource ID(s) that are associated with this L2 network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hybridAksClustersAssociatedIds?: string[]; + /** The network plugin type for Hybrid AKS. */ + 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. */ + interfaceName?: string; + /** The resource ID of the Network Fabric l2IsolationDomain. */ + l2IsolationDomainId: string; + /** + * The provisioning state of the L2 network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: L2NetworkProvisioningState; + /** + * The list of virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using this L2 network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly virtualMachinesAssociatedIds?: string[]; +} + +/** L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. */ +export interface L3Network extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** + * The resource ID of the Network Cloud cluster this L3 network is associated with. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** + * The more detailed status of the L3 network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: L3NetworkDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * The list of Hybrid AKS cluster resource IDs that are associated with this L3 network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hybridAksClustersAssociatedIds?: string[]; + /** The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. */ + hybridAksIpamEnabled?: HybridAksIpamEnabled; + /** The network plugin type for Hybrid AKS. */ + 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. */ + interfaceName?: string; + /** The type of the IP address allocation, defaulted to "DualStack". */ + ipAllocationType?: IpAllocationType; + /** + * The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type + * is IPV4 or DualStack. + */ + ipv4ConnectedPrefix?: string; + /** + * The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type + * is IPV6 or DualStack. + */ + ipv6ConnectedPrefix?: string; + /** The resource ID of the Network Fabric l3IsolationDomain. */ + l3IsolationDomainId: string; + /** + * The provisioning state of the L3 network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: L3NetworkProvisioningState; + /** + * The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this L3 network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly virtualMachinesAssociatedIds?: string[]; + /** The VLAN from the l3IsolationDomain that is used for this network. */ + vlan: number; +} + +/** Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. */ +export interface Rack extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** 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. */ + availabilityZone: string; + /** + * The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** + * The more detailed status of the rack. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: RackDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * The provisioning state of the rack resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: RackProvisioningState; + /** The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) */ + rackLocation: string; + /** 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. */ + rackSerialNumber: string; + /** The SKU for the rack. */ + rackSkuId: string; +} + +/** StorageAppliance represents on-premises Network Cloud storage appliance. */ +export interface StorageAppliance extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** The credentials of the administrative interface on this storage appliance. */ + administratorCredentials: AdministrativeCredentials; + /** + * The total capacity of the storage appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capacity?: number; + /** + * The amount of storage consumed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capacityUsed?: number; + /** + * The resource ID of the cluster this storage appliance is associated with. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** + * The detailed status of the storage appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: StorageApplianceDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * The endpoint for the management interface of the storage appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly managementIpv4Address?: string; + /** + * The provisioning state of the storage appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: StorageApplianceProvisioningState; + /** The resource ID of the rack where this storage appliance resides. */ + rackId: string; + /** The slot the storage appliance is in the rack based on the BOM configuration. */ + rackSlot: number; + /** + * The indicator of whether the storage appliance supports remote vendor management. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly remoteVendorManagementFeature?: RemoteVendorManagementFeature; + /** + * The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported feature. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly remoteVendorManagementStatus?: RemoteVendorManagementStatus; + /** The serial number for the storage appliance. */ + serialNumber: string; + /** The SKU for the storage appliance. */ + storageApplianceSkuId: string; +} + +/** TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. */ +export interface TrunkedNetwork extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** + * The resource ID of the Network Cloud cluster this trunked network is associated with. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** + * The more detailed status of the trunked network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: TrunkedNetworkDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * The list of Hybrid AKS cluster resource IDs that are associated with this trunked network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hybridAksClustersAssociatedIds?: string[]; + /** The network plugin type for Hybrid AKS. */ + 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. */ + interfaceName?: string; + /** The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain and l3IsolationDomain resources. */ + isolationDomainIds: string[]; + /** + * The provisioning state of the trunked network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: TrunkedNetworkProvisioningState; + /** + * The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this trunked network. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly virtualMachinesAssociatedIds?: string[]; + /** The list of vlans that are selected from the isolation domains for trunking. */ + vlans: number[]; +} + +/** VirtualMachine represents the on-premises Network Cloud virtual machine. */ +export interface VirtualMachine extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** The name of the administrator to which the ssh public keys will be added into the authorized keys. */ + adminUsername: string; + /** + * The resource ID of the bare metal machine the virtual machine has landed to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly bareMetalMachineId?: string; + /** Selects the boot method for the virtual machine. */ + bootMethod?: VirtualMachineBootMethod; + /** The cloud service network that provides platform-level services for the virtual machine. */ + cloudServicesNetworkAttachment: NetworkAttachment; + /** + * The resource ID of the cluster the virtual machine is created for. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clusterId?: string; + /** The number of CPU cores in the virtual machine. */ + cpuCores: number; + /** + * The more detailed status of the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: VirtualMachineDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** 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. */ + isolateEmulatorThread?: VirtualMachineIsolateEmulatorThread; + /** The memory size of the virtual machine in GB. */ + memorySizeGB: number; + /** The list of network attachments to the virtual machine. */ + networkAttachments?: NetworkAttachment[]; + /** The Base64 encoded cloud-init network data. */ + networkData?: string; + /** The scheduling hints for the virtual machine. */ + placementHints?: VirtualMachinePlacementHint[]; + /** + * The power state of the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly powerState?: VirtualMachinePowerState; + /** + * The provisioning state of the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: VirtualMachineProvisioningState; + /** 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. */ + sshPublicKeys?: SshPublicKey[]; + /** The storage profile that specifies size and other parameters about the disks related to the virtual machine. */ + storageProfile: StorageProfile; + /** The Base64 encoded cloud-init user data. */ + userData?: string; + /** Field Deprecated, use virtualizationModel instead. The type of the virtio interface. */ + virtioInterface?: VirtualMachineVirtioInterfaceType; + /** The type of the device model to use. */ + vmDeviceModel?: VirtualMachineDeviceModelType; + /** The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image. */ + vmImage: string; + /** The credentials used to login to the image repository that has access to the specified image. */ + vmImageRepositoryCredentials?: ImageRepositoryCredentials; + /** + * The resource IDs of volumes that are attached to the virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly volumes?: string[]; +} + +/** Volume represents storage made available for use by resources running on the cluster. */ +export interface Volume extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** + * The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly attachedTo?: string[]; + /** + * The more detailed status of the volume. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: VolumeDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * The provisioning state of the volume. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: VolumeProvisioningState; + /** + * The unique identifier of the volume. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serialNumber?: string; + /** The size of the allocation for this volume in Mebibytes. */ + sizeMiB: number; +} + +/** BareMetalMachineKeySet represents the bare metal machine key set. */ +export interface BareMetalMachineKeySet extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** 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. */ + azureGroupId: string; + /** + * The more detailed status of the key set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: BareMetalMachineKeySetDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** The date and time after which the users in this key set will be removed from the bare metal machines. */ + expiration: Date; + /** The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. */ + jumpHostsAllowed: string[]; + /** + * The last time this key set was validated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastValidation?: Date; + /** The name of the group that users will be assigned to on the operating system of the machines. */ + osGroupName?: string; + /** The access level allowed for the users in this key set. */ + privilegeLevel: BareMetalMachineKeySetPrivilegeLevel; + /** + * The provisioning state of the bare metal machine key set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: BareMetalMachineKeySetProvisioningState; + /** The unique list of permitted users. */ + userList: KeySetUser[]; + /** + * The status evaluation of each user. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userListStatus?: KeySetUserStatus[]; +} + +/** BmcKeySet represents the baseboard management controller key set. */ +export interface BmcKeySet extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** 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. */ + azureGroupId: string; + /** + * The more detailed status of the key set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: BmcKeySetDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** The date and time after which the users in this key set will be removed from the baseboard management controllers. */ + expiration: Date; + /** + * The last time this key set was validated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastValidation?: Date; + /** The access level allowed for the users in this key set. */ + privilegeLevel: BmcKeySetPrivilegeLevel; + /** + * The provisioning state of the baseboard management controller key set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: BmcKeySetProvisioningState; + /** The unique list of permitted users. */ + userList: KeySetUser[]; + /** + * The status evaluation of each user. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userListStatus?: KeySetUserStatus[]; +} + +/** ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. */ +export interface ClusterMetricsConfiguration extends TrackedResource { + /** The extended location of the cluster associated with the resource. */ + extendedLocation: ExtendedLocation; + /** The interval in minutes by which metrics will be collected. */ + collectionInterval: number; + /** + * The more detailed status of the metrics configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: ClusterMetricsConfigurationDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** + * The list of metrics that are available for the cluster but disabled at the moment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly disabledMetrics?: string[]; + /** The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. */ + enabledMetrics?: string[]; + /** + * The provisioning state of the metrics configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ClusterMetricsConfigurationProvisioningState; +} + +/** Console represents the console of an on-premises Network Cloud virtual machine. */ +export interface Console extends TrackedResource { + /** The extended location of the cluster manager associated with the cluster this virtual machine is created on. */ + extendedLocation: ExtendedLocation; + /** + * The more detailed status of the console. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatus?: ConsoleDetailedStatus; + /** + * The descriptive message about the current detailed status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedStatusMessage?: string; + /** The indicator of whether the console access is enabled. */ + enabled: ConsoleEnabled; + /** The date and time after which the key will be disallowed access. */ + expiration?: Date; + /** + * The resource ID of the private link service that is used to provide virtual machine console access. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateLinkServiceId?: string; + /** + * The provisioning state of the virtual machine console. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ConsoleProvisioningState; + /** 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. */ + sshPublicKey: SshPublicKey; + /** + * The unique identifier for the virtual machine that is used to access the console. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly virtualMachineAccessId?: string; +} + +/** Defines headers for BareMetalMachines_createOrUpdate operation. */ +export interface BareMetalMachinesCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for BareMetalMachines_delete operation. */ +export interface BareMetalMachinesDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_update operation. */ +export interface BareMetalMachinesUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_cordon operation. */ +export interface BareMetalMachinesCordonHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_powerOff operation. */ +export interface BareMetalMachinesPowerOffHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_reimage operation. */ +export interface BareMetalMachinesReimageHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_replace operation. */ +export interface BareMetalMachinesReplaceHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_restart operation. */ +export interface BareMetalMachinesRestartHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_runCommand operation. */ +export interface BareMetalMachinesRunCommandHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_runDataExtracts operation. */ +export interface BareMetalMachinesRunDataExtractsHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_runReadCommands operation. */ +export interface BareMetalMachinesRunReadCommandsHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_start operation. */ +export interface BareMetalMachinesStartHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_uncordon operation. */ +export interface BareMetalMachinesUncordonHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachines_validateHardware operation. */ +export interface BareMetalMachinesValidateHardwareHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for CloudServicesNetworks_createOrUpdate operation. */ +export interface CloudServicesNetworksCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for CloudServicesNetworks_delete operation. */ +export interface CloudServicesNetworksDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for CloudServicesNetworks_update operation. */ +export interface CloudServicesNetworksUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for ClusterManagers_createOrUpdate operation. */ +export interface ClusterManagersCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for ClusterManagers_delete operation. */ +export interface ClusterManagersDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for Clusters_createOrUpdate operation. */ +export interface ClustersCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for Clusters_delete operation. */ +export interface ClustersDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for Clusters_update operation. */ +export interface ClustersUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for Clusters_deploy operation. */ +export interface ClustersDeployHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for Clusters_updateVersion operation. */ +export interface ClustersUpdateVersionHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for DefaultCniNetworks_createOrUpdate operation. */ +export interface DefaultCniNetworksCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for DefaultCniNetworks_delete operation. */ +export interface DefaultCniNetworksDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for HybridAksClusters_createOrUpdate operation. */ +export interface HybridAksClustersCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for HybridAksClusters_delete operation. */ +export interface HybridAksClustersDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for HybridAksClusters_restartNode operation. */ +export interface HybridAksClustersRestartNodeHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for L2Networks_createOrUpdate operation. */ +export interface L2NetworksCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for L2Networks_delete operation. */ +export interface L2NetworksDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for L3Networks_createOrUpdate operation. */ +export interface L3NetworksCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for L3Networks_delete operation. */ +export interface L3NetworksDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for Racks_createOrUpdate operation. */ +export interface RacksCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for Racks_delete operation. */ +export interface RacksDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for Racks_update operation. */ +export interface RacksUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for StorageAppliances_createOrUpdate operation. */ +export interface StorageAppliancesCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for StorageAppliances_delete operation. */ +export interface StorageAppliancesDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for StorageAppliances_update operation. */ +export interface StorageAppliancesUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for StorageAppliances_disableRemoteVendorManagement operation. */ +export interface StorageAppliancesDisableRemoteVendorManagementHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for StorageAppliances_enableRemoteVendorManagement operation. */ +export interface StorageAppliancesEnableRemoteVendorManagementHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for StorageAppliances_runReadCommands operation. */ +export interface StorageAppliancesRunReadCommandsHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for StorageAppliances_validateHardware operation. */ +export interface StorageAppliancesValidateHardwareHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for TrunkedNetworks_createOrUpdate operation. */ +export interface TrunkedNetworksCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for TrunkedNetworks_delete operation. */ +export interface TrunkedNetworksDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for VirtualMachines_createOrUpdate operation. */ +export interface VirtualMachinesCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for VirtualMachines_delete operation. */ +export interface VirtualMachinesDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for VirtualMachines_update operation. */ +export interface VirtualMachinesUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for VirtualMachines_attachVolume operation. */ +export interface VirtualMachinesAttachVolumeHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for VirtualMachines_detachVolume operation. */ +export interface VirtualMachinesDetachVolumeHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for VirtualMachines_powerOff operation. */ +export interface VirtualMachinesPowerOffHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for VirtualMachines_reimage operation. */ +export interface VirtualMachinesReimageHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for VirtualMachines_restart operation. */ +export interface VirtualMachinesRestartHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for VirtualMachines_start operation. */ +export interface VirtualMachinesStartHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for Volumes_createOrUpdate operation. */ +export interface VolumesCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for Volumes_delete operation. */ +export interface VolumesDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachineKeySets_createOrUpdate operation. */ +export interface BareMetalMachineKeySetsCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for BareMetalMachineKeySets_delete operation. */ +export interface BareMetalMachineKeySetsDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BareMetalMachineKeySets_update operation. */ +export interface BareMetalMachineKeySetsUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BmcKeySets_createOrUpdate operation. */ +export interface BmcKeySetsCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for BmcKeySets_delete operation. */ +export interface BmcKeySetsDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for BmcKeySets_update operation. */ +export interface BmcKeySetsUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for MetricsConfigurations_createOrUpdate operation. */ +export interface MetricsConfigurationsCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for MetricsConfigurations_delete operation. */ +export interface MetricsConfigurationsDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for MetricsConfigurations_update operation. */ +export interface MetricsConfigurationsUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for Consoles_createOrUpdate operation. */ +export interface ConsolesCreateOrUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for Consoles_delete operation. */ +export interface ConsolesDeleteHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Defines headers for Consoles_update operation. */ +export interface ConsolesUpdateHeaders { + /** The URL to retrieve the status of the asynchronous operation. */ + location?: string; +} + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Known values of {@link BareMetalMachineCordonStatus} that the service accepts. */ +export enum KnownBareMetalMachineCordonStatus { + /** Cordoned */ + Cordoned = "Cordoned", + /** Uncordoned */ + Uncordoned = "Uncordoned" +} + +/** + * Defines values for BareMetalMachineCordonStatus. \ + * {@link KnownBareMetalMachineCordonStatus} can be used interchangeably with BareMetalMachineCordonStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Cordoned** \ + * **Uncordoned** + */ +export type BareMetalMachineCordonStatus = string; + +/** Known values of {@link BareMetalMachineDetailedStatus} that the service accepts. */ +export enum KnownBareMetalMachineDetailedStatus { + /** Preparing */ + Preparing = "Preparing", + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning", + /** Provisioned */ + Provisioned = "Provisioned", + /** Deprovisioning */ + Deprovisioning = "Deprovisioning" +} + +/** + * Defines values for BareMetalMachineDetailedStatus. \ + * {@link KnownBareMetalMachineDetailedStatus} can be used interchangeably with BareMetalMachineDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Preparing** \ + * **Error** \ + * **Available** \ + * **Provisioning** \ + * **Provisioned** \ + * **Deprovisioning** + */ +export type BareMetalMachineDetailedStatus = string; + +/** Known values of {@link BareMetalMachineHardwareValidationResult} that the service accepts. */ +export enum KnownBareMetalMachineHardwareValidationResult { + /** Pass */ + Pass = "Pass", + /** Fail */ + Fail = "Fail" +} + +/** + * Defines values for BareMetalMachineHardwareValidationResult. \ + * {@link KnownBareMetalMachineHardwareValidationResult} can be used interchangeably with BareMetalMachineHardwareValidationResult, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pass** \ + * **Fail** + */ +export type BareMetalMachineHardwareValidationResult = string; + +/** Known values of {@link BareMetalMachinePowerState} that the service accepts. */ +export enum KnownBareMetalMachinePowerState { + /** On */ + On = "On", + /** Off */ + Off = "Off" +} + +/** + * Defines values for BareMetalMachinePowerState. \ + * {@link KnownBareMetalMachinePowerState} can be used interchangeably with BareMetalMachinePowerState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **On** \ + * **Off** + */ +export type BareMetalMachinePowerState = string; + +/** Known values of {@link BareMetalMachineProvisioningState} that the service accepts. */ +export enum KnownBareMetalMachineProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for BareMetalMachineProvisioningState. \ + * {@link KnownBareMetalMachineProvisioningState} can be used interchangeably with BareMetalMachineProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type BareMetalMachineProvisioningState = string; + +/** Known values of {@link BareMetalMachineReadyState} that the service accepts. */ +export enum KnownBareMetalMachineReadyState { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for BareMetalMachineReadyState. \ + * {@link KnownBareMetalMachineReadyState} can be used interchangeably with BareMetalMachineReadyState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type BareMetalMachineReadyState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link CloudServicesNetworkDetailedStatus} that the service accepts. */ +export enum KnownCloudServicesNetworkDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for CloudServicesNetworkDetailedStatus. \ + * {@link KnownCloudServicesNetworkDetailedStatus} can be used interchangeably with CloudServicesNetworkDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** + */ +export type CloudServicesNetworkDetailedStatus = string; + +/** Known values of {@link CloudServicesNetworkEnableDefaultEgressEndpoints} that the service accepts. */ +export enum KnownCloudServicesNetworkEnableDefaultEgressEndpoints { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for CloudServicesNetworkEnableDefaultEgressEndpoints. \ + * {@link KnownCloudServicesNetworkEnableDefaultEgressEndpoints} can be used interchangeably with CloudServicesNetworkEnableDefaultEgressEndpoints, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type CloudServicesNetworkEnableDefaultEgressEndpoints = string; + +/** Known values of {@link CloudServicesNetworkProvisioningState} that the service accepts. */ +export enum KnownCloudServicesNetworkProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for CloudServicesNetworkProvisioningState. \ + * {@link KnownCloudServicesNetworkProvisioningState} can be used interchangeably with CloudServicesNetworkProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type CloudServicesNetworkProvisioningState = string; + +/** Known values of {@link ClusterManagerDetailedStatus} that the service accepts. */ +export enum KnownClusterManagerDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning", + /** ProvisioningFailed */ + ProvisioningFailed = "ProvisioningFailed", + /** Updating */ + Updating = "Updating", + /** UpdateFailed */ + UpdateFailed = "UpdateFailed" +} + +/** + * Defines values for ClusterManagerDetailedStatus. \ + * {@link KnownClusterManagerDetailedStatus} can be used interchangeably with ClusterManagerDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** \ + * **ProvisioningFailed** \ + * **Updating** \ + * **UpdateFailed** + */ +export type ClusterManagerDetailedStatus = string; + +/** Known values of {@link ClusterManagerProvisioningState} that the service accepts. */ +export enum KnownClusterManagerProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted", + /** Updating */ + Updating = "Updating" +} + +/** + * Defines values for ClusterManagerProvisioningState. \ + * {@link KnownClusterManagerProvisioningState} can be used interchangeably with ClusterManagerProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** \ + * **Updating** + */ +export type ClusterManagerProvisioningState = string; + +/** Known values of {@link ControlImpact} that the service accepts. */ +export enum KnownControlImpact { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for ControlImpact. \ + * {@link KnownControlImpact} can be used interchangeably with ControlImpact, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type ControlImpact = string; + +/** Known values of {@link WorkloadImpact} that the service accepts. */ +export enum KnownWorkloadImpact { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for WorkloadImpact. \ + * {@link KnownWorkloadImpact} can be used interchangeably with WorkloadImpact, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type WorkloadImpact = string; + +/** Known values of {@link ClusterConnectionStatus} that the service accepts. */ +export enum KnownClusterConnectionStatus { + /** Connected */ + Connected = "Connected", + /** Timeout */ + Timeout = "Timeout", + /** Undefined */ + Undefined = "Undefined" +} + +/** + * Defines values for ClusterConnectionStatus. \ + * {@link KnownClusterConnectionStatus} can be used interchangeably with ClusterConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Connected** \ + * **Timeout** \ + * **Undefined** + */ +export type ClusterConnectionStatus = string; + +/** Known values of {@link ClusterManagerConnectionStatus} that the service accepts. */ +export enum KnownClusterManagerConnectionStatus { + /** Connected */ + Connected = "Connected", + /** Unreachable */ + Unreachable = "Unreachable" +} + +/** + * Defines values for ClusterManagerConnectionStatus. \ + * {@link KnownClusterManagerConnectionStatus} can be used interchangeably with ClusterManagerConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Connected** \ + * **Unreachable** + */ +export type ClusterManagerConnectionStatus = string; + +/** Known values of {@link ClusterType} that the service accepts. */ +export enum KnownClusterType { + /** SingleRack */ + SingleRack = "SingleRack", + /** MultiRack */ + MultiRack = "MultiRack" +} + +/** + * Defines values for ClusterType. \ + * {@link KnownClusterType} can be used interchangeably with ClusterType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SingleRack** \ + * **MultiRack** + */ +export type ClusterType = string; + +/** Known values of {@link ValidationThresholdGrouping} that the service accepts. */ +export enum KnownValidationThresholdGrouping { + /** PerCluster */ + PerCluster = "PerCluster", + /** PerRack */ + PerRack = "PerRack" +} + +/** + * Defines values for ValidationThresholdGrouping. \ + * {@link KnownValidationThresholdGrouping} can be used interchangeably with ValidationThresholdGrouping, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PerCluster** \ + * **PerRack** + */ +export type ValidationThresholdGrouping = string; + +/** Known values of {@link ValidationThresholdType} that the service accepts. */ +export enum KnownValidationThresholdType { + /** CountSuccess */ + CountSuccess = "CountSuccess", + /** PercentSuccess */ + PercentSuccess = "PercentSuccess" +} + +/** + * Defines values for ValidationThresholdType. \ + * {@link KnownValidationThresholdType} can be used interchangeably with ValidationThresholdType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CountSuccess** \ + * **PercentSuccess** + */ +export type ValidationThresholdType = string; + +/** Known values of {@link ClusterDetailedStatus} that the service accepts. */ +export enum KnownClusterDetailedStatus { + /** PendingDeployment */ + PendingDeployment = "PendingDeployment", + /** Deploying */ + Deploying = "Deploying", + /** Running */ + Running = "Running", + /** Updating */ + Updating = "Updating", + /** Degraded */ + Degraded = "Degraded", + /** Deleting */ + Deleting = "Deleting", + /** Disconnected */ + Disconnected = "Disconnected", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for ClusterDetailedStatus. \ + * {@link KnownClusterDetailedStatus} can be used interchangeably with ClusterDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PendingDeployment** \ + * **Deploying** \ + * **Running** \ + * **Updating** \ + * **Degraded** \ + * **Deleting** \ + * **Disconnected** \ + * **Failed** + */ +export type ClusterDetailedStatus = string; + +/** Known values of {@link ClusterProvisioningState} that the service accepts. */ +export enum KnownClusterProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Accepted */ + Accepted = "Accepted", + /** Validating */ + Validating = "Validating", + /** Updating */ + Updating = "Updating" +} + +/** + * Defines values for ClusterProvisioningState. \ + * {@link KnownClusterProvisioningState} can be used interchangeably with ClusterProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Accepted** \ + * **Validating** \ + * **Updating** + */ +export type ClusterProvisioningState = string; + +/** Known values of {@link DefaultCniNetworkDetailedStatus} that the service accepts. */ +export enum KnownDefaultCniNetworkDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for DefaultCniNetworkDetailedStatus. \ + * {@link KnownDefaultCniNetworkDetailedStatus} can be used interchangeably with DefaultCniNetworkDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** + */ +export type DefaultCniNetworkDetailedStatus = string; + +/** Known values of {@link IpAllocationType} that the service accepts. */ +export enum KnownIpAllocationType { + /** IPV4 */ + IPV4 = "IPV4", + /** IPV6 */ + IPV6 = "IPV6", + /** DualStack */ + DualStack = "DualStack" +} + +/** + * Defines values for IpAllocationType. \ + * {@link KnownIpAllocationType} can be used interchangeably with IpAllocationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **IPV4** \ + * **IPV6** \ + * **DualStack** + */ +export type IpAllocationType = string; + +/** Known values of {@link DefaultCniNetworkProvisioningState} that the service accepts. */ +export enum KnownDefaultCniNetworkProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for DefaultCniNetworkProvisioningState. \ + * {@link KnownDefaultCniNetworkProvisioningState} can be used interchangeably with DefaultCniNetworkProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type DefaultCniNetworkProvisioningState = string; + +/** Known values of {@link DefaultGateway} that the service accepts. */ +export enum KnownDefaultGateway { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for DefaultGateway. \ + * {@link KnownDefaultGateway} can be used interchangeably with DefaultGateway, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type DefaultGateway = string; + +/** Known values of {@link VirtualMachineIPAllocationMethod} that the service accepts. */ +export enum KnownVirtualMachineIPAllocationMethod { + /** Dynamic */ + Dynamic = "Dynamic", + /** Static */ + Static = "Static", + /** Disabled */ + Disabled = "Disabled" +} + +/** + * Defines values for VirtualMachineIPAllocationMethod. \ + * {@link KnownVirtualMachineIPAllocationMethod} can be used interchangeably with VirtualMachineIPAllocationMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Dynamic** \ + * **Static** \ + * **Disabled** + */ +export type VirtualMachineIPAllocationMethod = string; + +/** Known values of {@link HybridAksClusterMachinePowerState} that the service accepts. */ +export enum KnownHybridAksClusterMachinePowerState { + /** On */ + On = "On", + /** Off */ + Off = "Off" +} + +/** + * Defines values for HybridAksClusterMachinePowerState. \ + * {@link KnownHybridAksClusterMachinePowerState} can be used interchangeably with HybridAksClusterMachinePowerState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **On** \ + * **Off** + */ +export type HybridAksClusterMachinePowerState = string; + +/** Known values of {@link HybridAksClusterDetailedStatus} that the service accepts. */ +export enum KnownHybridAksClusterDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for HybridAksClusterDetailedStatus. \ + * {@link KnownHybridAksClusterDetailedStatus} can be used interchangeably with HybridAksClusterDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** + */ +export type HybridAksClusterDetailedStatus = string; + +/** Known values of {@link HybridAksClusterProvisioningState} that the service accepts. */ +export enum KnownHybridAksClusterProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled" +} + +/** + * Defines values for HybridAksClusterProvisioningState. \ + * {@link KnownHybridAksClusterProvisioningState} can be used interchangeably with HybridAksClusterProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** + */ +export type HybridAksClusterProvisioningState = string; + +/** Known values of {@link L2NetworkDetailedStatus} that the service accepts. */ +export enum KnownL2NetworkDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for L2NetworkDetailedStatus. \ + * {@link KnownL2NetworkDetailedStatus} can be used interchangeably with L2NetworkDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** + */ +export type L2NetworkDetailedStatus = string; + +/** Known values of {@link HybridAksPluginType} that the service accepts. */ +export enum KnownHybridAksPluginType { + /** Dpdk */ + Dpdk = "DPDK", + /** Sriov */ + Sriov = "SRIOV", + /** OSDevice */ + OSDevice = "OSDevice" +} + +/** + * Defines values for HybridAksPluginType. \ + * {@link KnownHybridAksPluginType} can be used interchangeably with HybridAksPluginType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **DPDK** \ + * **SRIOV** \ + * **OSDevice** + */ +export type HybridAksPluginType = string; + +/** Known values of {@link L2NetworkProvisioningState} that the service accepts. */ +export enum KnownL2NetworkProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for L2NetworkProvisioningState. \ + * {@link KnownL2NetworkProvisioningState} can be used interchangeably with L2NetworkProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type L2NetworkProvisioningState = string; + +/** Known values of {@link L3NetworkDetailedStatus} that the service accepts. */ +export enum KnownL3NetworkDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for L3NetworkDetailedStatus. \ + * {@link KnownL3NetworkDetailedStatus} can be used interchangeably with L3NetworkDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** + */ +export type L3NetworkDetailedStatus = string; + +/** Known values of {@link HybridAksIpamEnabled} that the service accepts. */ +export enum KnownHybridAksIpamEnabled { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for HybridAksIpamEnabled. \ + * {@link KnownHybridAksIpamEnabled} can be used interchangeably with HybridAksIpamEnabled, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type HybridAksIpamEnabled = string; + +/** Known values of {@link L3NetworkProvisioningState} that the service accepts. */ +export enum KnownL3NetworkProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for L3NetworkProvisioningState. \ + * {@link KnownL3NetworkProvisioningState} can be used interchangeably with L3NetworkProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type L3NetworkProvisioningState = string; + +/** Known values of {@link BootstrapProtocol} that the service accepts. */ +export enum KnownBootstrapProtocol { + /** PXE */ + PXE = "PXE" +} + +/** + * Defines values for BootstrapProtocol. \ + * {@link KnownBootstrapProtocol} can be used interchangeably with BootstrapProtocol, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PXE** + */ +export type BootstrapProtocol = string; + +/** Known values of {@link MachineSkuDiskConnectionType} that the service accepts. */ +export enum KnownMachineSkuDiskConnectionType { + /** Pcie */ + Pcie = "PCIE", + /** Sata */ + Sata = "SATA", + /** Raid */ + Raid = "RAID", + /** SAS */ + SAS = "SAS" +} + +/** + * Defines values for MachineSkuDiskConnectionType. \ + * {@link KnownMachineSkuDiskConnectionType} can be used interchangeably with MachineSkuDiskConnectionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PCIE** \ + * **SATA** \ + * **RAID** \ + * **SAS** + */ +export type MachineSkuDiskConnectionType = string; + +/** Known values of {@link DiskType} that the service accepts. */ +export enum KnownDiskType { + /** HDD */ + HDD = "HDD", + /** SSD */ + SSD = "SSD" +} + +/** + * Defines values for DiskType. \ + * {@link KnownDiskType} can be used interchangeably with DiskType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **HDD** \ + * **SSD** + */ +export type DiskType = string; + +/** Known values of {@link DeviceConnectionType} that the service accepts. */ +export enum KnownDeviceConnectionType { + /** PCI */ + PCI = "PCI" +} + +/** + * Defines values for DeviceConnectionType. \ + * {@link KnownDeviceConnectionType} can be used interchangeably with DeviceConnectionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PCI** + */ +export type DeviceConnectionType = string; + +/** Known values of {@link RackSkuProvisioningState} that the service accepts. */ +export enum KnownRackSkuProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded" +} + +/** + * Defines values for RackSkuProvisioningState. \ + * {@link KnownRackSkuProvisioningState} can be used interchangeably with RackSkuProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** + */ +export type RackSkuProvisioningState = string; + +/** Known values of {@link RackSkuType} that the service accepts. */ +export enum KnownRackSkuType { + /** Aggregator */ + Aggregator = "Aggregator", + /** Compute */ + Compute = "Compute", + /** Single */ + Single = "Single" +} + +/** + * Defines values for RackSkuType. \ + * {@link KnownRackSkuType} can be used interchangeably with RackSkuType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Aggregator** \ + * **Compute** \ + * **Single** + */ +export type RackSkuType = string; + +/** Known values of {@link RackDetailedStatus} that the service accepts. */ +export enum KnownRackDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for RackDetailedStatus. \ + * {@link KnownRackDetailedStatus} can be used interchangeably with RackDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** + */ +export type RackDetailedStatus = string; + +/** Known values of {@link RackProvisioningState} that the service accepts. */ +export enum KnownRackProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for RackProvisioningState. \ + * {@link KnownRackProvisioningState} can be used interchangeably with RackProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type RackProvisioningState = string; + +/** Known values of {@link StorageApplianceDetailedStatus} that the service accepts. */ +export enum KnownStorageApplianceDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for StorageApplianceDetailedStatus. \ + * {@link KnownStorageApplianceDetailedStatus} can be used interchangeably with StorageApplianceDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** + */ +export type StorageApplianceDetailedStatus = string; + +/** Known values of {@link StorageApplianceProvisioningState} that the service accepts. */ +export enum KnownStorageApplianceProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for StorageApplianceProvisioningState. \ + * {@link KnownStorageApplianceProvisioningState} can be used interchangeably with StorageApplianceProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type StorageApplianceProvisioningState = string; + +/** Known values of {@link RemoteVendorManagementFeature} that the service accepts. */ +export enum KnownRemoteVendorManagementFeature { + /** Supported */ + Supported = "Supported", + /** Unsupported */ + Unsupported = "Unsupported" +} + +/** + * Defines values for RemoteVendorManagementFeature. \ + * {@link KnownRemoteVendorManagementFeature} can be used interchangeably with RemoteVendorManagementFeature, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Supported** \ + * **Unsupported** + */ +export type RemoteVendorManagementFeature = string; + +/** Known values of {@link RemoteVendorManagementStatus} that the service accepts. */ +export enum KnownRemoteVendorManagementStatus { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", + /** Unsupported */ + Unsupported = "Unsupported" +} + +/** + * Defines values for RemoteVendorManagementStatus. \ + * {@link KnownRemoteVendorManagementStatus} can be used interchangeably with RemoteVendorManagementStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** \ + * **Unsupported** + */ +export type RemoteVendorManagementStatus = string; + +/** Known values of {@link TrunkedNetworkDetailedStatus} that the service accepts. */ +export enum KnownTrunkedNetworkDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for TrunkedNetworkDetailedStatus. \ + * {@link KnownTrunkedNetworkDetailedStatus} can be used interchangeably with TrunkedNetworkDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** + */ +export type TrunkedNetworkDetailedStatus = string; + +/** Known values of {@link TrunkedNetworkProvisioningState} that the service accepts. */ +export enum KnownTrunkedNetworkProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for TrunkedNetworkProvisioningState. \ + * {@link KnownTrunkedNetworkProvisioningState} can be used interchangeably with TrunkedNetworkProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type TrunkedNetworkProvisioningState = string; + +/** Known values of {@link VirtualMachineBootMethod} that the service accepts. */ +export enum KnownVirtualMachineBootMethod { + /** Uefi */ + Uefi = "UEFI", + /** Bios */ + Bios = "BIOS" +} + +/** + * Defines values for VirtualMachineBootMethod. \ + * {@link KnownVirtualMachineBootMethod} can be used interchangeably with VirtualMachineBootMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **UEFI** \ + * **BIOS** + */ +export type VirtualMachineBootMethod = string; + +/** Known values of {@link VirtualMachineDetailedStatus} that the service accepts. */ +export enum KnownVirtualMachineDetailedStatus { + /** Error */ + Error = "Error", + /** Available */ + Available = "Available", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for VirtualMachineDetailedStatus. \ + * {@link KnownVirtualMachineDetailedStatus} can be used interchangeably with VirtualMachineDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Available** \ + * **Provisioning** + */ +export type VirtualMachineDetailedStatus = string; + +/** Known values of {@link VirtualMachineIsolateEmulatorThread} that the service accepts. */ +export enum KnownVirtualMachineIsolateEmulatorThread { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for VirtualMachineIsolateEmulatorThread. \ + * {@link KnownVirtualMachineIsolateEmulatorThread} can be used interchangeably with VirtualMachineIsolateEmulatorThread, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type VirtualMachineIsolateEmulatorThread = string; + +/** Known values of {@link VirtualMachinePlacementHintType} that the service accepts. */ +export enum KnownVirtualMachinePlacementHintType { + /** Affinity */ + Affinity = "Affinity", + /** AntiAffinity */ + AntiAffinity = "AntiAffinity" +} + +/** + * Defines values for VirtualMachinePlacementHintType. \ + * {@link KnownVirtualMachinePlacementHintType} can be used interchangeably with VirtualMachinePlacementHintType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Affinity** \ + * **AntiAffinity** + */ +export type VirtualMachinePlacementHintType = string; + +/** Known values of {@link VirtualMachineSchedulingExecution} that the service accepts. */ +export enum KnownVirtualMachineSchedulingExecution { + /** Hard */ + Hard = "Hard", + /** Soft */ + Soft = "Soft" +} + +/** + * Defines values for VirtualMachineSchedulingExecution. \ + * {@link KnownVirtualMachineSchedulingExecution} can be used interchangeably with VirtualMachineSchedulingExecution, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Hard** \ + * **Soft** + */ +export type VirtualMachineSchedulingExecution = string; + +/** Known values of {@link VirtualMachinePlacementHintPodAffinityScope} that the service accepts. */ +export enum KnownVirtualMachinePlacementHintPodAffinityScope { + /** Rack */ + Rack = "Rack", + /** Machine */ + Machine = "Machine" +} + +/** + * Defines values for VirtualMachinePlacementHintPodAffinityScope. \ + * {@link KnownVirtualMachinePlacementHintPodAffinityScope} can be used interchangeably with VirtualMachinePlacementHintPodAffinityScope, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Rack** \ + * **Machine** + */ +export type VirtualMachinePlacementHintPodAffinityScope = string; + +/** Known values of {@link VirtualMachinePowerState} that the service accepts. */ +export enum KnownVirtualMachinePowerState { + /** On */ + On = "On", + /** Off */ + Off = "Off" +} + +/** + * Defines values for VirtualMachinePowerState. \ + * {@link KnownVirtualMachinePowerState} can be used interchangeably with VirtualMachinePowerState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **On** \ + * **Off** + */ +export type VirtualMachinePowerState = string; + +/** Known values of {@link VirtualMachineProvisioningState} that the service accepts. */ +export enum KnownVirtualMachineProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for VirtualMachineProvisioningState. \ + * {@link KnownVirtualMachineProvisioningState} can be used interchangeably with VirtualMachineProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type VirtualMachineProvisioningState = string; + +/** Known values of {@link OsDiskCreateOption} that the service accepts. */ +export enum KnownOsDiskCreateOption { + /** Ephemeral */ + Ephemeral = "Ephemeral" +} + +/** + * Defines values for OsDiskCreateOption. \ + * {@link KnownOsDiskCreateOption} can be used interchangeably with OsDiskCreateOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Ephemeral** + */ +export type OsDiskCreateOption = string; + +/** Known values of {@link OsDiskDeleteOption} that the service accepts. */ +export enum KnownOsDiskDeleteOption { + /** Delete */ + Delete = "Delete" +} + +/** + * Defines values for OsDiskDeleteOption. \ + * {@link KnownOsDiskDeleteOption} can be used interchangeably with OsDiskDeleteOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Delete** + */ +export type OsDiskDeleteOption = string; + +/** Known values of {@link VirtualMachineVirtioInterfaceType} that the service accepts. */ +export enum KnownVirtualMachineVirtioInterfaceType { + /** Modern */ + Modern = "Modern", + /** Transitional */ + Transitional = "Transitional" +} + +/** + * Defines values for VirtualMachineVirtioInterfaceType. \ + * {@link KnownVirtualMachineVirtioInterfaceType} can be used interchangeably with VirtualMachineVirtioInterfaceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Modern** \ + * **Transitional** + */ +export type VirtualMachineVirtioInterfaceType = string; + +/** Known values of {@link VirtualMachineDeviceModelType} that the service accepts. */ +export enum KnownVirtualMachineDeviceModelType { + /** T1 */ + T1 = "T1", + /** T2 */ + T2 = "T2" +} + +/** + * Defines values for VirtualMachineDeviceModelType. \ + * {@link KnownVirtualMachineDeviceModelType} can be used interchangeably with VirtualMachineDeviceModelType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **T1** \ + * **T2** + */ +export type VirtualMachineDeviceModelType = string; + +/** Known values of {@link VolumeDetailedStatus} that the service accepts. */ +export enum KnownVolumeDetailedStatus { + /** Error */ + Error = "Error", + /** Active */ + Active = "Active", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for VolumeDetailedStatus. \ + * {@link KnownVolumeDetailedStatus} can be used interchangeably with VolumeDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error** \ + * **Active** \ + * **Provisioning** + */ +export type VolumeDetailedStatus = string; + +/** Known values of {@link VolumeProvisioningState} that the service accepts. */ +export enum KnownVolumeProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for VolumeProvisioningState. \ + * {@link KnownVolumeProvisioningState} can be used interchangeably with VolumeProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type VolumeProvisioningState = string; + +/** Known values of {@link BareMetalMachineEvacuate} that the service accepts. */ +export enum KnownBareMetalMachineEvacuate { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for BareMetalMachineEvacuate. \ + * {@link KnownBareMetalMachineEvacuate} can be used interchangeably with BareMetalMachineEvacuate, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type BareMetalMachineEvacuate = string; + +/** Known values of {@link BareMetalMachineSkipShutdown} that the service accepts. */ +export enum KnownBareMetalMachineSkipShutdown { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for BareMetalMachineSkipShutdown. \ + * {@link KnownBareMetalMachineSkipShutdown} can be used interchangeably with BareMetalMachineSkipShutdown, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type BareMetalMachineSkipShutdown = string; + +/** Known values of {@link BareMetalMachineHardwareValidationCategory} that the service accepts. */ +export enum KnownBareMetalMachineHardwareValidationCategory { + /** BasicValidation */ + BasicValidation = "BasicValidation" +} + +/** + * Defines values for BareMetalMachineHardwareValidationCategory. \ + * {@link KnownBareMetalMachineHardwareValidationCategory} can be used interchangeably with BareMetalMachineHardwareValidationCategory, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **BasicValidation** + */ +export type BareMetalMachineHardwareValidationCategory = string; + +/** Known values of {@link BareMetalMachineKeySetDetailedStatus} that the service accepts. */ +export enum KnownBareMetalMachineKeySetDetailedStatus { + /** AllActive */ + AllActive = "AllActive", + /** SomeInvalid */ + SomeInvalid = "SomeInvalid", + /** AllInvalid */ + AllInvalid = "AllInvalid", + /** Validating */ + Validating = "Validating" +} + +/** + * Defines values for BareMetalMachineKeySetDetailedStatus. \ + * {@link KnownBareMetalMachineKeySetDetailedStatus} can be used interchangeably with BareMetalMachineKeySetDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AllActive** \ + * **SomeInvalid** \ + * **AllInvalid** \ + * **Validating** + */ +export type BareMetalMachineKeySetDetailedStatus = string; + +/** Known values of {@link BareMetalMachineKeySetPrivilegeLevel} that the service accepts. */ +export enum KnownBareMetalMachineKeySetPrivilegeLevel { + /** Standard */ + Standard = "Standard", + /** Superuser */ + Superuser = "Superuser" +} + +/** + * Defines values for BareMetalMachineKeySetPrivilegeLevel. \ + * {@link KnownBareMetalMachineKeySetPrivilegeLevel} can be used interchangeably with BareMetalMachineKeySetPrivilegeLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard** \ + * **Superuser** + */ +export type BareMetalMachineKeySetPrivilegeLevel = string; + +/** Known values of {@link BareMetalMachineKeySetProvisioningState} that the service accepts. */ +export enum KnownBareMetalMachineKeySetProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Accepted */ + Accepted = "Accepted", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for BareMetalMachineKeySetProvisioningState. \ + * {@link KnownBareMetalMachineKeySetProvisioningState} can be used interchangeably with BareMetalMachineKeySetProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Accepted** \ + * **Provisioning** + */ +export type BareMetalMachineKeySetProvisioningState = string; + +/** Known values of {@link BareMetalMachineKeySetUserSetupStatus} that the service accepts. */ +export enum KnownBareMetalMachineKeySetUserSetupStatus { + /** Active */ + Active = "Active", + /** Invalid */ + Invalid = "Invalid" +} + +/** + * Defines values for BareMetalMachineKeySetUserSetupStatus. \ + * {@link KnownBareMetalMachineKeySetUserSetupStatus} can be used interchangeably with BareMetalMachineKeySetUserSetupStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **Invalid** + */ +export type BareMetalMachineKeySetUserSetupStatus = string; + +/** Known values of {@link BmcKeySetDetailedStatus} that the service accepts. */ +export enum KnownBmcKeySetDetailedStatus { + /** AllActive */ + AllActive = "AllActive", + /** SomeInvalid */ + SomeInvalid = "SomeInvalid", + /** AllInvalid */ + AllInvalid = "AllInvalid", + /** Validating */ + Validating = "Validating" +} + +/** + * Defines values for BmcKeySetDetailedStatus. \ + * {@link KnownBmcKeySetDetailedStatus} can be used interchangeably with BmcKeySetDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AllActive** \ + * **SomeInvalid** \ + * **AllInvalid** \ + * **Validating** + */ +export type BmcKeySetDetailedStatus = string; + +/** Known values of {@link BmcKeySetPrivilegeLevel} that the service accepts. */ +export enum KnownBmcKeySetPrivilegeLevel { + /** ReadOnly */ + ReadOnly = "ReadOnly", + /** Administrator */ + Administrator = "Administrator" +} + +/** + * Defines values for BmcKeySetPrivilegeLevel. \ + * {@link KnownBmcKeySetPrivilegeLevel} can be used interchangeably with BmcKeySetPrivilegeLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ReadOnly** \ + * **Administrator** + */ +export type BmcKeySetPrivilegeLevel = string; + +/** Known values of {@link BmcKeySetProvisioningState} that the service accepts. */ +export enum KnownBmcKeySetProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Accepted */ + Accepted = "Accepted", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for BmcKeySetProvisioningState. \ + * {@link KnownBmcKeySetProvisioningState} can be used interchangeably with BmcKeySetProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Accepted** \ + * **Provisioning** + */ +export type BmcKeySetProvisioningState = string; + +/** Known values of {@link ClusterMetricsConfigurationDetailedStatus} that the service accepts. */ +export enum KnownClusterMetricsConfigurationDetailedStatus { + /** Processing */ + Processing = "Processing", + /** Applied */ + Applied = "Applied", + /** Error */ + Error = "Error" +} + +/** + * Defines values for ClusterMetricsConfigurationDetailedStatus. \ + * {@link KnownClusterMetricsConfigurationDetailedStatus} can be used interchangeably with ClusterMetricsConfigurationDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Processing** \ + * **Applied** \ + * **Error** + */ +export type ClusterMetricsConfigurationDetailedStatus = string; + +/** Known values of {@link ClusterMetricsConfigurationProvisioningState} that the service accepts. */ +export enum KnownClusterMetricsConfigurationProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Accepted */ + Accepted = "Accepted", + /** Provisioning */ + Provisioning = "Provisioning" +} + +/** + * Defines values for ClusterMetricsConfigurationProvisioningState. \ + * {@link KnownClusterMetricsConfigurationProvisioningState} can be used interchangeably with ClusterMetricsConfigurationProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Accepted** \ + * **Provisioning** + */ +export type ClusterMetricsConfigurationProvisioningState = string; + +/** Known values of {@link StorageApplianceHardwareValidationCategory} that the service accepts. */ +export enum KnownStorageApplianceHardwareValidationCategory { + /** BasicValidation */ + BasicValidation = "BasicValidation" +} + +/** + * Defines values for StorageApplianceHardwareValidationCategory. \ + * {@link KnownStorageApplianceHardwareValidationCategory} can be used interchangeably with StorageApplianceHardwareValidationCategory, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **BasicValidation** + */ +export type StorageApplianceHardwareValidationCategory = string; + +/** Known values of {@link ConsoleDetailedStatus} that the service accepts. */ +export enum KnownConsoleDetailedStatus { + /** Ready */ + Ready = "Ready", + /** Error */ + Error = "Error" +} + +/** + * Defines values for ConsoleDetailedStatus. \ + * {@link KnownConsoleDetailedStatus} can be used interchangeably with ConsoleDetailedStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Ready** \ + * **Error** + */ +export type ConsoleDetailedStatus = string; + +/** Known values of {@link ConsoleEnabled} that the service accepts. */ +export enum KnownConsoleEnabled { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for ConsoleEnabled. \ + * {@link KnownConsoleEnabled} can be used interchangeably with ConsoleEnabled, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type ConsoleEnabled = string; + +/** Known values of {@link ConsoleProvisioningState} that the service accepts. */ +export enum KnownConsoleProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Provisioning */ + Provisioning = "Provisioning", + /** Accepted */ + Accepted = "Accepted" +} + +/** + * Defines values for ConsoleProvisioningState. \ + * {@link KnownConsoleProvisioningState} can be used interchangeably with ConsoleProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Provisioning** \ + * **Accepted** + */ +export type ConsoleProvisioningState = string; + +/** Known values of {@link SkipShutdown} that the service accepts. */ +export enum KnownSkipShutdown { + /** True */ + True = "True", + /** False */ + False = "False" +} + +/** + * Defines values for SkipShutdown. \ + * {@link KnownSkipShutdown} can be used interchangeably with SkipShutdown, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **True** \ + * **False** + */ +export type SkipShutdown = string; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface BareMetalMachinesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type BareMetalMachinesListBySubscriptionResponse = BareMetalMachineList; + +/** Optional parameters. */ +export interface BareMetalMachinesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type BareMetalMachinesListByResourceGroupResponse = BareMetalMachineList; + +/** Optional parameters. */ +export interface BareMetalMachinesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BareMetalMachinesGetResponse = BareMetalMachine; + +/** Optional parameters. */ +export interface BareMetalMachinesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type BareMetalMachinesCreateOrUpdateResponse = BareMetalMachine; + +/** Optional parameters. */ +export interface BareMetalMachinesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface BareMetalMachinesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + bareMetalMachineUpdateParameters?: BareMetalMachinePatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type BareMetalMachinesUpdateResponse = BareMetalMachine; + +/** Optional parameters. */ +export interface BareMetalMachinesCordonOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + bareMetalMachineCordonParameters?: BareMetalMachineCordonParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the cordon operation. */ +export type BareMetalMachinesCordonResponse = BareMetalMachinesCordonHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesPowerOffOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + bareMetalMachinePowerOffParameters?: BareMetalMachinePowerOffParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the powerOff operation. */ +export type BareMetalMachinesPowerOffResponse = BareMetalMachinesPowerOffHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesReimageOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the reimage operation. */ +export type BareMetalMachinesReimageResponse = BareMetalMachinesReimageHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesReplaceOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + bareMetalMachineReplaceParameters?: BareMetalMachineReplaceParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the replace operation. */ +export type BareMetalMachinesReplaceResponse = BareMetalMachinesReplaceHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesRestartOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the restart operation. */ +export type BareMetalMachinesRestartResponse = BareMetalMachinesRestartHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesRunCommandOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the runCommand operation. */ +export type BareMetalMachinesRunCommandResponse = BareMetalMachinesRunCommandHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesRunDataExtractsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the runDataExtracts operation. */ +export type BareMetalMachinesRunDataExtractsResponse = BareMetalMachinesRunDataExtractsHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesRunReadCommandsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the runReadCommands operation. */ +export type BareMetalMachinesRunReadCommandsResponse = BareMetalMachinesRunReadCommandsHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesStartOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the start operation. */ +export type BareMetalMachinesStartResponse = BareMetalMachinesStartHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesUncordonOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the uncordon operation. */ +export type BareMetalMachinesUncordonResponse = BareMetalMachinesUncordonHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesValidateHardwareOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the validateHardware operation. */ +export type BareMetalMachinesValidateHardwareResponse = BareMetalMachinesValidateHardwareHeaders; + +/** Optional parameters. */ +export interface BareMetalMachinesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type BareMetalMachinesListBySubscriptionNextResponse = BareMetalMachineList; + +/** Optional parameters. */ +export interface BareMetalMachinesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type BareMetalMachinesListByResourceGroupNextResponse = BareMetalMachineList; + +/** Optional parameters. */ +export interface CloudServicesNetworksListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type CloudServicesNetworksListBySubscriptionResponse = CloudServicesNetworkList; + +/** Optional parameters. */ +export interface CloudServicesNetworksListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type CloudServicesNetworksListByResourceGroupResponse = CloudServicesNetworkList; + +/** Optional parameters. */ +export interface CloudServicesNetworksGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CloudServicesNetworksGetResponse = CloudServicesNetwork; + +/** Optional parameters. */ +export interface CloudServicesNetworksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type CloudServicesNetworksCreateOrUpdateResponse = CloudServicesNetwork; + +/** Optional parameters. */ +export interface CloudServicesNetworksDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface CloudServicesNetworksUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + cloudServicesNetworkUpdateParameters?: CloudServicesNetworkPatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type CloudServicesNetworksUpdateResponse = CloudServicesNetwork; + +/** Optional parameters. */ +export interface CloudServicesNetworksListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type CloudServicesNetworksListBySubscriptionNextResponse = CloudServicesNetworkList; + +/** Optional parameters. */ +export interface CloudServicesNetworksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type CloudServicesNetworksListByResourceGroupNextResponse = CloudServicesNetworkList; + +/** Optional parameters. */ +export interface ClusterManagersListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type ClusterManagersListBySubscriptionResponse = ClusterManagerList; + +/** Optional parameters. */ +export interface ClusterManagersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ClusterManagersListByResourceGroupResponse = ClusterManagerList; + +/** Optional parameters. */ +export interface ClusterManagersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ClusterManagersGetResponse = ClusterManager; + +/** Optional parameters. */ +export interface ClusterManagersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ClusterManagersCreateOrUpdateResponse = ClusterManager; + +/** Optional parameters. */ +export interface ClusterManagersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ClusterManagersUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + clusterManagerUpdateParameters?: ClusterManagerPatchParameters; +} + +/** Contains response data for the update operation. */ +export type ClusterManagersUpdateResponse = ClusterManager; + +/** Optional parameters. */ +export interface ClusterManagersListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ClusterManagersListBySubscriptionNextResponse = ClusterManagerList; + +/** Optional parameters. */ +export interface ClusterManagersListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ClusterManagersListByResourceGroupNextResponse = ClusterManagerList; + +/** Optional parameters. */ +export interface ClustersListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type ClustersListBySubscriptionResponse = ClusterList; + +/** Optional parameters. */ +export interface ClustersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ClustersListByResourceGroupResponse = ClusterList; + +/** Optional parameters. */ +export interface ClustersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ClustersGetResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ClustersCreateOrUpdateResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ClustersUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + clusterUpdateParameters?: ClusterPatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ClustersUpdateResponse = Cluster; + +/** Optional parameters. */ +export interface ClustersDeployOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + clusterDeployParameters?: ClusterDeployParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the deploy operation. */ +export type ClustersDeployResponse = ClustersDeployHeaders; + +/** Optional parameters. */ +export interface ClustersUpdateVersionOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the updateVersion operation. */ +export type ClustersUpdateVersionResponse = ClustersUpdateVersionHeaders; + +/** Optional parameters. */ +export interface ClustersListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ClustersListBySubscriptionNextResponse = ClusterList; + +/** Optional parameters. */ +export interface ClustersListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ClustersListByResourceGroupNextResponse = ClusterList; + +/** Optional parameters. */ +export interface DefaultCniNetworksListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type DefaultCniNetworksListBySubscriptionResponse = DefaultCniNetworkList; + +/** Optional parameters. */ +export interface DefaultCniNetworksListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type DefaultCniNetworksListByResourceGroupResponse = DefaultCniNetworkList; + +/** Optional parameters. */ +export interface DefaultCniNetworksGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DefaultCniNetworksGetResponse = DefaultCniNetwork; + +/** Optional parameters. */ +export interface DefaultCniNetworksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type DefaultCniNetworksCreateOrUpdateResponse = DefaultCniNetwork; + +/** Optional parameters. */ +export interface DefaultCniNetworksDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface DefaultCniNetworksUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + defaultCniNetworkUpdateParameters?: DefaultCniNetworkPatchParameters; +} + +/** Contains response data for the update operation. */ +export type DefaultCniNetworksUpdateResponse = DefaultCniNetwork; + +/** Optional parameters. */ +export interface DefaultCniNetworksListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type DefaultCniNetworksListBySubscriptionNextResponse = DefaultCniNetworkList; + +/** Optional parameters. */ +export interface DefaultCniNetworksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type DefaultCniNetworksListByResourceGroupNextResponse = DefaultCniNetworkList; + +/** Optional parameters. */ +export interface HybridAksClustersListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type HybridAksClustersListBySubscriptionResponse = HybridAksClusterList; + +/** Optional parameters. */ +export interface HybridAksClustersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type HybridAksClustersListByResourceGroupResponse = HybridAksClusterList; + +/** Optional parameters. */ +export interface HybridAksClustersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type HybridAksClustersGetResponse = HybridAksCluster; + +/** Optional parameters. */ +export interface HybridAksClustersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type HybridAksClustersCreateOrUpdateResponse = HybridAksCluster; + +/** Optional parameters. */ +export interface HybridAksClustersDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface HybridAksClustersUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + hybridAksClusterUpdateParameters?: HybridAksClusterPatchParameters; +} + +/** Contains response data for the update operation. */ +export type HybridAksClustersUpdateResponse = HybridAksCluster; + +/** Optional parameters. */ +export interface HybridAksClustersRestartNodeOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the restartNode operation. */ +export type HybridAksClustersRestartNodeResponse = HybridAksClustersRestartNodeHeaders; + +/** Optional parameters. */ +export interface HybridAksClustersListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type HybridAksClustersListBySubscriptionNextResponse = HybridAksClusterList; + +/** Optional parameters. */ +export interface HybridAksClustersListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type HybridAksClustersListByResourceGroupNextResponse = HybridAksClusterList; + +/** Optional parameters. */ +export interface L2NetworksListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type L2NetworksListBySubscriptionResponse = L2NetworkList; + +/** Optional parameters. */ +export interface L2NetworksListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type L2NetworksListByResourceGroupResponse = L2NetworkList; + +/** Optional parameters. */ +export interface L2NetworksGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type L2NetworksGetResponse = L2Network; + +/** Optional parameters. */ +export interface L2NetworksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type L2NetworksCreateOrUpdateResponse = L2Network; + +/** Optional parameters. */ +export interface L2NetworksDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface L2NetworksUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + l2NetworkUpdateParameters?: L2NetworkPatchParameters; +} + +/** Contains response data for the update operation. */ +export type L2NetworksUpdateResponse = L2Network; + +/** Optional parameters. */ +export interface L2NetworksListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type L2NetworksListBySubscriptionNextResponse = L2NetworkList; + +/** Optional parameters. */ +export interface L2NetworksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type L2NetworksListByResourceGroupNextResponse = L2NetworkList; + +/** Optional parameters. */ +export interface L3NetworksListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type L3NetworksListBySubscriptionResponse = L3NetworkList; + +/** Optional parameters. */ +export interface L3NetworksListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type L3NetworksListByResourceGroupResponse = L3NetworkList; + +/** Optional parameters. */ +export interface L3NetworksGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type L3NetworksGetResponse = L3Network; + +/** Optional parameters. */ +export interface L3NetworksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type L3NetworksCreateOrUpdateResponse = L3Network; + +/** Optional parameters. */ +export interface L3NetworksDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface L3NetworksUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + l3NetworkUpdateParameters?: L3NetworkPatchParameters; +} + +/** Contains response data for the update operation. */ +export type L3NetworksUpdateResponse = L3Network; + +/** Optional parameters. */ +export interface L3NetworksListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type L3NetworksListBySubscriptionNextResponse = L3NetworkList; + +/** Optional parameters. */ +export interface L3NetworksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type L3NetworksListByResourceGroupNextResponse = L3NetworkList; + +/** Optional parameters. */ +export interface RackSkusListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type RackSkusListBySubscriptionResponse = RackSkuList; + +/** Optional parameters. */ +export interface RackSkusGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type RackSkusGetResponse = RackSku; + +/** Optional parameters. */ +export interface RackSkusListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type RackSkusListBySubscriptionNextResponse = RackSkuList; + +/** Optional parameters. */ +export interface RacksListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type RacksListBySubscriptionResponse = RackList; + +/** Optional parameters. */ +export interface RacksListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type RacksListByResourceGroupResponse = RackList; + +/** Optional parameters. */ +export interface RacksGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type RacksGetResponse = Rack; + +/** Optional parameters. */ +export interface RacksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type RacksCreateOrUpdateResponse = Rack; + +/** Optional parameters. */ +export interface RacksDeleteOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface RacksUpdateOptionalParams extends coreClient.OperationOptions { + /** The request body. */ + rackUpdateParameters?: RackPatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type RacksUpdateResponse = Rack; + +/** Optional parameters. */ +export interface RacksListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type RacksListBySubscriptionNextResponse = RackList; + +/** Optional parameters. */ +export interface RacksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type RacksListByResourceGroupNextResponse = RackList; + +/** Optional parameters. */ +export interface StorageAppliancesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type StorageAppliancesListBySubscriptionResponse = StorageApplianceList; + +/** Optional parameters. */ +export interface StorageAppliancesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type StorageAppliancesListByResourceGroupResponse = StorageApplianceList; + +/** Optional parameters. */ +export interface StorageAppliancesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type StorageAppliancesGetResponse = StorageAppliance; + +/** Optional parameters. */ +export interface StorageAppliancesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type StorageAppliancesCreateOrUpdateResponse = StorageAppliance; + +/** Optional parameters. */ +export interface StorageAppliancesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface StorageAppliancesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + storageApplianceUpdateParameters?: StorageAppliancePatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type StorageAppliancesUpdateResponse = StorageAppliance; + +/** Optional parameters. */ +export interface StorageAppliancesDisableRemoteVendorManagementOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the disableRemoteVendorManagement operation. */ +export type StorageAppliancesDisableRemoteVendorManagementResponse = StorageAppliancesDisableRemoteVendorManagementHeaders; + +/** Optional parameters. */ +export interface StorageAppliancesEnableRemoteVendorManagementOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + storageApplianceEnableRemoteVendorManagementParameters?: StorageApplianceEnableRemoteVendorManagementParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the enableRemoteVendorManagement operation. */ +export type StorageAppliancesEnableRemoteVendorManagementResponse = StorageAppliancesEnableRemoteVendorManagementHeaders; + +/** Optional parameters. */ +export interface StorageAppliancesRunReadCommandsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the runReadCommands operation. */ +export type StorageAppliancesRunReadCommandsResponse = StorageAppliancesRunReadCommandsHeaders; + +/** Optional parameters. */ +export interface StorageAppliancesValidateHardwareOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the validateHardware operation. */ +export type StorageAppliancesValidateHardwareResponse = StorageAppliancesValidateHardwareHeaders; + +/** Optional parameters. */ +export interface StorageAppliancesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type StorageAppliancesListBySubscriptionNextResponse = StorageApplianceList; + +/** Optional parameters. */ +export interface StorageAppliancesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type StorageAppliancesListByResourceGroupNextResponse = StorageApplianceList; + +/** Optional parameters. */ +export interface TrunkedNetworksListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type TrunkedNetworksListBySubscriptionResponse = TrunkedNetworkList; + +/** Optional parameters. */ +export interface TrunkedNetworksListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type TrunkedNetworksListByResourceGroupResponse = TrunkedNetworkList; + +/** Optional parameters. */ +export interface TrunkedNetworksGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TrunkedNetworksGetResponse = TrunkedNetwork; + +/** Optional parameters. */ +export interface TrunkedNetworksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type TrunkedNetworksCreateOrUpdateResponse = TrunkedNetwork; + +/** Optional parameters. */ +export interface TrunkedNetworksDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface TrunkedNetworksUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + trunkedNetworkUpdateParameters?: TrunkedNetworkPatchParameters; +} + +/** Contains response data for the update operation. */ +export type TrunkedNetworksUpdateResponse = TrunkedNetwork; + +/** Optional parameters. */ +export interface TrunkedNetworksListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type TrunkedNetworksListBySubscriptionNextResponse = TrunkedNetworkList; + +/** Optional parameters. */ +export interface TrunkedNetworksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type TrunkedNetworksListByResourceGroupNextResponse = TrunkedNetworkList; + +/** Optional parameters. */ +export interface VirtualMachinesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type VirtualMachinesListBySubscriptionResponse = VirtualMachineList; + +/** Optional parameters. */ +export interface VirtualMachinesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type VirtualMachinesListByResourceGroupResponse = VirtualMachineList; + +/** Optional parameters. */ +export interface VirtualMachinesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VirtualMachinesGetResponse = VirtualMachine; + +/** Optional parameters. */ +export interface VirtualMachinesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type VirtualMachinesCreateOrUpdateResponse = VirtualMachine; + +/** Optional parameters. */ +export interface VirtualMachinesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface VirtualMachinesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + virtualMachineUpdateParameters?: VirtualMachinePatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type VirtualMachinesUpdateResponse = VirtualMachine; + +/** Optional parameters. */ +export interface VirtualMachinesAttachVolumeOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the attachVolume operation. */ +export type VirtualMachinesAttachVolumeResponse = VirtualMachinesAttachVolumeHeaders; + +/** Optional parameters. */ +export interface VirtualMachinesDetachVolumeOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the detachVolume operation. */ +export type VirtualMachinesDetachVolumeResponse = VirtualMachinesDetachVolumeHeaders; + +/** Optional parameters. */ +export interface VirtualMachinesPowerOffOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + virtualMachinePowerOffParameters?: VirtualMachinePowerOffParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the powerOff operation. */ +export type VirtualMachinesPowerOffResponse = VirtualMachinesPowerOffHeaders; + +/** Optional parameters. */ +export interface VirtualMachinesReimageOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the reimage operation. */ +export type VirtualMachinesReimageResponse = VirtualMachinesReimageHeaders; + +/** Optional parameters. */ +export interface VirtualMachinesRestartOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the restart operation. */ +export type VirtualMachinesRestartResponse = VirtualMachinesRestartHeaders; + +/** Optional parameters. */ +export interface VirtualMachinesStartOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the start operation. */ +export type VirtualMachinesStartResponse = VirtualMachinesStartHeaders; + +/** Optional parameters. */ +export interface VirtualMachinesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type VirtualMachinesListBySubscriptionNextResponse = VirtualMachineList; + +/** Optional parameters. */ +export interface VirtualMachinesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type VirtualMachinesListByResourceGroupNextResponse = VirtualMachineList; + +/** Optional parameters. */ +export interface VolumesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type VolumesListBySubscriptionResponse = VolumeList; + +/** Optional parameters. */ +export interface VolumesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type VolumesListByResourceGroupResponse = VolumeList; + +/** Optional parameters. */ +export interface VolumesGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VolumesGetResponse = Volume; + +/** Optional parameters. */ +export interface VolumesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type VolumesCreateOrUpdateResponse = Volume; + +/** Optional parameters. */ +export interface VolumesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface VolumesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + volumeUpdateParameters?: VolumePatchParameters; +} + +/** Contains response data for the update operation. */ +export type VolumesUpdateResponse = Volume; + +/** Optional parameters. */ +export interface VolumesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type VolumesListBySubscriptionNextResponse = VolumeList; + +/** Optional parameters. */ +export interface VolumesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type VolumesListByResourceGroupNextResponse = VolumeList; + +/** Optional parameters. */ +export interface BareMetalMachineKeySetsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type BareMetalMachineKeySetsListByResourceGroupResponse = BareMetalMachineKeySetList; + +/** Optional parameters. */ +export interface BareMetalMachineKeySetsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BareMetalMachineKeySetsGetResponse = BareMetalMachineKeySet; + +/** Optional parameters. */ +export interface BareMetalMachineKeySetsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type BareMetalMachineKeySetsCreateOrUpdateResponse = BareMetalMachineKeySet; + +/** Optional parameters. */ +export interface BareMetalMachineKeySetsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface BareMetalMachineKeySetsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + bareMetalMachineKeySetUpdateParameters?: BareMetalMachineKeySetPatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type BareMetalMachineKeySetsUpdateResponse = BareMetalMachineKeySet; + +/** Optional parameters. */ +export interface BareMetalMachineKeySetsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type BareMetalMachineKeySetsListByResourceGroupNextResponse = BareMetalMachineKeySetList; + +/** Optional parameters. */ +export interface BmcKeySetsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type BmcKeySetsListByResourceGroupResponse = BmcKeySetList; + +/** Optional parameters. */ +export interface BmcKeySetsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BmcKeySetsGetResponse = BmcKeySet; + +/** Optional parameters. */ +export interface BmcKeySetsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type BmcKeySetsCreateOrUpdateResponse = BmcKeySet; + +/** Optional parameters. */ +export interface BmcKeySetsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface BmcKeySetsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + bmcKeySetUpdateParameters?: BmcKeySetPatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type BmcKeySetsUpdateResponse = BmcKeySet; + +/** Optional parameters. */ +export interface BmcKeySetsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type BmcKeySetsListByResourceGroupNextResponse = BmcKeySetList; + +/** Optional parameters. */ +export interface MetricsConfigurationsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type MetricsConfigurationsListByResourceGroupResponse = ClusterMetricsConfigurationList; + +/** Optional parameters. */ +export interface MetricsConfigurationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MetricsConfigurationsGetResponse = ClusterMetricsConfiguration; + +/** Optional parameters. */ +export interface MetricsConfigurationsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type MetricsConfigurationsCreateOrUpdateResponse = ClusterMetricsConfiguration; + +/** Optional parameters. */ +export interface MetricsConfigurationsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface MetricsConfigurationsUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + metricsConfigurationUpdateParameters?: ClusterMetricsConfigurationPatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type MetricsConfigurationsUpdateResponse = ClusterMetricsConfiguration; + +/** Optional parameters. */ +export interface MetricsConfigurationsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type MetricsConfigurationsListByResourceGroupNextResponse = ClusterMetricsConfigurationList; + +/** Optional parameters. */ +export interface ConsolesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ConsolesListByResourceGroupResponse = ConsoleList; + +/** Optional parameters. */ +export interface ConsolesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ConsolesGetResponse = Console; + +/** Optional parameters. */ +export interface ConsolesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ConsolesCreateOrUpdateResponse = Console; + +/** Optional parameters. */ +export interface ConsolesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ConsolesUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request body. */ + consoleUpdateParameters?: ConsolePatchParameters; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ConsolesUpdateResponse = Console; + +/** Optional parameters. */ +export interface ConsolesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ConsolesListByResourceGroupNextResponse = ConsoleList; + +/** Optional parameters. */ +export interface NetworkCloudOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/models/mappers.ts b/sdk/networkcloud/arm-networkcloud/src/models/mappers.ts new file mode 100644 index 000000000000..9a9d1d7437f8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/models/mappers.ts @@ -0,0 +1,6314 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const BareMetalMachineList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BareMetalMachine" + } + } + } + } + } + } +}; + +export const ExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtendedLocation", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const AdministrativeCredentials: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AdministrativeCredentials", + modelProperties: { + password: { + constraints: { + MinLength: 1 + }, + serializedName: "password", + required: true, + type: { + name: "String" + } + }, + username: { + constraints: { + MinLength: 1 + }, + serializedName: "username", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const HardwareInventory: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HardwareInventory", + modelProperties: { + additionalHostInformation: { + serializedName: "additionalHostInformation", + readOnly: true, + type: { + name: "String" + } + }, + interfaces: { + serializedName: "interfaces", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HardwareInventoryNetworkInterface" + } + } + } + }, + nics: { + serializedName: "nics", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Nic" + } + } + } + } + } + } +}; + +export const HardwareInventoryNetworkInterface: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HardwareInventoryNetworkInterface", + modelProperties: { + linkStatus: { + serializedName: "linkStatus", + readOnly: true, + type: { + name: "String" + } + }, + macAddress: { + serializedName: "macAddress", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + networkInterfaceId: { + serializedName: "networkInterfaceId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Nic: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Nic", + modelProperties: { + lldpNeighbor: { + serializedName: "lldpNeighbor", + type: { + name: "Composite", + className: "LldpNeighbor" + } + }, + macAddress: { + serializedName: "macAddress", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const LldpNeighbor: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LldpNeighbor", + modelProperties: { + portDescription: { + serializedName: "portDescription", + readOnly: true, + type: { + name: "String" + } + }, + portName: { + serializedName: "portName", + readOnly: true, + type: { + name: "String" + } + }, + systemDescription: { + serializedName: "systemDescription", + readOnly: true, + type: { + name: "String" + } + }, + systemName: { + serializedName: "systemName", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const HardwareValidationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HardwareValidationStatus", + modelProperties: { + lastValidationTime: { + serializedName: "lastValidationTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + result: { + serializedName: "result", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const CloudServicesNetworkList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudServicesNetworkList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CloudServicesNetwork" + } + } + } + } + } + } +}; + +export const EgressEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EgressEndpoint", + modelProperties: { + category: { + serializedName: "category", + required: true, + type: { + name: "String" + } + }, + endpoints: { + constraints: { + MinItems: 1 + }, + serializedName: "endpoints", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EndpointDependency" + } + } + } + } + } + } +}; + +export const EndpointDependency: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EndpointDependency", + modelProperties: { + domainName: { + serializedName: "domainName", + required: true, + type: { + name: "String" + } + }, + port: { + constraints: { + InclusiveMaximum: 65535, + InclusiveMinimum: 1 + }, + serializedName: "port", + type: { + name: "Number" + } + } + } + } +}; + +export const ClusterManagerList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterManagerList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClusterManager" + } + } + } + } + } + } +}; + +export const ClusterAvailableVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterAvailableVersion", + modelProperties: { + supportExpiryDate: { + serializedName: "supportExpiryDate", + readOnly: true, + type: { + name: "String" + } + }, + targetClusterVersion: { + serializedName: "targetClusterVersion", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ManagedResourceGroupConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedResourceGroupConfiguration", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + name: { + constraints: { + MaxLength: 75 + }, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const ClusterList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Cluster" + } + } + } + } + } + } +}; + +export const RackDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RackDefinition", + modelProperties: { + availabilityZone: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]{1,10}$") + }, + serializedName: "availabilityZone", + type: { + name: "String" + } + }, + bareMetalMachineConfigurationData: { + serializedName: "bareMetalMachineConfigurationData", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BareMetalMachineConfigurationData" + } + } + } + }, + networkRackId: { + serializedName: "networkRackId", + required: true, + type: { + name: "String" + } + }, + rackLocation: { + constraints: { + MaxLength: 256 + }, + serializedName: "rackLocation", + type: { + name: "String" + } + }, + rackSerialNumber: { + constraints: { + MaxLength: 64, + MinLength: 1 + }, + serializedName: "rackSerialNumber", + required: true, + type: { + name: "String" + } + }, + rackSkuId: { + serializedName: "rackSkuId", + required: true, + type: { + name: "String" + } + }, + storageApplianceConfigurationData: { + serializedName: "storageApplianceConfigurationData", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageApplianceConfigurationData" + } + } + } + } + } + } +}; + +export const BareMetalMachineConfigurationData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineConfigurationData", + modelProperties: { + bmcConnectionString: { + serializedName: "bmcConnectionString", + readOnly: true, + type: { + name: "String" + } + }, + bmcCredentials: { + serializedName: "bmcCredentials", + type: { + name: "Composite", + className: "AdministrativeCredentials" + } + }, + bmcMacAddress: { + constraints: { + Pattern: new RegExp("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$") + }, + serializedName: "bmcMacAddress", + required: true, + type: { + name: "String" + } + }, + bootMacAddress: { + constraints: { + Pattern: new RegExp("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$") + }, + serializedName: "bootMacAddress", + required: true, + type: { + name: "String" + } + }, + machineDetails: { + constraints: { + MaxLength: 256 + }, + serializedName: "machineDetails", + type: { + name: "String" + } + }, + machineName: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$") + }, + serializedName: "machineName", + type: { + name: "String" + } + }, + rackSlot: { + constraints: { + InclusiveMaximum: 256, + InclusiveMinimum: 1 + }, + serializedName: "rackSlot", + required: true, + type: { + name: "Number" + } + }, + serialNumber: { + constraints: { + MaxLength: 64 + }, + serializedName: "serialNumber", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageApplianceConfigurationData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageApplianceConfigurationData", + modelProperties: { + adminCredentials: { + serializedName: "adminCredentials", + type: { + name: "Composite", + className: "AdministrativeCredentials" + } + }, + rackSlot: { + constraints: { + InclusiveMaximum: 256, + InclusiveMinimum: 1 + }, + serializedName: "rackSlot", + required: true, + type: { + name: "Number" + } + }, + serialNumber: { + serializedName: "serialNumber", + required: true, + type: { + name: "String" + } + }, + storageApplianceName: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "storageApplianceName", + type: { + name: "String" + } + } + } + } +}; + +export const ClusterAvailableUpgradeVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterAvailableUpgradeVersion", + modelProperties: { + controlImpact: { + serializedName: "controlImpact", + readOnly: true, + type: { + name: "String" + } + }, + expectedDuration: { + serializedName: "expectedDuration", + readOnly: true, + type: { + name: "String" + } + }, + impactDescription: { + serializedName: "impactDescription", + readOnly: true, + type: { + name: "String" + } + }, + supportExpiryDate: { + serializedName: "supportExpiryDate", + readOnly: true, + type: { + name: "String" + } + }, + targetClusterVersion: { + serializedName: "targetClusterVersion", + readOnly: true, + type: { + name: "String" + } + }, + workloadImpact: { + serializedName: "workloadImpact", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ClusterCapacity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterCapacity", + modelProperties: { + availableApplianceStorageGB: { + serializedName: "availableApplianceStorageGB", + type: { + name: "Number" + } + }, + availableCoreCount: { + serializedName: "availableCoreCount", + type: { + name: "Number" + } + }, + availableHostStorageGB: { + serializedName: "availableHostStorageGB", + type: { + name: "Number" + } + }, + availableMemoryGB: { + serializedName: "availableMemoryGB", + type: { + name: "Number" + } + }, + totalApplianceStorageGB: { + serializedName: "totalApplianceStorageGB", + type: { + name: "Number" + } + }, + totalCoreCount: { + serializedName: "totalCoreCount", + type: { + name: "Number" + } + }, + totalHostStorageGB: { + serializedName: "totalHostStorageGB", + type: { + name: "Number" + } + }, + totalMemoryGB: { + serializedName: "totalMemoryGB", + type: { + name: "Number" + } + } + } + } +}; + +export const ServicePrincipalInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServicePrincipalInformation", + modelProperties: { + applicationId: { + serializedName: "applicationId", + required: true, + type: { + name: "String" + } + }, + password: { + serializedName: "password", + required: true, + type: { + name: "String" + } + }, + principalId: { + serializedName: "principalId", + required: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ValidationThreshold: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidationThreshold", + modelProperties: { + grouping: { + serializedName: "grouping", + required: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + value: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "value", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const DefaultCniNetworkList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DefaultCniNetworkList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DefaultCniNetwork" + } + } + } + } + } + } +}; + +export const CniBgpConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CniBgpConfiguration", + modelProperties: { + bgpPeers: { + serializedName: "bgpPeers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BgpPeer" + } + } + } + }, + communityAdvertisements: { + serializedName: "communityAdvertisements", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommunityAdvertisement" + } + } + } + }, + nodeMeshPassword: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]{0,80}$"), + MaxLength: 80 + }, + serializedName: "nodeMeshPassword", + type: { + name: "String" + } + }, + serviceExternalPrefixes: { + serializedName: "serviceExternalPrefixes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + serviceLoadBalancerPrefixes: { + serializedName: "serviceLoadBalancerPrefixes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const BgpPeer: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BgpPeer", + modelProperties: { + asNumber: { + constraints: { + InclusiveMaximum: 4294967295, + InclusiveMinimum: 0 + }, + serializedName: "asNumber", + required: true, + type: { + name: "Number" + } + }, + password: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]{0,80}$"), + MaxLength: 80 + }, + serializedName: "password", + type: { + name: "String" + } + }, + peerIp: { + serializedName: "peerIp", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const CommunityAdvertisement: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityAdvertisement", + modelProperties: { + communities: { + serializedName: "communities", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + subnetPrefix: { + serializedName: "subnetPrefix", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const HybridAksClusterList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridAksClusterList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HybridAksCluster" + } + } + } + } + } + } +}; + +export const NodeConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NodeConfiguration", + modelProperties: { + agentPoolId: { + serializedName: "agentPoolId", + readOnly: true, + type: { + name: "String" + } + }, + agentPoolName: { + serializedName: "agentPoolName", + readOnly: true, + type: { + name: "String" + } + }, + cpuCores: { + serializedName: "cpuCores", + readOnly: true, + type: { + name: "Number" + } + }, + diskSizeGB: { + serializedName: "diskSizeGB", + readOnly: true, + type: { + name: "Number" + } + }, + memorySizeGB: { + serializedName: "memorySizeGB", + readOnly: true, + type: { + name: "Number" + } + }, + nodePoolName: { + serializedName: "nodePoolName", + readOnly: true, + type: { + name: "String" + } + }, + nodes: { + serializedName: "nodes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Node" + } + } + } + }, + vmCount: { + serializedName: "vmCount", + readOnly: true, + type: { + name: "Number" + } + }, + vmSize: { + serializedName: "vmSize", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Node: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Node", + modelProperties: { + bareMetalMachineId: { + serializedName: "bareMetalMachineId", + readOnly: true, + type: { + name: "String" + } + }, + imageId: { + serializedName: "imageId", + readOnly: true, + type: { + name: "String" + } + }, + networkAttachments: { + serializedName: "networkAttachments", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkAttachment" + } + } + } + }, + nodeName: { + serializedName: "nodeName", + readOnly: true, + type: { + name: "String" + } + }, + powerState: { + serializedName: "powerState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkAttachment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkAttachment", + modelProperties: { + attachedNetworkId: { + serializedName: "attachedNetworkId", + required: true, + type: { + name: "String" + } + }, + defaultGateway: { + serializedName: "defaultGateway", + type: { + name: "String" + } + }, + ipAllocationMethod: { + serializedName: "ipAllocationMethod", + required: true, + type: { + name: "String" + } + }, + ipv4Address: { + serializedName: "ipv4Address", + type: { + name: "String" + } + }, + ipv6Address: { + serializedName: "ipv6Address", + type: { + name: "String" + } + }, + macAddress: { + serializedName: "macAddress", + readOnly: true, + type: { + name: "String" + } + }, + networkAttachmentName: { + constraints: { + MaxLength: 15 + }, + serializedName: "networkAttachmentName", + type: { + name: "String" + } + } + } + } +}; + +export const L2NetworkList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L2NetworkList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "L2Network" + } + } + } + } + } + } +}; + +export const L3NetworkList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L3NetworkList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "L3Network" + } + } + } + } + } + } +}; + +export const RackSkuList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RackSkuList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RackSku" + } + } + } + } + } + } +}; + +export const MachineSkuSlot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineSkuSlot", + modelProperties: { + rackSlot: { + serializedName: "rackSlot", + readOnly: true, + type: { + name: "Number" + } + }, + bootstrapProtocol: { + serializedName: "properties.bootstrapProtocol", + readOnly: true, + type: { + name: "String" + } + }, + cpuCores: { + serializedName: "properties.cpuCores", + readOnly: true, + type: { + name: "Number" + } + }, + cpuSockets: { + serializedName: "properties.cpuSockets", + readOnly: true, + type: { + name: "Number" + } + }, + disks: { + serializedName: "properties.disks", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MachineDisk" + } + } + } + }, + generation: { + serializedName: "properties.generation", + readOnly: true, + type: { + name: "String" + } + }, + hardwareVersion: { + serializedName: "properties.hardwareVersion", + readOnly: true, + type: { + name: "String" + } + }, + memoryCapacityGB: { + serializedName: "properties.memoryCapacityGB", + readOnly: true, + type: { + name: "Number" + } + }, + model: { + serializedName: "properties.model", + readOnly: true, + type: { + name: "String" + } + }, + networkInterfaces: { + serializedName: "properties.networkInterfaces", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkInterface" + } + } + } + }, + totalThreads: { + serializedName: "properties.totalThreads", + readOnly: true, + type: { + name: "Number" + } + }, + vendor: { + serializedName: "properties.vendor", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MachineDisk: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineDisk", + modelProperties: { + capacityGB: { + serializedName: "capacityGB", + readOnly: true, + type: { + name: "Number" + } + }, + connection: { + serializedName: "connection", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkInterface: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkInterface", + modelProperties: { + address: { + serializedName: "address", + readOnly: true, + type: { + name: "String" + } + }, + deviceConnectionType: { + serializedName: "deviceConnectionType", + readOnly: true, + type: { + name: "String" + } + }, + model: { + serializedName: "model", + readOnly: true, + type: { + name: "String" + } + }, + physicalSlot: { + serializedName: "physicalSlot", + readOnly: true, + type: { + name: "Number" + } + }, + portCount: { + serializedName: "portCount", + readOnly: true, + type: { + name: "Number" + } + }, + portSpeed: { + serializedName: "portSpeed", + readOnly: true, + type: { + name: "Number" + } + }, + vendor: { + serializedName: "vendor", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageApplianceSkuSlot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageApplianceSkuSlot", + modelProperties: { + rackSlot: { + serializedName: "rackSlot", + readOnly: true, + type: { + name: "Number" + } + }, + capacityGB: { + serializedName: "properties.capacityGB", + readOnly: true, + type: { + name: "Number" + } + }, + model: { + serializedName: "properties.model", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const RackList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RackList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Rack" + } + } + } + } + } + } +}; + +export const StorageApplianceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageApplianceList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageAppliance" + } + } + } + } + } + } +}; + +export const TrunkedNetworkList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrunkedNetworkList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TrunkedNetwork" + } + } + } + } + } + } +}; + +export const VirtualMachineList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualMachine" + } + } + } + } + } + } +}; + +export const VirtualMachinePlacementHint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinePlacementHint", + modelProperties: { + hintType: { + serializedName: "hintType", + required: true, + type: { + name: "String" + } + }, + resourceId: { + constraints: { + MinLength: 1 + }, + serializedName: "resourceId", + required: true, + type: { + name: "String" + } + }, + schedulingExecution: { + serializedName: "schedulingExecution", + required: true, + type: { + name: "String" + } + }, + scope: { + serializedName: "scope", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SshPublicKey: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SshPublicKey", + modelProperties: { + keyData: { + constraints: { + MinLength: 1 + }, + serializedName: "keyData", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageProfile", + modelProperties: { + osDisk: { + serializedName: "osDisk", + type: { + name: "Composite", + className: "OsDisk" + } + }, + volumeAttachments: { + serializedName: "volumeAttachments", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const OsDisk: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OsDisk", + modelProperties: { + createOption: { + defaultValue: "Ephemeral", + serializedName: "createOption", + type: { + name: "String" + } + }, + deleteOption: { + defaultValue: "Delete", + serializedName: "deleteOption", + type: { + name: "String" + } + }, + diskSizeGB: { + serializedName: "diskSizeGB", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ImageRepositoryCredentials: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImageRepositoryCredentials", + modelProperties: { + password: { + constraints: { + MinLength: 1 + }, + serializedName: "password", + required: true, + type: { + name: "String" + } + }, + registryUrl: { + serializedName: "registryUrl", + required: true, + type: { + name: "String" + } + }, + username: { + constraints: { + MinLength: 1 + }, + serializedName: "username", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const VolumeList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Volume" + } + } + } + } + } + } +}; + +export const BareMetalMachinePatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinePatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + machineDetails: { + constraints: { + MaxLength: 256 + }, + serializedName: "properties.machineDetails", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachineCordonParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineCordonParameters", + modelProperties: { + evacuate: { + defaultValue: "False", + serializedName: "evacuate", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinePowerOffParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinePowerOffParameters", + modelProperties: { + skipShutdown: { + defaultValue: "False", + serializedName: "skipShutdown", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachineReplaceParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineReplaceParameters", + modelProperties: { + bmcCredentials: { + serializedName: "bmcCredentials", + type: { + name: "Composite", + className: "AdministrativeCredentials" + } + }, + bmcMacAddress: { + constraints: { + Pattern: new RegExp("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$") + }, + serializedName: "bmcMacAddress", + type: { + name: "String" + } + }, + bootMacAddress: { + constraints: { + Pattern: new RegExp("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$") + }, + serializedName: "bootMacAddress", + type: { + name: "String" + } + }, + machineName: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$") + }, + serializedName: "machineName", + type: { + name: "String" + } + }, + serialNumber: { + constraints: { + MaxLength: 64, + MinLength: 1 + }, + serializedName: "serialNumber", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachineRunCommandParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineRunCommandParameters", + modelProperties: { + arguments: { + serializedName: "arguments", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + limitTimeSeconds: { + constraints: { + InclusiveMaximum: 14400, + InclusiveMinimum: 60 + }, + serializedName: "limitTimeSeconds", + required: true, + type: { + name: "Number" + } + }, + script: { + serializedName: "script", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachineRunDataExtractsParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineRunDataExtractsParameters", + modelProperties: { + commands: { + constraints: { + MinItems: 1 + }, + serializedName: "commands", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BareMetalMachineCommandSpecification" + } + } + } + }, + limitTimeSeconds: { + constraints: { + InclusiveMaximum: 14400, + InclusiveMinimum: 60 + }, + serializedName: "limitTimeSeconds", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const BareMetalMachineCommandSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineCommandSpecification", + modelProperties: { + arguments: { + serializedName: "arguments", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + command: { + serializedName: "command", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachineRunReadCommandsParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineRunReadCommandsParameters", + modelProperties: { + commands: { + constraints: { + MinItems: 1 + }, + serializedName: "commands", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BareMetalMachineCommandSpecification" + } + } + } + }, + limitTimeSeconds: { + constraints: { + InclusiveMaximum: 14400, + InclusiveMinimum: 60 + }, + serializedName: "limitTimeSeconds", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const BareMetalMachineValidateHardwareParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineValidateHardwareParameters", + modelProperties: { + validationCategory: { + serializedName: "validationCategory", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const CloudServicesNetworkPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudServicesNetworkPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + additionalEgressEndpoints: { + serializedName: "properties.additionalEgressEndpoints", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EgressEndpoint" + } + } + } + }, + enableDefaultEgressEndpoints: { + serializedName: "properties.enableDefaultEgressEndpoints", + type: { + name: "String" + } + } + } + } +}; + +export const ClusterManagerPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterManagerPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ClusterPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + aggregatorOrSingleRackDefinition: { + serializedName: "properties.aggregatorOrSingleRackDefinition", + type: { + name: "Composite", + className: "RackDefinition" + } + }, + clusterLocation: { + serializedName: "properties.clusterLocation", + type: { + name: "String" + } + }, + clusterServicePrincipal: { + serializedName: "properties.clusterServicePrincipal", + type: { + name: "Composite", + className: "ServicePrincipalInformation" + } + }, + computeDeploymentThreshold: { + serializedName: "properties.computeDeploymentThreshold", + type: { + name: "Composite", + className: "ValidationThreshold" + } + }, + computeRackDefinitions: { + serializedName: "properties.computeRackDefinitions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RackDefinition" + } + } + } + } + } + } +}; + +export const BareMetalMachineKeySetList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineKeySetList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BareMetalMachineKeySet" + } + } + } + } + } + } +}; + +export const KeySetUser: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeySetUser", + modelProperties: { + azureUserName: { + serializedName: "azureUserName", + required: true, + type: { + name: "String" + } + }, + description: { + constraints: { + MaxLength: 256 + }, + serializedName: "description", + type: { + name: "String" + } + }, + sshPublicKey: { + serializedName: "sshPublicKey", + type: { + name: "Composite", + className: "SshPublicKey" + } + } + } + } +}; + +export const KeySetUserStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeySetUserStatus", + modelProperties: { + azureUserName: { + serializedName: "azureUserName", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + statusMessage: { + constraints: { + MaxLength: 256 + }, + serializedName: "statusMessage", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachineKeySetPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineKeySetPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + expiration: { + serializedName: "properties.expiration", + type: { + name: "DateTime" + } + }, + jumpHostsAllowed: { + serializedName: "properties.jumpHostsAllowed", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + userList: { + serializedName: "properties.userList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeySetUser" + } + } + } + } + } + } +}; + +export const BmcKeySetList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BmcKeySetList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BmcKeySet" + } + } + } + } + } + } +}; + +export const BmcKeySetPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BmcKeySetPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + expiration: { + serializedName: "properties.expiration", + type: { + name: "DateTime" + } + }, + userList: { + serializedName: "properties.userList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeySetUser" + } + } + } + } + } + } +}; + +export const ClusterDeployParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterDeployParameters", + modelProperties: { + skipValidationsForMachines: { + serializedName: "skipValidationsForMachines", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ClusterMetricsConfigurationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterMetricsConfigurationList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClusterMetricsConfiguration" + } + } + } + } + } + } +}; + +export const ClusterMetricsConfigurationPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterMetricsConfigurationPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + collectionInterval: { + constraints: { + InclusiveMaximum: 1440, + InclusiveMinimum: 1 + }, + serializedName: "properties.collectionInterval", + type: { + name: "Number" + } + }, + enabledMetrics: { + serializedName: "properties.enabledMetrics", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ClusterUpdateVersionParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterUpdateVersionParameters", + modelProperties: { + targetClusterVersion: { + serializedName: "targetClusterVersion", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const DefaultCniNetworkPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DefaultCniNetworkPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const HybridAksClusterPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridAksClusterPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const HybridAksClusterRestartNodeParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridAksClusterRestartNodeParameters", + modelProperties: { + nodeName: { + serializedName: "nodeName", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const L2NetworkPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L2NetworkPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const L3NetworkPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L3NetworkPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const RackPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RackPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + rackLocation: { + constraints: { + MaxLength: 256 + }, + serializedName: "properties.rackLocation", + type: { + name: "String" + } + }, + rackSerialNumber: { + constraints: { + MaxLength: 64, + MinLength: 1 + }, + serializedName: "properties.rackSerialNumber", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAppliancePatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAppliancePatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + serialNumber: { + serializedName: "properties.serialNumber", + type: { + name: "String" + } + } + } + } +}; + +export const StorageApplianceEnableRemoteVendorManagementParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageApplianceEnableRemoteVendorManagementParameters", + modelProperties: { + supportEndpoints: { + serializedName: "supportEndpoints", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const StorageApplianceRunReadCommandsParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageApplianceRunReadCommandsParameters", + modelProperties: { + commands: { + constraints: { + MinItems: 1 + }, + serializedName: "commands", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageApplianceCommandSpecification" + } + } + } + }, + limitTimeSeconds: { + constraints: { + InclusiveMaximum: 14400, + InclusiveMinimum: 60 + }, + serializedName: "limitTimeSeconds", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const StorageApplianceCommandSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageApplianceCommandSpecification", + modelProperties: { + arguments: { + serializedName: "arguments", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + command: { + serializedName: "command", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageApplianceValidateHardwareParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageApplianceValidateHardwareParameters", + modelProperties: { + validationCategory: { + serializedName: "validationCategory", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const TrunkedNetworkPatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrunkedNetworkPatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const VirtualMachinePatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinePatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + vmImageRepositoryCredentials: { + serializedName: "properties.vmImageRepositoryCredentials", + type: { + name: "Composite", + className: "ImageRepositoryCredentials" + } + } + } + } +}; + +export const VirtualMachineVolumeParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachineVolumeParameters", + modelProperties: { + volumeId: { + serializedName: "volumeId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ConsoleList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConsoleList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Console" + } + } + } + } + } + } +}; + +export const ConsolePatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConsolePatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + enabled: { + serializedName: "properties.enabled", + type: { + name: "String" + } + }, + expiration: { + serializedName: "properties.expiration", + type: { + name: "DateTime" + } + }, + sshPublicKey: { + serializedName: "properties.sshPublicKey", + type: { + name: "Composite", + className: "SshPublicKey" + } + } + } + } +}; + +export const VirtualMachinePowerOffParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinePowerOffParameters", + modelProperties: { + skipShutdown: { + defaultValue: "False", + serializedName: "skipShutdown", + type: { + name: "String" + } + } + } + } +}; + +export const VolumePatchParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumePatchParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const TagsParameter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsParameter", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const RackSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RackSku", + modelProperties: { + ...Resource.type.modelProperties, + computeMachines: { + serializedName: "properties.computeMachines", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MachineSkuSlot" + } + } + } + }, + controllerMachines: { + serializedName: "properties.controllerMachines", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MachineSkuSlot" + } + } + } + }, + description: { + serializedName: "properties.description", + readOnly: true, + type: { + name: "String" + } + }, + maxClusterSlots: { + serializedName: "properties.maxClusterSlots", + readOnly: true, + type: { + name: "Number" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + rackType: { + serializedName: "properties.rackType", + readOnly: true, + type: { + name: "String" + } + }, + storageAppliances: { + serializedName: "properties.storageAppliances", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageApplianceSkuSlot" + } + } + } + }, + supportedRackSkuIds: { + serializedName: "properties.supportedRackSkuIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const BareMetalMachine: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachine", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + bmcConnectionString: { + serializedName: "properties.bmcConnectionString", + required: true, + type: { + name: "String" + } + }, + bmcCredentials: { + serializedName: "properties.bmcCredentials", + type: { + name: "Composite", + className: "AdministrativeCredentials" + } + }, + bmcMacAddress: { + constraints: { + Pattern: new RegExp("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$") + }, + serializedName: "properties.bmcMacAddress", + required: true, + type: { + name: "String" + } + }, + bootMacAddress: { + constraints: { + Pattern: new RegExp("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$") + }, + serializedName: "properties.bootMacAddress", + required: true, + type: { + name: "String" + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + cordonStatus: { + serializedName: "properties.cordonStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + hardwareInventory: { + serializedName: "properties.hardwareInventory", + type: { + name: "Composite", + className: "HardwareInventory" + } + }, + hardwareValidationStatus: { + serializedName: "properties.hardwareValidationStatus", + type: { + name: "Composite", + className: "HardwareValidationStatus" + } + }, + hybridAksClustersAssociatedIds: { + serializedName: "properties.hybridAksClustersAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + kubernetesNodeName: { + serializedName: "properties.kubernetesNodeName", + readOnly: true, + type: { + name: "String" + } + }, + kubernetesVersion: { + serializedName: "properties.kubernetesVersion", + readOnly: true, + type: { + name: "String" + } + }, + machineDetails: { + constraints: { + MaxLength: 256 + }, + serializedName: "properties.machineDetails", + required: true, + type: { + name: "String" + } + }, + machineName: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$") + }, + serializedName: "properties.machineName", + required: true, + type: { + name: "String" + } + }, + machineSkuId: { + serializedName: "properties.machineSkuId", + required: true, + type: { + name: "String" + } + }, + oamIpv4Address: { + serializedName: "properties.oamIpv4Address", + readOnly: true, + type: { + name: "String" + } + }, + oamIpv6Address: { + serializedName: "properties.oamIpv6Address", + readOnly: true, + type: { + name: "String" + } + }, + osImage: { + serializedName: "properties.osImage", + readOnly: true, + type: { + name: "String" + } + }, + powerState: { + serializedName: "properties.powerState", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + rackId: { + serializedName: "properties.rackId", + required: true, + type: { + name: "String" + } + }, + rackSlot: { + constraints: { + InclusiveMaximum: 256, + InclusiveMinimum: 1 + }, + serializedName: "properties.rackSlot", + required: true, + type: { + name: "Number" + } + }, + readyState: { + serializedName: "properties.readyState", + readOnly: true, + type: { + name: "String" + } + }, + serialNumber: { + constraints: { + MaxLength: 64, + MinLength: 1 + }, + serializedName: "properties.serialNumber", + required: true, + type: { + name: "String" + } + }, + serviceTag: { + serializedName: "properties.serviceTag", + readOnly: true, + type: { + name: "String" + } + }, + virtualMachinesAssociatedIds: { + serializedName: "properties.virtualMachinesAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CloudServicesNetwork: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudServicesNetwork", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + additionalEgressEndpoints: { + serializedName: "properties.additionalEgressEndpoints", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EgressEndpoint" + } + } + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + enableDefaultEgressEndpoints: { + serializedName: "properties.enableDefaultEgressEndpoints", + type: { + name: "String" + } + }, + enabledEgressEndpoints: { + serializedName: "properties.enabledEgressEndpoints", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EgressEndpoint" + } + } + } + }, + hybridAksClustersAssociatedIds: { + serializedName: "properties.hybridAksClustersAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + interfaceName: { + serializedName: "properties.interfaceName", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + virtualMachinesAssociatedIds: { + serializedName: "properties.virtualMachinesAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ClusterManager: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterManager", + modelProperties: { + ...TrackedResource.type.modelProperties, + analyticsWorkspaceId: { + serializedName: "properties.analyticsWorkspaceId", + type: { + name: "String" + } + }, + availabilityZones: { + serializedName: "properties.availabilityZones", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + clusterVersions: { + serializedName: "properties.clusterVersions", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClusterAvailableVersion" + } + } + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + fabricControllerId: { + serializedName: "properties.fabricControllerId", + required: true, + type: { + name: "String" + } + }, + managedResourceGroupConfiguration: { + serializedName: "properties.managedResourceGroupConfiguration", + type: { + name: "Composite", + className: "ManagedResourceGroupConfiguration" + } + }, + managerExtendedLocation: { + serializedName: "properties.managerExtendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + vmSize: { + serializedName: "properties.vmSize", + type: { + name: "String" + } + } + } + } +}; + +export const Cluster: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Cluster", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + aggregatorOrSingleRackDefinition: { + serializedName: "properties.aggregatorOrSingleRackDefinition", + type: { + name: "Composite", + className: "RackDefinition" + } + }, + analyticsWorkspaceId: { + serializedName: "properties.analyticsWorkspaceId", + required: true, + type: { + name: "String" + } + }, + availableUpgradeVersions: { + serializedName: "properties.availableUpgradeVersions", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClusterAvailableUpgradeVersion" + } + } + } + }, + clusterCapacity: { + serializedName: "properties.clusterCapacity", + type: { + name: "Composite", + className: "ClusterCapacity" + } + }, + clusterConnectionStatus: { + serializedName: "properties.clusterConnectionStatus", + readOnly: true, + type: { + name: "String" + } + }, + clusterExtendedLocation: { + serializedName: "properties.clusterExtendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + clusterLocation: { + constraints: { + MaxLength: 256 + }, + serializedName: "properties.clusterLocation", + type: { + name: "String" + } + }, + clusterManagerConnectionStatus: { + serializedName: "properties.clusterManagerConnectionStatus", + readOnly: true, + type: { + name: "String" + } + }, + clusterManagerId: { + serializedName: "properties.clusterManagerId", + readOnly: true, + type: { + name: "String" + } + }, + clusterServicePrincipal: { + serializedName: "properties.clusterServicePrincipal", + type: { + name: "Composite", + className: "ServicePrincipalInformation" + } + }, + clusterType: { + serializedName: "properties.clusterType", + required: true, + type: { + name: "String" + } + }, + clusterVersion: { + serializedName: "properties.clusterVersion", + required: true, + type: { + name: "String" + } + }, + computeDeploymentThreshold: { + serializedName: "properties.computeDeploymentThreshold", + type: { + name: "Composite", + className: "ValidationThreshold" + } + }, + computeRackDefinitions: { + serializedName: "properties.computeRackDefinitions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RackDefinition" + } + } + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + hybridAksExtendedLocation: { + serializedName: "properties.hybridAksExtendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + managedResourceGroupConfiguration: { + serializedName: "properties.managedResourceGroupConfiguration", + type: { + name: "Composite", + className: "ManagedResourceGroupConfiguration" + } + }, + manualActionCount: { + serializedName: "properties.manualActionCount", + readOnly: true, + type: { + name: "Number" + } + }, + networkFabricId: { + serializedName: "properties.networkFabricId", + required: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + supportExpiryDate: { + serializedName: "properties.supportExpiryDate", + readOnly: true, + type: { + name: "String" + } + }, + workloadResourceIds: { + serializedName: "properties.workloadResourceIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DefaultCniNetwork: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DefaultCniNetwork", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + cniAsNumber: { + serializedName: "properties.cniAsNumber", + readOnly: true, + type: { + name: "Number" + } + }, + cniBgpConfiguration: { + serializedName: "properties.cniBgpConfiguration", + type: { + name: "Composite", + className: "CniBgpConfiguration" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + fabricBgpPeers: { + serializedName: "properties.fabricBgpPeers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BgpPeer" + } + } + } + }, + hybridAksClustersAssociatedIds: { + serializedName: "properties.hybridAksClustersAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + interfaceName: { + serializedName: "properties.interfaceName", + readOnly: true, + type: { + name: "String" + } + }, + ipAllocationType: { + serializedName: "properties.ipAllocationType", + type: { + name: "String" + } + }, + ipv4ConnectedPrefix: { + serializedName: "properties.ipv4ConnectedPrefix", + type: { + name: "String" + } + }, + ipv6ConnectedPrefix: { + serializedName: "properties.ipv6ConnectedPrefix", + type: { + name: "String" + } + }, + l3IsolationDomainId: { + serializedName: "properties.l3IsolationDomainId", + required: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + vlan: { + constraints: { + InclusiveMaximum: 4094, + InclusiveMinimum: 1 + }, + serializedName: "properties.vlan", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const HybridAksCluster: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridAksCluster", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + associatedNetworkIds: { + serializedName: "properties.associatedNetworkIds", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + cloudServicesNetworkId: { + serializedName: "properties.cloudServicesNetworkId", + readOnly: true, + type: { + name: "String" + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + controlPlaneCount: { + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "properties.controlPlaneCount", + required: true, + type: { + name: "Number" + } + }, + controlPlaneNodes: { + serializedName: "properties.controlPlaneNodes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NodeConfiguration" + } + } + } + }, + defaultCniNetworkId: { + serializedName: "properties.defaultCniNetworkId", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + hybridAksProvisionedClusterId: { + serializedName: "properties.hybridAksProvisionedClusterId", + required: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + volumes: { + serializedName: "properties.volumes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + workerCount: { + serializedName: "properties.workerCount", + required: true, + type: { + name: "Number" + } + }, + workerNodes: { + serializedName: "properties.workerNodes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NodeConfiguration" + } + } + } + } + } + } +}; + +export const L2Network: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L2Network", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + hybridAksClustersAssociatedIds: { + serializedName: "properties.hybridAksClustersAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + hybridAksPluginType: { + serializedName: "properties.hybridAksPluginType", + type: { + name: "String" + } + }, + interfaceName: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9@._-]*$"), + MaxLength: 12 + }, + serializedName: "properties.interfaceName", + type: { + name: "String" + } + }, + l2IsolationDomainId: { + serializedName: "properties.l2IsolationDomainId", + required: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + virtualMachinesAssociatedIds: { + serializedName: "properties.virtualMachinesAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const L3Network: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L3Network", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + hybridAksClustersAssociatedIds: { + serializedName: "properties.hybridAksClustersAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + hybridAksIpamEnabled: { + defaultValue: "True", + serializedName: "properties.hybridAksIpamEnabled", + type: { + name: "String" + } + }, + hybridAksPluginType: { + serializedName: "properties.hybridAksPluginType", + type: { + name: "String" + } + }, + interfaceName: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9@._-]*$"), + MaxLength: 12 + }, + serializedName: "properties.interfaceName", + type: { + name: "String" + } + }, + ipAllocationType: { + serializedName: "properties.ipAllocationType", + type: { + name: "String" + } + }, + ipv4ConnectedPrefix: { + serializedName: "properties.ipv4ConnectedPrefix", + type: { + name: "String" + } + }, + ipv6ConnectedPrefix: { + serializedName: "properties.ipv6ConnectedPrefix", + type: { + name: "String" + } + }, + l3IsolationDomainId: { + serializedName: "properties.l3IsolationDomainId", + required: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + virtualMachinesAssociatedIds: { + serializedName: "properties.virtualMachinesAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + vlan: { + serializedName: "properties.vlan", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const Rack: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Rack", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + availabilityZone: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]{1,10}$") + }, + serializedName: "properties.availabilityZone", + required: true, + type: { + name: "String" + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + rackLocation: { + constraints: { + MaxLength: 256 + }, + serializedName: "properties.rackLocation", + required: true, + type: { + name: "String" + } + }, + rackSerialNumber: { + constraints: { + MaxLength: 64, + MinLength: 1 + }, + serializedName: "properties.rackSerialNumber", + required: true, + type: { + name: "String" + } + }, + rackSkuId: { + serializedName: "properties.rackSkuId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const StorageAppliance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAppliance", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + administratorCredentials: { + serializedName: "properties.administratorCredentials", + type: { + name: "Composite", + className: "AdministrativeCredentials" + } + }, + capacity: { + serializedName: "properties.capacity", + readOnly: true, + type: { + name: "Number" + } + }, + capacityUsed: { + serializedName: "properties.capacityUsed", + readOnly: true, + type: { + name: "Number" + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + managementIpv4Address: { + serializedName: "properties.managementIpv4Address", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + rackId: { + serializedName: "properties.rackId", + required: true, + type: { + name: "String" + } + }, + rackSlot: { + constraints: { + InclusiveMaximum: 256, + InclusiveMinimum: 1 + }, + serializedName: "properties.rackSlot", + required: true, + type: { + name: "Number" + } + }, + remoteVendorManagementFeature: { + serializedName: "properties.remoteVendorManagementFeature", + readOnly: true, + type: { + name: "String" + } + }, + remoteVendorManagementStatus: { + serializedName: "properties.remoteVendorManagementStatus", + readOnly: true, + type: { + name: "String" + } + }, + serialNumber: { + serializedName: "properties.serialNumber", + required: true, + type: { + name: "String" + } + }, + storageApplianceSkuId: { + serializedName: "properties.storageApplianceSkuId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const TrunkedNetwork: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrunkedNetwork", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + hybridAksClustersAssociatedIds: { + serializedName: "properties.hybridAksClustersAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + hybridAksPluginType: { + serializedName: "properties.hybridAksPluginType", + type: { + name: "String" + } + }, + interfaceName: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9@._-]*$"), + MaxLength: 12 + }, + serializedName: "properties.interfaceName", + type: { + name: "String" + } + }, + isolationDomainIds: { + constraints: { + MinItems: 1 + }, + serializedName: "properties.isolationDomainIds", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + virtualMachinesAssociatedIds: { + serializedName: "properties.virtualMachinesAssociatedIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + vlans: { + constraints: { + MinItems: 1 + }, + serializedName: "properties.vlans", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Number" + } + } + } + } + } + } +}; + +export const VirtualMachine: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachine", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + adminUsername: { + constraints: { + Pattern: new RegExp("^[a-z_][a-z0-9_]{0,31}$"), + MaxLength: 32, + MinLength: 1 + }, + serializedName: "properties.adminUsername", + required: true, + type: { + name: "String" + } + }, + bareMetalMachineId: { + serializedName: "properties.bareMetalMachineId", + readOnly: true, + type: { + name: "String" + } + }, + bootMethod: { + defaultValue: "UEFI", + serializedName: "properties.bootMethod", + type: { + name: "String" + } + }, + cloudServicesNetworkAttachment: { + serializedName: "properties.cloudServicesNetworkAttachment", + type: { + name: "Composite", + className: "NetworkAttachment" + } + }, + clusterId: { + serializedName: "properties.clusterId", + readOnly: true, + type: { + name: "String" + } + }, + cpuCores: { + constraints: { + InclusiveMinimum: 2 + }, + serializedName: "properties.cpuCores", + required: true, + type: { + name: "Number" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + isolateEmulatorThread: { + defaultValue: "True", + serializedName: "properties.isolateEmulatorThread", + type: { + name: "String" + } + }, + memorySizeGB: { + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "properties.memorySizeGB", + required: true, + type: { + name: "Number" + } + }, + networkAttachments: { + serializedName: "properties.networkAttachments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkAttachment" + } + } + } + }, + networkData: { + serializedName: "properties.networkData", + type: { + name: "String" + } + }, + placementHints: { + serializedName: "properties.placementHints", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualMachinePlacementHint" + } + } + } + }, + powerState: { + serializedName: "properties.powerState", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + sshPublicKeys: { + serializedName: "properties.sshPublicKeys", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SshPublicKey" + } + } + } + }, + storageProfile: { + serializedName: "properties.storageProfile", + type: { + name: "Composite", + className: "StorageProfile" + } + }, + userData: { + serializedName: "properties.userData", + type: { + name: "String" + } + }, + virtioInterface: { + defaultValue: "Modern", + serializedName: "properties.virtioInterface", + type: { + name: "String" + } + }, + vmDeviceModel: { + defaultValue: "T2", + serializedName: "properties.vmDeviceModel", + type: { + name: "String" + } + }, + vmImage: { + serializedName: "properties.vmImage", + required: true, + type: { + name: "String" + } + }, + vmImageRepositoryCredentials: { + serializedName: "properties.vmImageRepositoryCredentials", + type: { + name: "Composite", + className: "ImageRepositoryCredentials" + } + }, + volumes: { + serializedName: "properties.volumes", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Volume: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Volume", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + attachedTo: { + serializedName: "properties.attachedTo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + serialNumber: { + serializedName: "properties.serialNumber", + readOnly: true, + type: { + name: "String" + } + }, + sizeMiB: { + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "properties.sizeMiB", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const BareMetalMachineKeySet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineKeySet", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + azureGroupId: { + serializedName: "properties.azureGroupId", + required: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + expiration: { + serializedName: "properties.expiration", + required: true, + type: { + name: "DateTime" + } + }, + jumpHostsAllowed: { + serializedName: "properties.jumpHostsAllowed", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + lastValidation: { + serializedName: "properties.lastValidation", + readOnly: true, + type: { + name: "DateTime" + } + }, + osGroupName: { + constraints: { + Pattern: new RegExp("^([A-Za-z]([A-Za-z0-9]*))$"), + MaxLength: 32 + }, + serializedName: "properties.osGroupName", + type: { + name: "String" + } + }, + privilegeLevel: { + serializedName: "properties.privilegeLevel", + required: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + userList: { + serializedName: "properties.userList", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeySetUser" + } + } + } + }, + userListStatus: { + serializedName: "properties.userListStatus", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeySetUserStatus" + } + } + } + } + } + } +}; + +export const BmcKeySet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BmcKeySet", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + azureGroupId: { + serializedName: "properties.azureGroupId", + required: true, + type: { + name: "String" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + expiration: { + serializedName: "properties.expiration", + required: true, + type: { + name: "DateTime" + } + }, + lastValidation: { + serializedName: "properties.lastValidation", + readOnly: true, + type: { + name: "DateTime" + } + }, + privilegeLevel: { + serializedName: "properties.privilegeLevel", + required: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + userList: { + serializedName: "properties.userList", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeySetUser" + } + } + } + }, + userListStatus: { + serializedName: "properties.userListStatus", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeySetUserStatus" + } + } + } + } + } + } +}; + +export const ClusterMetricsConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterMetricsConfiguration", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + collectionInterval: { + constraints: { + InclusiveMaximum: 1440, + InclusiveMinimum: 1 + }, + serializedName: "properties.collectionInterval", + required: true, + type: { + name: "Number" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + disabledMetrics: { + serializedName: "properties.disabledMetrics", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + enabledMetrics: { + serializedName: "properties.enabledMetrics", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Console: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Console", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + detailedStatus: { + serializedName: "properties.detailedStatus", + readOnly: true, + type: { + name: "String" + } + }, + detailedStatusMessage: { + serializedName: "properties.detailedStatusMessage", + readOnly: true, + type: { + name: "String" + } + }, + enabled: { + serializedName: "properties.enabled", + required: true, + type: { + name: "String" + } + }, + expiration: { + serializedName: "properties.expiration", + type: { + name: "DateTime" + } + }, + privateLinkServiceId: { + serializedName: "properties.privateLinkServiceId", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + sshPublicKey: { + serializedName: "properties.sshPublicKey", + type: { + name: "Composite", + className: "SshPublicKey" + } + }, + virtualMachineAccessId: { + serializedName: "properties.virtualMachineAccessId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesCordonHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesCordonHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesPowerOffHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesPowerOffHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesReimageHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesReimageHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesReplaceHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesReplaceHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesRestartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesRestartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesRunCommandHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesRunCommandHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesRunDataExtractsHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesRunDataExtractsHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesRunReadCommandsHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesRunReadCommandsHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesStartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesStartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesUncordonHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesUncordonHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachinesValidateHardwareHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachinesValidateHardwareHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const CloudServicesNetworksCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudServicesNetworksCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const CloudServicesNetworksDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudServicesNetworksDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const CloudServicesNetworksUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudServicesNetworksUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ClusterManagersCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterManagersCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const ClusterManagersDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterManagersDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ClustersCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClustersCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const ClustersDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClustersDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ClustersUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClustersUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ClustersDeployHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClustersDeployHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ClustersUpdateVersionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClustersUpdateVersionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const DefaultCniNetworksCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DefaultCniNetworksCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const DefaultCniNetworksDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DefaultCniNetworksDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const HybridAksClustersCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridAksClustersCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const HybridAksClustersDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridAksClustersDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const HybridAksClustersRestartNodeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridAksClustersRestartNodeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const L2NetworksCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L2NetworksCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const L2NetworksDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L2NetworksDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const L3NetworksCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L3NetworksCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const L3NetworksDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "L3NetworksDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const RacksCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RacksCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const RacksDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RacksDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const RacksUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RacksUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAppliancesCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAppliancesCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAppliancesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAppliancesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAppliancesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAppliancesUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAppliancesDisableRemoteVendorManagementHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAppliancesDisableRemoteVendorManagementHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAppliancesEnableRemoteVendorManagementHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAppliancesEnableRemoteVendorManagementHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAppliancesRunReadCommandsHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAppliancesRunReadCommandsHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAppliancesValidateHardwareHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageAppliancesValidateHardwareHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const TrunkedNetworksCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrunkedNetworksCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const TrunkedNetworksDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrunkedNetworksDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachinesCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachinesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachinesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachinesAttachVolumeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesAttachVolumeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachinesDetachVolumeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesDetachVolumeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachinesPowerOffHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesPowerOffHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachinesReimageHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesReimageHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachinesRestartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesRestartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualMachinesStartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualMachinesStartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VolumesCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const VolumesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachineKeySetsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineKeySetsCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachineKeySetsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineKeySetsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BareMetalMachineKeySetsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BareMetalMachineKeySetsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BmcKeySetsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BmcKeySetsCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const BmcKeySetsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BmcKeySetsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const BmcKeySetsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BmcKeySetsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const MetricsConfigurationsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricsConfigurationsCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const MetricsConfigurationsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricsConfigurationsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const MetricsConfigurationsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetricsConfigurationsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConsolesCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConsolesCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const ConsolesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConsolesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ConsolesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConsolesUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/models/parameters.ts b/sdk/networkcloud/arm-networkcloud/src/models/parameters.ts new file mode 100644 index 000000000000..21e6b1e4ba92 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/models/parameters.ts @@ -0,0 +1,655 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + BareMetalMachine as BareMetalMachineMapper, + BareMetalMachinePatchParameters as BareMetalMachinePatchParametersMapper, + BareMetalMachineCordonParameters as BareMetalMachineCordonParametersMapper, + BareMetalMachinePowerOffParameters as BareMetalMachinePowerOffParametersMapper, + BareMetalMachineReplaceParameters as BareMetalMachineReplaceParametersMapper, + BareMetalMachineRunCommandParameters as BareMetalMachineRunCommandParametersMapper, + BareMetalMachineRunDataExtractsParameters as BareMetalMachineRunDataExtractsParametersMapper, + BareMetalMachineRunReadCommandsParameters as BareMetalMachineRunReadCommandsParametersMapper, + BareMetalMachineValidateHardwareParameters as BareMetalMachineValidateHardwareParametersMapper, + CloudServicesNetwork as CloudServicesNetworkMapper, + CloudServicesNetworkPatchParameters as CloudServicesNetworkPatchParametersMapper, + ClusterManager as ClusterManagerMapper, + ClusterManagerPatchParameters as ClusterManagerPatchParametersMapper, + Cluster as ClusterMapper, + ClusterPatchParameters as ClusterPatchParametersMapper, + ClusterDeployParameters as ClusterDeployParametersMapper, + ClusterUpdateVersionParameters as ClusterUpdateVersionParametersMapper, + DefaultCniNetwork as DefaultCniNetworkMapper, + DefaultCniNetworkPatchParameters as DefaultCniNetworkPatchParametersMapper, + HybridAksCluster as HybridAksClusterMapper, + HybridAksClusterPatchParameters as HybridAksClusterPatchParametersMapper, + HybridAksClusterRestartNodeParameters as HybridAksClusterRestartNodeParametersMapper, + L2Network as L2NetworkMapper, + L2NetworkPatchParameters as L2NetworkPatchParametersMapper, + L3Network as L3NetworkMapper, + L3NetworkPatchParameters as L3NetworkPatchParametersMapper, + Rack as RackMapper, + RackPatchParameters as RackPatchParametersMapper, + StorageAppliance as StorageApplianceMapper, + StorageAppliancePatchParameters as StorageAppliancePatchParametersMapper, + StorageApplianceEnableRemoteVendorManagementParameters as StorageApplianceEnableRemoteVendorManagementParametersMapper, + StorageApplianceRunReadCommandsParameters as StorageApplianceRunReadCommandsParametersMapper, + StorageApplianceValidateHardwareParameters as StorageApplianceValidateHardwareParametersMapper, + TrunkedNetwork as TrunkedNetworkMapper, + TrunkedNetworkPatchParameters as TrunkedNetworkPatchParametersMapper, + VirtualMachine as VirtualMachineMapper, + VirtualMachinePatchParameters as VirtualMachinePatchParametersMapper, + VirtualMachineVolumeParameters as VirtualMachineVolumeParametersMapper, + VirtualMachinePowerOffParameters as VirtualMachinePowerOffParametersMapper, + Volume as VolumeMapper, + VolumePatchParameters as VolumePatchParametersMapper, + BareMetalMachineKeySet as BareMetalMachineKeySetMapper, + BareMetalMachineKeySetPatchParameters as BareMetalMachineKeySetPatchParametersMapper, + BmcKeySet as BmcKeySetMapper, + BmcKeySetPatchParameters as BmcKeySetPatchParametersMapper, + ClusterMetricsConfiguration as ClusterMetricsConfigurationMapper, + ClusterMetricsConfigurationPatchParameters as ClusterMetricsConfigurationPatchParametersMapper, + Console as ConsoleMapper, + ConsolePatchParameters as ConsolePatchParametersMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-12-12-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const bareMetalMachineName: OperationURLParameter = { + parameterPath: "bareMetalMachineName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$") + }, + serializedName: "bareMetalMachineName", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const bareMetalMachineParameters: OperationParameter = { + parameterPath: "bareMetalMachineParameters", + mapper: BareMetalMachineMapper +}; + +export const bareMetalMachineUpdateParameters: OperationParameter = { + parameterPath: ["options", "bareMetalMachineUpdateParameters"], + mapper: BareMetalMachinePatchParametersMapper +}; + +export const bareMetalMachineCordonParameters: OperationParameter = { + parameterPath: ["options", "bareMetalMachineCordonParameters"], + mapper: BareMetalMachineCordonParametersMapper +}; + +export const bareMetalMachinePowerOffParameters: OperationParameter = { + parameterPath: ["options", "bareMetalMachinePowerOffParameters"], + mapper: BareMetalMachinePowerOffParametersMapper +}; + +export const bareMetalMachineReplaceParameters: OperationParameter = { + parameterPath: ["options", "bareMetalMachineReplaceParameters"], + mapper: BareMetalMachineReplaceParametersMapper +}; + +export const bareMetalMachineRunCommandParameters: OperationParameter = { + parameterPath: "bareMetalMachineRunCommandParameters", + mapper: BareMetalMachineRunCommandParametersMapper +}; + +export const bareMetalMachineRunDataExtractsParameters: OperationParameter = { + parameterPath: "bareMetalMachineRunDataExtractsParameters", + mapper: BareMetalMachineRunDataExtractsParametersMapper +}; + +export const bareMetalMachineRunReadCommandsParameters: OperationParameter = { + parameterPath: "bareMetalMachineRunReadCommandsParameters", + mapper: BareMetalMachineRunReadCommandsParametersMapper +}; + +export const bareMetalMachineValidateHardwareParameters: OperationParameter = { + parameterPath: "bareMetalMachineValidateHardwareParameters", + mapper: BareMetalMachineValidateHardwareParametersMapper +}; + +export const cloudServicesNetworkName: OperationURLParameter = { + parameterPath: "cloudServicesNetworkName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "cloudServicesNetworkName", + required: true, + type: { + name: "String" + } + } +}; + +export const cloudServicesNetworkParameters: OperationParameter = { + parameterPath: "cloudServicesNetworkParameters", + mapper: CloudServicesNetworkMapper +}; + +export const cloudServicesNetworkUpdateParameters: OperationParameter = { + parameterPath: ["options", "cloudServicesNetworkUpdateParameters"], + mapper: CloudServicesNetworkPatchParametersMapper +}; + +export const clusterManagerName: OperationURLParameter = { + parameterPath: "clusterManagerName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "clusterManagerName", + required: true, + type: { + name: "String" + } + } +}; + +export const clusterManagerParameters: OperationParameter = { + parameterPath: "clusterManagerParameters", + mapper: ClusterManagerMapper +}; + +export const clusterManagerUpdateParameters: OperationParameter = { + parameterPath: ["options", "clusterManagerUpdateParameters"], + mapper: ClusterManagerPatchParametersMapper +}; + +export const clusterName: OperationURLParameter = { + parameterPath: "clusterName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "clusterName", + required: true, + type: { + name: "String" + } + } +}; + +export const clusterParameters: OperationParameter = { + parameterPath: "clusterParameters", + mapper: ClusterMapper +}; + +export const clusterUpdateParameters: OperationParameter = { + parameterPath: ["options", "clusterUpdateParameters"], + mapper: ClusterPatchParametersMapper +}; + +export const clusterDeployParameters: OperationParameter = { + parameterPath: ["options", "clusterDeployParameters"], + mapper: ClusterDeployParametersMapper +}; + +export const clusterUpdateVersionParameters: OperationParameter = { + parameterPath: "clusterUpdateVersionParameters", + mapper: ClusterUpdateVersionParametersMapper +}; + +export const defaultCniNetworkName: OperationURLParameter = { + parameterPath: "defaultCniNetworkName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "defaultCniNetworkName", + required: true, + type: { + name: "String" + } + } +}; + +export const defaultCniNetworkParameters: OperationParameter = { + parameterPath: "defaultCniNetworkParameters", + mapper: DefaultCniNetworkMapper +}; + +export const defaultCniNetworkUpdateParameters: OperationParameter = { + parameterPath: ["options", "defaultCniNetworkUpdateParameters"], + mapper: DefaultCniNetworkPatchParametersMapper +}; + +export const hybridAksClusterName: OperationURLParameter = { + parameterPath: "hybridAksClusterName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9])$") + }, + serializedName: "hybridAksClusterName", + required: true, + type: { + name: "String" + } + } +}; + +export const hybridAksClusterParameters: OperationParameter = { + parameterPath: "hybridAksClusterParameters", + mapper: HybridAksClusterMapper +}; + +export const hybridAksClusterUpdateParameters: OperationParameter = { + parameterPath: ["options", "hybridAksClusterUpdateParameters"], + mapper: HybridAksClusterPatchParametersMapper +}; + +export const hybridAksClusterRestartNodeParameters: OperationParameter = { + parameterPath: "hybridAksClusterRestartNodeParameters", + mapper: HybridAksClusterRestartNodeParametersMapper +}; + +export const l2NetworkName: OperationURLParameter = { + parameterPath: "l2NetworkName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "l2NetworkName", + required: true, + type: { + name: "String" + } + } +}; + +export const l2NetworkParameters: OperationParameter = { + parameterPath: "l2NetworkParameters", + mapper: L2NetworkMapper +}; + +export const l2NetworkUpdateParameters: OperationParameter = { + parameterPath: ["options", "l2NetworkUpdateParameters"], + mapper: L2NetworkPatchParametersMapper +}; + +export const l3NetworkName: OperationURLParameter = { + parameterPath: "l3NetworkName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "l3NetworkName", + required: true, + type: { + name: "String" + } + } +}; + +export const l3NetworkParameters: OperationParameter = { + parameterPath: "l3NetworkParameters", + mapper: L3NetworkMapper +}; + +export const l3NetworkUpdateParameters: OperationParameter = { + parameterPath: ["options", "l3NetworkUpdateParameters"], + mapper: L3NetworkPatchParametersMapper +}; + +export const rackSkuName: OperationURLParameter = { + parameterPath: "rackSkuName", + mapper: { + serializedName: "rackSkuName", + required: true, + type: { + name: "String" + } + } +}; + +export const rackName: OperationURLParameter = { + parameterPath: "rackName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "rackName", + required: true, + type: { + name: "String" + } + } +}; + +export const rackParameters: OperationParameter = { + parameterPath: "rackParameters", + mapper: RackMapper +}; + +export const rackUpdateParameters: OperationParameter = { + parameterPath: ["options", "rackUpdateParameters"], + mapper: RackPatchParametersMapper +}; + +export const storageApplianceName: OperationURLParameter = { + parameterPath: "storageApplianceName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "storageApplianceName", + required: true, + type: { + name: "String" + } + } +}; + +export const storageApplianceParameters: OperationParameter = { + parameterPath: "storageApplianceParameters", + mapper: StorageApplianceMapper +}; + +export const storageApplianceUpdateParameters: OperationParameter = { + parameterPath: ["options", "storageApplianceUpdateParameters"], + mapper: StorageAppliancePatchParametersMapper +}; + +export const storageApplianceEnableRemoteVendorManagementParameters: OperationParameter = { + parameterPath: [ + "options", + "storageApplianceEnableRemoteVendorManagementParameters" + ], + mapper: StorageApplianceEnableRemoteVendorManagementParametersMapper +}; + +export const storageApplianceRunReadCommandsParameters: OperationParameter = { + parameterPath: "storageApplianceRunReadCommandsParameters", + mapper: StorageApplianceRunReadCommandsParametersMapper +}; + +export const storageApplianceValidateHardwareParameters: OperationParameter = { + parameterPath: "storageApplianceValidateHardwareParameters", + mapper: StorageApplianceValidateHardwareParametersMapper +}; + +export const trunkedNetworkName: OperationURLParameter = { + parameterPath: "trunkedNetworkName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "trunkedNetworkName", + required: true, + type: { + name: "String" + } + } +}; + +export const trunkedNetworkParameters: OperationParameter = { + parameterPath: "trunkedNetworkParameters", + mapper: TrunkedNetworkMapper +}; + +export const trunkedNetworkUpdateParameters: OperationParameter = { + parameterPath: ["options", "trunkedNetworkUpdateParameters"], + mapper: TrunkedNetworkPatchParametersMapper +}; + +export const virtualMachineName: OperationURLParameter = { + parameterPath: "virtualMachineName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$") + }, + serializedName: "virtualMachineName", + required: true, + type: { + name: "String" + } + } +}; + +export const virtualMachineParameters: OperationParameter = { + parameterPath: "virtualMachineParameters", + mapper: VirtualMachineMapper +}; + +export const virtualMachineUpdateParameters: OperationParameter = { + parameterPath: ["options", "virtualMachineUpdateParameters"], + mapper: VirtualMachinePatchParametersMapper +}; + +export const virtualMachineAttachVolumeParameters: OperationParameter = { + parameterPath: "virtualMachineAttachVolumeParameters", + mapper: VirtualMachineVolumeParametersMapper +}; + +export const virtualMachineDetachVolumeParameters: OperationParameter = { + parameterPath: "virtualMachineDetachVolumeParameters", + mapper: VirtualMachineVolumeParametersMapper +}; + +export const virtualMachinePowerOffParameters: OperationParameter = { + parameterPath: ["options", "virtualMachinePowerOffParameters"], + mapper: VirtualMachinePowerOffParametersMapper +}; + +export const volumeName: OperationURLParameter = { + parameterPath: "volumeName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "volumeName", + required: true, + type: { + name: "String" + } + } +}; + +export const volumeParameters: OperationParameter = { + parameterPath: "volumeParameters", + mapper: VolumeMapper +}; + +export const volumeUpdateParameters: OperationParameter = { + parameterPath: ["options", "volumeUpdateParameters"], + mapper: VolumePatchParametersMapper +}; + +export const bareMetalMachineKeySetName: OperationURLParameter = { + parameterPath: "bareMetalMachineKeySetName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "bareMetalMachineKeySetName", + required: true, + type: { + name: "String" + } + } +}; + +export const bareMetalMachineKeySetParameters: OperationParameter = { + parameterPath: "bareMetalMachineKeySetParameters", + mapper: BareMetalMachineKeySetMapper +}; + +export const bareMetalMachineKeySetUpdateParameters: OperationParameter = { + parameterPath: ["options", "bareMetalMachineKeySetUpdateParameters"], + mapper: BareMetalMachineKeySetPatchParametersMapper +}; + +export const bmcKeySetName: OperationURLParameter = { + parameterPath: "bmcKeySetName", + mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$") + }, + serializedName: "bmcKeySetName", + required: true, + type: { + name: "String" + } + } +}; + +export const bmcKeySetParameters: OperationParameter = { + parameterPath: "bmcKeySetParameters", + mapper: BmcKeySetMapper +}; + +export const bmcKeySetUpdateParameters: OperationParameter = { + parameterPath: ["options", "bmcKeySetUpdateParameters"], + mapper: BmcKeySetPatchParametersMapper +}; + +export const metricsConfigurationName: OperationURLParameter = { + parameterPath: "metricsConfigurationName", + mapper: { + constraints: { + Pattern: new RegExp("^default$") + }, + serializedName: "metricsConfigurationName", + required: true, + type: { + name: "String" + } + } +}; + +export const metricsConfigurationParameters: OperationParameter = { + parameterPath: "metricsConfigurationParameters", + mapper: ClusterMetricsConfigurationMapper +}; + +export const metricsConfigurationUpdateParameters: OperationParameter = { + parameterPath: ["options", "metricsConfigurationUpdateParameters"], + mapper: ClusterMetricsConfigurationPatchParametersMapper +}; + +export const consoleName: OperationURLParameter = { + parameterPath: "consoleName", + mapper: { + constraints: { + Pattern: new RegExp("^default$") + }, + serializedName: "consoleName", + required: true, + type: { + name: "String" + } + } +}; + +export const consoleParameters: OperationParameter = { + parameterPath: "consoleParameters", + mapper: ConsoleMapper +}; + +export const consoleUpdateParameters: OperationParameter = { + parameterPath: ["options", "consoleUpdateParameters"], + mapper: ConsolePatchParametersMapper +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/networkCloud.ts b/sdk/networkcloud/arm-networkcloud/src/networkCloud.ts new file mode 100644 index 000000000000..a8c8ea95615d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/networkCloud.ts @@ -0,0 +1,216 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + BareMetalMachinesImpl, + CloudServicesNetworksImpl, + ClusterManagersImpl, + ClustersImpl, + DefaultCniNetworksImpl, + HybridAksClustersImpl, + L2NetworksImpl, + L3NetworksImpl, + RackSkusImpl, + RacksImpl, + StorageAppliancesImpl, + TrunkedNetworksImpl, + VirtualMachinesImpl, + VolumesImpl, + BareMetalMachineKeySetsImpl, + BmcKeySetsImpl, + MetricsConfigurationsImpl, + ConsolesImpl +} from "./operations"; +import { + Operations, + BareMetalMachines, + CloudServicesNetworks, + ClusterManagers, + Clusters, + DefaultCniNetworks, + HybridAksClusters, + L2Networks, + L3Networks, + RackSkus, + Racks, + StorageAppliances, + TrunkedNetworks, + VirtualMachines, + Volumes, + BareMetalMachineKeySets, + BmcKeySets, + MetricsConfigurations, + Consoles +} from "./operationsInterfaces"; +import { NetworkCloudOptionalParams } from "./models"; + +export class NetworkCloud extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the NetworkCloud class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: NetworkCloudOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: NetworkCloudOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-networkcloud/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2022-12-12-preview"; + this.operations = new OperationsImpl(this); + this.bareMetalMachines = new BareMetalMachinesImpl(this); + this.cloudServicesNetworks = new CloudServicesNetworksImpl(this); + this.clusterManagers = new ClusterManagersImpl(this); + this.clusters = new ClustersImpl(this); + this.defaultCniNetworks = new DefaultCniNetworksImpl(this); + this.hybridAksClusters = new HybridAksClustersImpl(this); + this.l2Networks = new L2NetworksImpl(this); + this.l3Networks = new L3NetworksImpl(this); + this.rackSkus = new RackSkusImpl(this); + this.racks = new RacksImpl(this); + this.storageAppliances = new StorageAppliancesImpl(this); + this.trunkedNetworks = new TrunkedNetworksImpl(this); + this.virtualMachines = new VirtualMachinesImpl(this); + this.volumes = new VolumesImpl(this); + this.bareMetalMachineKeySets = new BareMetalMachineKeySetsImpl(this); + this.bmcKeySets = new BmcKeySetsImpl(this); + this.metricsConfigurations = new MetricsConfigurationsImpl(this); + this.consoles = new ConsolesImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + operations: Operations; + bareMetalMachines: BareMetalMachines; + cloudServicesNetworks: CloudServicesNetworks; + clusterManagers: ClusterManagers; + clusters: Clusters; + defaultCniNetworks: DefaultCniNetworks; + hybridAksClusters: HybridAksClusters; + l2Networks: L2Networks; + l3Networks: L3Networks; + rackSkus: RackSkus; + racks: Racks; + storageAppliances: StorageAppliances; + trunkedNetworks: TrunkedNetworks; + virtualMachines: VirtualMachines; + volumes: Volumes; + bareMetalMachineKeySets: BareMetalMachineKeySets; + bmcKeySets: BmcKeySets; + metricsConfigurations: MetricsConfigurations; + consoles: Consoles; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/bareMetalMachineKeySets.ts b/sdk/networkcloud/arm-networkcloud/src/operations/bareMetalMachineKeySets.ts new file mode 100644 index 000000000000..1333937a0503 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/bareMetalMachineKeySets.ts @@ -0,0 +1,652 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { BareMetalMachineKeySets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + BareMetalMachineKeySet, + BareMetalMachineKeySetsListByResourceGroupNextOptionalParams, + BareMetalMachineKeySetsListByResourceGroupOptionalParams, + BareMetalMachineKeySetsListByResourceGroupResponse, + BareMetalMachineKeySetsGetOptionalParams, + BareMetalMachineKeySetsGetResponse, + BareMetalMachineKeySetsCreateOrUpdateOptionalParams, + BareMetalMachineKeySetsCreateOrUpdateResponse, + BareMetalMachineKeySetsDeleteOptionalParams, + BareMetalMachineKeySetsUpdateOptionalParams, + BareMetalMachineKeySetsUpdateResponse, + BareMetalMachineKeySetsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing BareMetalMachineKeySets operations. */ +export class BareMetalMachineKeySetsImpl implements BareMetalMachineKeySets { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class BareMetalMachineKeySets class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + clusterName: string, + options?: BareMetalMachineKeySetsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll( + resourceGroupName, + clusterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + clusterName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + clusterName: string, + options?: BareMetalMachineKeySetsListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: BareMetalMachineKeySetsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup( + resourceGroupName, + clusterName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + clusterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + clusterName: string, + options?: BareMetalMachineKeySetsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + clusterName, + options + )) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + clusterName: string, + options?: BareMetalMachineKeySetsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, bareMetalMachineKeySetName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + bareMetalMachineKeySetParameters: BareMetalMachineKeySet, + options?: BareMetalMachineKeySetsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachineKeySetsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachineKeySetsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + bareMetalMachineKeySetParameters: BareMetalMachineKeySet, + options?: BareMetalMachineKeySetsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + options + }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachineKeySetsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachineKeySetsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + clusterName: string, + nextLink: string, + options?: BareMetalMachineKeySetsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachineKeySetList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachineKeySet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.bareMetalMachineKeySetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachineKeySet + }, + 201: { + bodyMapper: Mappers.BareMetalMachineKeySet + }, + 202: { + bodyMapper: Mappers.BareMetalMachineKeySet + }, + 204: { + bodyMapper: Mappers.BareMetalMachineKeySet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineKeySetParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.bareMetalMachineKeySetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.bareMetalMachineKeySetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachineKeySet + }, + 201: { + bodyMapper: Mappers.BareMetalMachineKeySet + }, + 202: { + bodyMapper: Mappers.BareMetalMachineKeySet + }, + 204: { + bodyMapper: Mappers.BareMetalMachineKeySet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineKeySetUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.bareMetalMachineKeySetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachineKeySetList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/bareMetalMachines.ts b/sdk/networkcloud/arm-networkcloud/src/operations/bareMetalMachines.ts new file mode 100644 index 000000000000..b795b6a5981f --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/bareMetalMachines.ts @@ -0,0 +1,2163 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { BareMetalMachines } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + BareMetalMachine, + BareMetalMachinesListBySubscriptionNextOptionalParams, + BareMetalMachinesListBySubscriptionOptionalParams, + BareMetalMachinesListBySubscriptionResponse, + BareMetalMachinesListByResourceGroupNextOptionalParams, + BareMetalMachinesListByResourceGroupOptionalParams, + BareMetalMachinesListByResourceGroupResponse, + BareMetalMachinesGetOptionalParams, + BareMetalMachinesGetResponse, + BareMetalMachinesCreateOrUpdateOptionalParams, + BareMetalMachinesCreateOrUpdateResponse, + BareMetalMachinesDeleteOptionalParams, + BareMetalMachinesUpdateOptionalParams, + BareMetalMachinesUpdateResponse, + BareMetalMachinesCordonOptionalParams, + BareMetalMachinesCordonResponse, + BareMetalMachinesPowerOffOptionalParams, + BareMetalMachinesPowerOffResponse, + BareMetalMachinesReimageOptionalParams, + BareMetalMachinesReimageResponse, + BareMetalMachinesReplaceOptionalParams, + BareMetalMachinesReplaceResponse, + BareMetalMachinesRestartOptionalParams, + BareMetalMachinesRestartResponse, + BareMetalMachineRunCommandParameters, + BareMetalMachinesRunCommandOptionalParams, + BareMetalMachinesRunCommandResponse, + BareMetalMachineRunDataExtractsParameters, + BareMetalMachinesRunDataExtractsOptionalParams, + BareMetalMachinesRunDataExtractsResponse, + BareMetalMachineRunReadCommandsParameters, + BareMetalMachinesRunReadCommandsOptionalParams, + BareMetalMachinesRunReadCommandsResponse, + BareMetalMachinesStartOptionalParams, + BareMetalMachinesStartResponse, + BareMetalMachinesUncordonOptionalParams, + BareMetalMachinesUncordonResponse, + BareMetalMachineValidateHardwareParameters, + BareMetalMachinesValidateHardwareOptionalParams, + BareMetalMachinesValidateHardwareResponse, + BareMetalMachinesListBySubscriptionNextResponse, + BareMetalMachinesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing BareMetalMachines operations. */ +export class BareMetalMachinesImpl implements BareMetalMachines { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class BareMetalMachines class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of bare metal machines in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: BareMetalMachinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: BareMetalMachinesListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: BareMetalMachinesListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: BareMetalMachinesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: BareMetalMachinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: BareMetalMachinesListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: BareMetalMachinesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: BareMetalMachinesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of bare metal machines in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: BareMetalMachinesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: BareMetalMachinesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, bareMetalMachineName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineParameters: BareMetalMachine, + options?: BareMetalMachinesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + bareMetalMachineName, + bareMetalMachineParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineParameters: BareMetalMachine, + options?: BareMetalMachinesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, bareMetalMachineName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + bareMetalMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, bareMetalMachineName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + bareMetalMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginCordon( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesCordonOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesCordonResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, bareMetalMachineName, options }, + spec: cordonOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesCordonResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCordonAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesCordonOptionalParams + ): Promise { + const poller = await this.beginCordon( + resourceGroupName, + bareMetalMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginPowerOff( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesPowerOffOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesPowerOffResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, bareMetalMachineName, options }, + spec: powerOffOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesPowerOffResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginPowerOffAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesPowerOffOptionalParams + ): Promise { + const poller = await this.beginPowerOff( + resourceGroupName, + bareMetalMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginReimage( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesReimageOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesReimageResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, bareMetalMachineName, options }, + spec: reimageOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesReimageResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginReimageAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesReimageOptionalParams + ): Promise { + const poller = await this.beginReimage( + resourceGroupName, + bareMetalMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginReplace( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesReplaceOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesReplaceResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, bareMetalMachineName, options }, + spec: replaceOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesReplaceResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginReplaceAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesReplaceOptionalParams + ): Promise { + const poller = await this.beginReplace( + resourceGroupName, + bareMetalMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginRestart( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesRestartOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesRestartResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, bareMetalMachineName, options }, + spec: restartOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesRestartResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginRestartAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesRestartOptionalParams + ): Promise { + const poller = await this.beginRestart( + resourceGroupName, + bareMetalMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginRunCommand( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunCommandParameters: BareMetalMachineRunCommandParameters, + options?: BareMetalMachinesRunCommandOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesRunCommandResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunCommandParameters, + options + }, + spec: runCommandOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesRunCommandResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginRunCommandAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunCommandParameters: BareMetalMachineRunCommandParameters, + options?: BareMetalMachinesRunCommandOptionalParams + ): Promise { + const poller = await this.beginRunCommand( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunCommandParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginRunDataExtracts( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunDataExtractsParameters: BareMetalMachineRunDataExtractsParameters, + options?: BareMetalMachinesRunDataExtractsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesRunDataExtractsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunDataExtractsParameters, + options + }, + spec: runDataExtractsOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesRunDataExtractsResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginRunDataExtractsAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunDataExtractsParameters: BareMetalMachineRunDataExtractsParameters, + options?: BareMetalMachinesRunDataExtractsOptionalParams + ): Promise { + const poller = await this.beginRunDataExtracts( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunDataExtractsParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginRunReadCommands( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunReadCommandsParameters: BareMetalMachineRunReadCommandsParameters, + options?: BareMetalMachinesRunReadCommandsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesRunReadCommandsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunReadCommandsParameters, + options + }, + spec: runReadCommandsOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesRunReadCommandsResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginRunReadCommandsAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunReadCommandsParameters: BareMetalMachineRunReadCommandsParameters, + options?: BareMetalMachinesRunReadCommandsOptionalParams + ): Promise { + const poller = await this.beginRunReadCommands( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunReadCommandsParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginStart( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesStartOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesStartResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, bareMetalMachineName, options }, + spec: startOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesStartResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginStartAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesStartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroupName, + bareMetalMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUncordon( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesUncordonOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesUncordonResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, bareMetalMachineName, options }, + spec: uncordonOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesUncordonResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUncordonAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesUncordonOptionalParams + ): Promise { + const poller = await this.beginUncordon( + resourceGroupName, + bareMetalMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginValidateHardware( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineValidateHardwareParameters: BareMetalMachineValidateHardwareParameters, + options?: BareMetalMachinesValidateHardwareOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesValidateHardwareResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + bareMetalMachineName, + bareMetalMachineValidateHardwareParameters, + options + }, + spec: validateHardwareOperationSpec + }); + const poller = await createHttpPoller< + BareMetalMachinesValidateHardwareResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginValidateHardwareAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineValidateHardwareParameters: BareMetalMachineValidateHardwareParameters, + options?: BareMetalMachinesValidateHardwareOptionalParams + ): Promise { + const poller = await this.beginValidateHardware( + resourceGroupName, + bareMetalMachineName, + bareMetalMachineValidateHardwareParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: BareMetalMachinesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: BareMetalMachinesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/bareMetalMachines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachineList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachineList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachine + }, + 201: { + bodyMapper: Mappers.BareMetalMachine + }, + 202: { + bodyMapper: Mappers.BareMetalMachine + }, + 204: { + bodyMapper: Mappers.BareMetalMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachine + }, + 201: { + bodyMapper: Mappers.BareMetalMachine + }, + 202: { + bodyMapper: Mappers.BareMetalMachine + }, + 204: { + bodyMapper: Mappers.BareMetalMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const cordonOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesCordonHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesCordonHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesCordonHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesCordonHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineCordonParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const powerOffOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesPowerOffHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesPowerOffHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesPowerOffHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesPowerOffHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachinePowerOffParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const reimageOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/reimage", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesReimageHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesReimageHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesReimageHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesReimageHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const replaceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesReplaceHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesReplaceHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesReplaceHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesReplaceHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineReplaceParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const restartOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/restart", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesRestartHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesRestartHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesRestartHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesRestartHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const runCommandOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesRunCommandHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesRunCommandHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesRunCommandHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesRunCommandHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineRunCommandParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const runDataExtractsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesRunDataExtractsHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesRunDataExtractsHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesRunDataExtractsHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesRunDataExtractsHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineRunDataExtractsParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const runReadCommandsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesRunReadCommandsHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesRunReadCommandsHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesRunReadCommandsHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesRunReadCommandsHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineRunReadCommandsParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/start", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesStartHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesStartHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesStartHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesStartHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const uncordonOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/uncordon", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesUncordonHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesUncordonHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesUncordonHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesUncordonHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const validateHardwareOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/validateHardware", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.BareMetalMachinesValidateHardwareHeaders + }, + 201: { + headersMapper: Mappers.BareMetalMachinesValidateHardwareHeaders + }, + 202: { + headersMapper: Mappers.BareMetalMachinesValidateHardwareHeaders + }, + 204: { + headersMapper: Mappers.BareMetalMachinesValidateHardwareHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bareMetalMachineValidateHardwareParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.bareMetalMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachineList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BareMetalMachineList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/bmcKeySets.ts b/sdk/networkcloud/arm-networkcloud/src/operations/bmcKeySets.ts new file mode 100644 index 000000000000..44c7ed73a213 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/bmcKeySets.ts @@ -0,0 +1,646 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { BmcKeySets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + BmcKeySet, + BmcKeySetsListByResourceGroupNextOptionalParams, + BmcKeySetsListByResourceGroupOptionalParams, + BmcKeySetsListByResourceGroupResponse, + BmcKeySetsGetOptionalParams, + BmcKeySetsGetResponse, + BmcKeySetsCreateOrUpdateOptionalParams, + BmcKeySetsCreateOrUpdateResponse, + BmcKeySetsDeleteOptionalParams, + BmcKeySetsUpdateOptionalParams, + BmcKeySetsUpdateResponse, + BmcKeySetsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing BmcKeySets operations. */ +export class BmcKeySetsImpl implements BmcKeySets { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class BmcKeySets class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + clusterName: string, + options?: BmcKeySetsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll( + resourceGroupName, + clusterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + clusterName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + clusterName: string, + options?: BmcKeySetsListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: BmcKeySetsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup( + resourceGroupName, + clusterName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + clusterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + clusterName: string, + options?: BmcKeySetsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + clusterName, + options + )) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + clusterName: string, + options?: BmcKeySetsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, bmcKeySetName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + bmcKeySetParameters: BmcKeySet, + options?: BmcKeySetsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BmcKeySetsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + bmcKeySetName, + bmcKeySetParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + BmcKeySetsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + bmcKeySetParameters: BmcKeySet, + options?: BmcKeySetsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + clusterName, + bmcKeySetName, + bmcKeySetParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, bmcKeySetName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + bmcKeySetName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BmcKeySetsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, bmcKeySetName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + BmcKeySetsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterName, + bmcKeySetName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + clusterName: string, + nextLink: string, + options?: BmcKeySetsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BmcKeySetList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BmcKeySet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.bmcKeySetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BmcKeySet + }, + 201: { + bodyMapper: Mappers.BmcKeySet + }, + 202: { + bodyMapper: Mappers.BmcKeySet + }, + 204: { + bodyMapper: Mappers.BmcKeySet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bmcKeySetParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.bmcKeySetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.bmcKeySetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.BmcKeySet + }, + 201: { + bodyMapper: Mappers.BmcKeySet + }, + 202: { + bodyMapper: Mappers.BmcKeySet + }, + 204: { + bodyMapper: Mappers.BmcKeySet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.bmcKeySetUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.bmcKeySetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BmcKeySetList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/cloudServicesNetworks.ts b/sdk/networkcloud/arm-networkcloud/src/operations/cloudServicesNetworks.ts new file mode 100644 index 000000000000..86fe975df0d4 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/cloudServicesNetworks.ts @@ -0,0 +1,721 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { CloudServicesNetworks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + CloudServicesNetwork, + CloudServicesNetworksListBySubscriptionNextOptionalParams, + CloudServicesNetworksListBySubscriptionOptionalParams, + CloudServicesNetworksListBySubscriptionResponse, + CloudServicesNetworksListByResourceGroupNextOptionalParams, + CloudServicesNetworksListByResourceGroupOptionalParams, + CloudServicesNetworksListByResourceGroupResponse, + CloudServicesNetworksGetOptionalParams, + CloudServicesNetworksGetResponse, + CloudServicesNetworksCreateOrUpdateOptionalParams, + CloudServicesNetworksCreateOrUpdateResponse, + CloudServicesNetworksDeleteOptionalParams, + CloudServicesNetworksUpdateOptionalParams, + CloudServicesNetworksUpdateResponse, + CloudServicesNetworksListBySubscriptionNextResponse, + CloudServicesNetworksListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing CloudServicesNetworks operations. */ +export class CloudServicesNetworksImpl implements CloudServicesNetworks { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class CloudServicesNetworks class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of cloud services networks in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: CloudServicesNetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: CloudServicesNetworksListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: CloudServicesNetworksListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: CloudServicesNetworksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: CloudServicesNetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: CloudServicesNetworksListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: CloudServicesNetworksListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: CloudServicesNetworksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of cloud services networks in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: CloudServicesNetworksListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: CloudServicesNetworksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cloudServicesNetworkName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + cloudServicesNetworkName: string, + cloudServicesNetworkParameters: CloudServicesNetwork, + options?: CloudServicesNetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CloudServicesNetworksCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + cloudServicesNetworkName, + cloudServicesNetworkParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + CloudServicesNetworksCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + cloudServicesNetworkName: string, + cloudServicesNetworkParameters: CloudServicesNetwork, + options?: CloudServicesNetworksCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + cloudServicesNetworkName, + cloudServicesNetworkParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, cloudServicesNetworkName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + cloudServicesNetworkName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CloudServicesNetworksUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, cloudServicesNetworkName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + CloudServicesNetworksUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + cloudServicesNetworkName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: CloudServicesNetworksListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: CloudServicesNetworksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/cloudServicesNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CloudServicesNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CloudServicesNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CloudServicesNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudServicesNetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CloudServicesNetwork + }, + 201: { + bodyMapper: Mappers.CloudServicesNetwork + }, + 202: { + bodyMapper: Mappers.CloudServicesNetwork + }, + 204: { + bodyMapper: Mappers.CloudServicesNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.cloudServicesNetworkParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudServicesNetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudServicesNetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.CloudServicesNetwork + }, + 201: { + bodyMapper: Mappers.CloudServicesNetwork + }, + 202: { + bodyMapper: Mappers.CloudServicesNetwork + }, + 204: { + bodyMapper: Mappers.CloudServicesNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.cloudServicesNetworkUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cloudServicesNetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CloudServicesNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CloudServicesNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/clusterManagers.ts b/sdk/networkcloud/arm-networkcloud/src/operations/clusterManagers.ts new file mode 100644 index 000000000000..b2b726ae4572 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/clusterManagers.ts @@ -0,0 +1,637 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { ClusterManagers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + ClusterManager, + ClusterManagersListBySubscriptionNextOptionalParams, + ClusterManagersListBySubscriptionOptionalParams, + ClusterManagersListBySubscriptionResponse, + ClusterManagersListByResourceGroupNextOptionalParams, + ClusterManagersListByResourceGroupOptionalParams, + ClusterManagersListByResourceGroupResponse, + ClusterManagersGetOptionalParams, + ClusterManagersGetResponse, + ClusterManagersCreateOrUpdateOptionalParams, + ClusterManagersCreateOrUpdateResponse, + ClusterManagersDeleteOptionalParams, + ClusterManagersUpdateOptionalParams, + ClusterManagersUpdateResponse, + ClusterManagersListBySubscriptionNextResponse, + ClusterManagersListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing ClusterManagers operations. */ +export class ClusterManagersImpl implements ClusterManagers { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class ClusterManagers class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of cluster managers in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: ClusterManagersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ClusterManagersListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ClusterManagersListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: ClusterManagersListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ClusterManagersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ClusterManagersListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ClusterManagersListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ClusterManagersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of cluster managers in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: ClusterManagersListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ClusterManagersListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterManagerName: string, + options?: ClusterManagersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterManagerName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + clusterManagerName: string, + clusterManagerParameters: ClusterManager, + options?: ClusterManagersCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClusterManagersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterManagerName, + clusterManagerParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ClusterManagersCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterManagerName: string, + clusterManagerParameters: ClusterManager, + options?: ClusterManagersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + clusterManagerName, + clusterManagerParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterManagerName: string, + options?: ClusterManagersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterManagerName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterManagerName: string, + options?: ClusterManagersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterManagerName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + clusterManagerName: string, + options?: ClusterManagersUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterManagerName, options }, + updateOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: ClusterManagersListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ClusterManagersListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusterManagers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterManagerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterManagerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterManager + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterManagerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ClusterManager + }, + 201: { + bodyMapper: Mappers.ClusterManager + }, + 202: { + bodyMapper: Mappers.ClusterManager + }, + 204: { + bodyMapper: Mappers.ClusterManager + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.clusterManagerParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterManagerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterManagerName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ClusterManager + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.clusterManagerUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterManagerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterManagerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterManagerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/clusters.ts b/sdk/networkcloud/arm-networkcloud/src/operations/clusters.ts new file mode 100644 index 000000000000..956d6388bbc7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/clusters.ts @@ -0,0 +1,979 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Clusters } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Cluster, + ClustersListBySubscriptionNextOptionalParams, + ClustersListBySubscriptionOptionalParams, + ClustersListBySubscriptionResponse, + ClustersListByResourceGroupNextOptionalParams, + ClustersListByResourceGroupOptionalParams, + ClustersListByResourceGroupResponse, + ClustersGetOptionalParams, + ClustersGetResponse, + ClustersCreateOrUpdateOptionalParams, + ClustersCreateOrUpdateResponse, + ClustersDeleteOptionalParams, + ClustersUpdateOptionalParams, + ClustersUpdateResponse, + ClustersDeployOptionalParams, + ClustersDeployResponse, + ClusterUpdateVersionParameters, + ClustersUpdateVersionOptionalParams, + ClustersUpdateVersionResponse, + ClustersListBySubscriptionNextResponse, + ClustersListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Clusters operations. */ +export class ClustersImpl implements Clusters { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class Clusters class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of clusters in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: ClustersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ClustersListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ClustersListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: ClustersListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Get a list of clusters in the provided resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ClustersListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of clusters in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: ClustersListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Get a list of clusters in the provided resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + options?: ClustersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + clusterParameters: Cluster, + options?: ClustersCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClustersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, clusterParameters, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ClustersCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + clusterParameters: Cluster, + options?: ClustersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + clusterName, + clusterParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + clusterName: string, + options?: ClustersUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClustersUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + ClustersUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDeploy( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeployOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClustersDeployResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, options }, + spec: deployOperationSpec + }); + const poller = await createHttpPoller< + ClustersDeployResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeployAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeployOptionalParams + ): Promise { + const poller = await this.beginDeploy( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdateVersion( + resourceGroupName: string, + clusterName: string, + clusterUpdateVersionParameters: ClusterUpdateVersionParameters, + options?: ClustersUpdateVersionOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClustersUpdateVersionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + clusterUpdateVersionParameters, + options + }, + spec: updateVersionOperationSpec + }); + const poller = await createHttpPoller< + ClustersUpdateVersionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateVersionAndWait( + resourceGroupName: string, + clusterName: string, + clusterUpdateVersionParameters: ClusterUpdateVersionParameters, + options?: ClustersUpdateVersionOptionalParams + ): Promise { + const poller = await this.beginUpdateVersion( + resourceGroupName, + clusterName, + clusterUpdateVersionParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: ClustersListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ClustersListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + 201: { + bodyMapper: Mappers.Cluster + }, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.clusterParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + 201: { + bodyMapper: Mappers.Cluster + }, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.clusterUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deployOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.ClustersDeployHeaders + }, + 201: { + headersMapper: Mappers.ClustersDeployHeaders + }, + 202: { + headersMapper: Mappers.ClustersDeployHeaders + }, + 204: { + headersMapper: Mappers.ClustersDeployHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.clusterDeployParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateVersionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.ClustersUpdateVersionHeaders + }, + 201: { + headersMapper: Mappers.ClustersUpdateVersionHeaders + }, + 202: { + headersMapper: Mappers.ClustersUpdateVersionHeaders + }, + 204: { + headersMapper: Mappers.ClustersUpdateVersionHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.clusterUpdateVersionParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/consoles.ts b/sdk/networkcloud/arm-networkcloud/src/operations/consoles.ts new file mode 100644 index 000000000000..d6078f224497 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/consoles.ts @@ -0,0 +1,644 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Consoles } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Console, + ConsolesListByResourceGroupNextOptionalParams, + ConsolesListByResourceGroupOptionalParams, + ConsolesListByResourceGroupResponse, + ConsolesGetOptionalParams, + ConsolesGetResponse, + ConsolesCreateOrUpdateOptionalParams, + ConsolesCreateOrUpdateResponse, + ConsolesDeleteOptionalParams, + ConsolesUpdateOptionalParams, + ConsolesUpdateResponse, + ConsolesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Consoles operations. */ +export class ConsolesImpl implements Consoles { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class Consoles class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + virtualMachineName: string, + options?: ConsolesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll( + resourceGroupName, + virtualMachineName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + virtualMachineName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + virtualMachineName: string, + options?: ConsolesListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ConsolesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup( + resourceGroupName, + virtualMachineName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + virtualMachineName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + virtualMachineName: string, + options?: ConsolesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + virtualMachineName, + options + )) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + virtualMachineName: string, + options?: ConsolesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, consoleName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + consoleParameters: Console, + options?: ConsolesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConsolesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualMachineName, + consoleName, + consoleParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ConsolesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + consoleParameters: Console, + options?: ConsolesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + virtualMachineName, + consoleName, + consoleParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualMachineName, consoleName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualMachineName, + consoleName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConsolesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualMachineName, consoleName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + ConsolesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + virtualMachineName, + consoleName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + virtualMachineName: string, + nextLink: string, + options?: ConsolesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConsoleList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Console + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName, + Parameters.consoleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Console + }, + 201: { + bodyMapper: Mappers.Console + }, + 202: { + bodyMapper: Mappers.Console + }, + 204: { + bodyMapper: Mappers.Console + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.consoleParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName, + Parameters.consoleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName, + Parameters.consoleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Console + }, + 201: { + bodyMapper: Mappers.Console + }, + 202: { + bodyMapper: Mappers.Console + }, + 204: { + bodyMapper: Mappers.Console + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.consoleUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName, + Parameters.consoleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConsoleList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/defaultCniNetworks.ts b/sdk/networkcloud/arm-networkcloud/src/operations/defaultCniNetworks.ts new file mode 100644 index 000000000000..2d41621f19a7 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/defaultCniNetworks.ts @@ -0,0 +1,636 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { DefaultCniNetworks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + DefaultCniNetwork, + DefaultCniNetworksListBySubscriptionNextOptionalParams, + DefaultCniNetworksListBySubscriptionOptionalParams, + DefaultCniNetworksListBySubscriptionResponse, + DefaultCniNetworksListByResourceGroupNextOptionalParams, + DefaultCniNetworksListByResourceGroupOptionalParams, + DefaultCniNetworksListByResourceGroupResponse, + DefaultCniNetworksGetOptionalParams, + DefaultCniNetworksGetResponse, + DefaultCniNetworksCreateOrUpdateOptionalParams, + DefaultCniNetworksCreateOrUpdateResponse, + DefaultCniNetworksDeleteOptionalParams, + DefaultCniNetworksUpdateOptionalParams, + DefaultCniNetworksUpdateResponse, + DefaultCniNetworksListBySubscriptionNextResponse, + DefaultCniNetworksListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing DefaultCniNetworks operations. */ +export class DefaultCniNetworksImpl implements DefaultCniNetworks { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class DefaultCniNetworks class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of default CNI networks in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: DefaultCniNetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: DefaultCniNetworksListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: DefaultCniNetworksListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: DefaultCniNetworksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: DefaultCniNetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: DefaultCniNetworksListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: DefaultCniNetworksListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DefaultCniNetworksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of default CNI networks in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: DefaultCniNetworksListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: DefaultCniNetworksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + defaultCniNetworkName: string, + options?: DefaultCniNetworksGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, defaultCniNetworkName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + defaultCniNetworkName: string, + defaultCniNetworkParameters: DefaultCniNetwork, + options?: DefaultCniNetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + DefaultCniNetworksCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + defaultCniNetworkName, + defaultCniNetworkParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + DefaultCniNetworksCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + defaultCniNetworkName: string, + defaultCniNetworkParameters: DefaultCniNetwork, + options?: DefaultCniNetworksCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + defaultCniNetworkName, + defaultCniNetworkParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + defaultCniNetworkName: string, + options?: DefaultCniNetworksDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, defaultCniNetworkName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + defaultCniNetworkName: string, + options?: DefaultCniNetworksDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + defaultCniNetworkName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + defaultCniNetworkName: string, + options?: DefaultCniNetworksUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, defaultCniNetworkName, options }, + updateOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: DefaultCniNetworksListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DefaultCniNetworksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/defaultCniNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DefaultCniNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DefaultCniNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DefaultCniNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.defaultCniNetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DefaultCniNetwork + }, + 201: { + bodyMapper: Mappers.DefaultCniNetwork + }, + 202: { + bodyMapper: Mappers.DefaultCniNetwork + }, + 204: { + bodyMapper: Mappers.DefaultCniNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.defaultCniNetworkParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.defaultCniNetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.defaultCniNetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DefaultCniNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.defaultCniNetworkUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.defaultCniNetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DefaultCniNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DefaultCniNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/hybridAksClusters.ts b/sdk/networkcloud/arm-networkcloud/src/operations/hybridAksClusters.ts new file mode 100644 index 000000000000..3f762dae94e0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/hybridAksClusters.ts @@ -0,0 +1,785 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { HybridAksClusters } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + HybridAksCluster, + HybridAksClustersListBySubscriptionNextOptionalParams, + HybridAksClustersListBySubscriptionOptionalParams, + HybridAksClustersListBySubscriptionResponse, + HybridAksClustersListByResourceGroupNextOptionalParams, + HybridAksClustersListByResourceGroupOptionalParams, + HybridAksClustersListByResourceGroupResponse, + HybridAksClustersGetOptionalParams, + HybridAksClustersGetResponse, + HybridAksClustersCreateOrUpdateOptionalParams, + HybridAksClustersCreateOrUpdateResponse, + HybridAksClustersDeleteOptionalParams, + HybridAksClustersUpdateOptionalParams, + HybridAksClustersUpdateResponse, + HybridAksClusterRestartNodeParameters, + HybridAksClustersRestartNodeOptionalParams, + HybridAksClustersRestartNodeResponse, + HybridAksClustersListBySubscriptionNextResponse, + HybridAksClustersListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing HybridAksClusters operations. */ +export class HybridAksClustersImpl implements HybridAksClusters { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class HybridAksClusters class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of additional details related to Hybrid AKS provisioned clusters in the provided + * subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: HybridAksClustersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: HybridAksClustersListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: HybridAksClustersListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: HybridAksClustersListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: HybridAksClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: HybridAksClustersListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: HybridAksClustersListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: HybridAksClustersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of additional details related to Hybrid AKS provisioned clusters in the provided + * subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: HybridAksClustersListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: HybridAksClustersListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + hybridAksClusterName: string, + options?: HybridAksClustersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, hybridAksClusterName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + hybridAksClusterName: string, + hybridAksClusterParameters: HybridAksCluster, + options?: HybridAksClustersCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + HybridAksClustersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + hybridAksClusterName, + hybridAksClusterParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + HybridAksClustersCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + hybridAksClusterName: string, + hybridAksClusterParameters: HybridAksCluster, + options?: HybridAksClustersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + hybridAksClusterName, + hybridAksClusterParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + hybridAksClusterName: string, + options?: HybridAksClustersDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, hybridAksClusterName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + hybridAksClusterName: string, + options?: HybridAksClustersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + hybridAksClusterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + hybridAksClusterName: string, + options?: HybridAksClustersUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, hybridAksClusterName, options }, + updateOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginRestartNode( + resourceGroupName: string, + hybridAksClusterName: string, + hybridAksClusterRestartNodeParameters: HybridAksClusterRestartNodeParameters, + options?: HybridAksClustersRestartNodeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + HybridAksClustersRestartNodeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + hybridAksClusterName, + hybridAksClusterRestartNodeParameters, + options + }, + spec: restartNodeOperationSpec + }); + const poller = await createHttpPoller< + HybridAksClustersRestartNodeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginRestartNodeAndWait( + resourceGroupName: string, + hybridAksClusterName: string, + hybridAksClusterRestartNodeParameters: HybridAksClusterRestartNodeParameters, + options?: HybridAksClustersRestartNodeOptionalParams + ): Promise { + const poller = await this.beginRestartNode( + resourceGroupName, + hybridAksClusterName, + hybridAksClusterRestartNodeParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: HybridAksClustersListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: HybridAksClustersListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/hybridAksClusters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridAksClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridAksClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridAksCluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hybridAksClusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.HybridAksCluster + }, + 201: { + bodyMapper: Mappers.HybridAksCluster + }, + 202: { + bodyMapper: Mappers.HybridAksCluster + }, + 204: { + bodyMapper: Mappers.HybridAksCluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.hybridAksClusterParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hybridAksClusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hybridAksClusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.HybridAksCluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.hybridAksClusterUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hybridAksClusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const restartNodeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}/restartNode", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.HybridAksClustersRestartNodeHeaders + }, + 201: { + headersMapper: Mappers.HybridAksClustersRestartNodeHeaders + }, + 202: { + headersMapper: Mappers.HybridAksClustersRestartNodeHeaders + }, + 204: { + headersMapper: Mappers.HybridAksClustersRestartNodeHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.hybridAksClusterRestartNodeParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hybridAksClusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridAksClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridAksClusterList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/index.ts b/sdk/networkcloud/arm-networkcloud/src/operations/index.ts new file mode 100644 index 000000000000..100d8ce82179 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/index.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./bareMetalMachines"; +export * from "./cloudServicesNetworks"; +export * from "./clusterManagers"; +export * from "./clusters"; +export * from "./defaultCniNetworks"; +export * from "./hybridAksClusters"; +export * from "./l2Networks"; +export * from "./l3Networks"; +export * from "./rackSkus"; +export * from "./racks"; +export * from "./storageAppliances"; +export * from "./trunkedNetworks"; +export * from "./virtualMachines"; +export * from "./volumes"; +export * from "./bareMetalMachineKeySets"; +export * from "./bmcKeySets"; +export * from "./metricsConfigurations"; +export * from "./consoles"; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/l2Networks.ts b/sdk/networkcloud/arm-networkcloud/src/operations/l2Networks.ts new file mode 100644 index 000000000000..52fb040eea08 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/l2Networks.ts @@ -0,0 +1,631 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { L2Networks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + L2Network, + L2NetworksListBySubscriptionNextOptionalParams, + L2NetworksListBySubscriptionOptionalParams, + L2NetworksListBySubscriptionResponse, + L2NetworksListByResourceGroupNextOptionalParams, + L2NetworksListByResourceGroupOptionalParams, + L2NetworksListByResourceGroupResponse, + L2NetworksGetOptionalParams, + L2NetworksGetResponse, + L2NetworksCreateOrUpdateOptionalParams, + L2NetworksCreateOrUpdateResponse, + L2NetworksDeleteOptionalParams, + L2NetworksUpdateOptionalParams, + L2NetworksUpdateResponse, + L2NetworksListBySubscriptionNextResponse, + L2NetworksListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing L2Networks operations. */ +export class L2NetworksImpl implements L2Networks { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class L2Networks class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of layer 2 (L2) networks in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: L2NetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: L2NetworksListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: L2NetworksListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: L2NetworksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: L2NetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: L2NetworksListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: L2NetworksListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: L2NetworksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of layer 2 (L2) networks in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: L2NetworksListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: L2NetworksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + l2NetworkName: string, + options?: L2NetworksGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, l2NetworkName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + l2NetworkName: string, + l2NetworkParameters: L2Network, + options?: L2NetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + L2NetworksCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, l2NetworkName, l2NetworkParameters, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + L2NetworksCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + l2NetworkName: string, + l2NetworkParameters: L2Network, + options?: L2NetworksCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + l2NetworkName, + l2NetworkParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + l2NetworkName: string, + options?: L2NetworksDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, l2NetworkName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + l2NetworkName: string, + options?: L2NetworksDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + l2NetworkName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + l2NetworkName: string, + options?: L2NetworksUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, l2NetworkName, options }, + updateOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: L2NetworksListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: L2NetworksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l2Networks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L2NetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L2NetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L2Network + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.l2NetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.L2Network + }, + 201: { + bodyMapper: Mappers.L2Network + }, + 202: { + bodyMapper: Mappers.L2Network + }, + 204: { + bodyMapper: Mappers.L2Network + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.l2NetworkParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.l2NetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.l2NetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.L2Network + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.l2NetworkUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.l2NetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L2NetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L2NetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/l3Networks.ts b/sdk/networkcloud/arm-networkcloud/src/operations/l3Networks.ts new file mode 100644 index 000000000000..d097cb07a0e8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/l3Networks.ts @@ -0,0 +1,631 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { L3Networks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + L3Network, + L3NetworksListBySubscriptionNextOptionalParams, + L3NetworksListBySubscriptionOptionalParams, + L3NetworksListBySubscriptionResponse, + L3NetworksListByResourceGroupNextOptionalParams, + L3NetworksListByResourceGroupOptionalParams, + L3NetworksListByResourceGroupResponse, + L3NetworksGetOptionalParams, + L3NetworksGetResponse, + L3NetworksCreateOrUpdateOptionalParams, + L3NetworksCreateOrUpdateResponse, + L3NetworksDeleteOptionalParams, + L3NetworksUpdateOptionalParams, + L3NetworksUpdateResponse, + L3NetworksListBySubscriptionNextResponse, + L3NetworksListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing L3Networks operations. */ +export class L3NetworksImpl implements L3Networks { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class L3Networks class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of layer 3 (L3) networks in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: L3NetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: L3NetworksListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: L3NetworksListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: L3NetworksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: L3NetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: L3NetworksListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: L3NetworksListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: L3NetworksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of layer 3 (L3) networks in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: L3NetworksListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: L3NetworksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + l3NetworkName: string, + options?: L3NetworksGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, l3NetworkName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + l3NetworkName: string, + l3NetworkParameters: L3Network, + options?: L3NetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + L3NetworksCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, l3NetworkName, l3NetworkParameters, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + L3NetworksCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + l3NetworkName: string, + l3NetworkParameters: L3Network, + options?: L3NetworksCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + l3NetworkName, + l3NetworkParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + l3NetworkName: string, + options?: L3NetworksDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, l3NetworkName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + l3NetworkName: string, + options?: L3NetworksDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + l3NetworkName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + l3NetworkName: string, + options?: L3NetworksUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, l3NetworkName, options }, + updateOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: L3NetworksListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: L3NetworksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l3Networks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L3NetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L3NetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L3Network + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.l3NetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.L3Network + }, + 201: { + bodyMapper: Mappers.L3Network + }, + 202: { + bodyMapper: Mappers.L3Network + }, + 204: { + bodyMapper: Mappers.L3Network + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.l3NetworkParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.l3NetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.l3NetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.L3Network + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.l3NetworkUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.l3NetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L3NetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.L3NetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/metricsConfigurations.ts b/sdk/networkcloud/arm-networkcloud/src/operations/metricsConfigurations.ts new file mode 100644 index 000000000000..6ca7c3f497c9 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/metricsConfigurations.ts @@ -0,0 +1,652 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { MetricsConfigurations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + ClusterMetricsConfiguration, + MetricsConfigurationsListByResourceGroupNextOptionalParams, + MetricsConfigurationsListByResourceGroupOptionalParams, + MetricsConfigurationsListByResourceGroupResponse, + MetricsConfigurationsGetOptionalParams, + MetricsConfigurationsGetResponse, + MetricsConfigurationsCreateOrUpdateOptionalParams, + MetricsConfigurationsCreateOrUpdateResponse, + MetricsConfigurationsDeleteOptionalParams, + MetricsConfigurationsUpdateOptionalParams, + MetricsConfigurationsUpdateResponse, + MetricsConfigurationsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing MetricsConfigurations operations. */ +export class MetricsConfigurationsImpl implements MetricsConfigurations { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class MetricsConfigurations class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + clusterName: string, + options?: MetricsConfigurationsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll( + resourceGroupName, + clusterName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + clusterName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + clusterName: string, + options?: MetricsConfigurationsListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: MetricsConfigurationsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup( + resourceGroupName, + clusterName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + clusterName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + clusterName: string, + options?: MetricsConfigurationsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + clusterName, + options + )) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + clusterName: string, + options?: MetricsConfigurationsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, metricsConfigurationName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + metricsConfigurationParameters: ClusterMetricsConfiguration, + options?: MetricsConfigurationsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MetricsConfigurationsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + MetricsConfigurationsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + metricsConfigurationParameters: ClusterMetricsConfiguration, + options?: MetricsConfigurationsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + metricsConfigurationName, + options + }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + metricsConfigurationName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MetricsConfigurationsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + metricsConfigurationName, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + MetricsConfigurationsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + clusterName, + metricsConfigurationName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + clusterName: string, + nextLink: string, + options?: MetricsConfigurationsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterMetricsConfigurationList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterMetricsConfiguration + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.metricsConfigurationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ClusterMetricsConfiguration + }, + 201: { + bodyMapper: Mappers.ClusterMetricsConfiguration + }, + 202: { + bodyMapper: Mappers.ClusterMetricsConfiguration + }, + 204: { + bodyMapper: Mappers.ClusterMetricsConfiguration + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.metricsConfigurationParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.metricsConfigurationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.metricsConfigurationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ClusterMetricsConfiguration + }, + 201: { + bodyMapper: Mappers.ClusterMetricsConfiguration + }, + 202: { + bodyMapper: Mappers.ClusterMetricsConfiguration + }, + 204: { + bodyMapper: Mappers.ClusterMetricsConfiguration + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.metricsConfigurationUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.metricsConfigurationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ClusterMetricsConfigurationList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/operations.ts b/sdk/networkcloud/arm-networkcloud/src/operations/operations.ts new file mode 100644 index 000000000000..e03dbe2bc7c8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/operations.ts @@ -0,0 +1,151 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of all available resource provider operations. It contains a URL link to get the next set + * of results. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Get a list of all available resource provider operations. It contains a URL link to get the next set + * of results. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.NetworkCloud/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/rackSkus.ts b/sdk/networkcloud/arm-networkcloud/src/operations/rackSkus.ts new file mode 100644 index 000000000000..b8d5e500ad79 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/rackSkus.ts @@ -0,0 +1,195 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { RackSkus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + RackSku, + RackSkusListBySubscriptionNextOptionalParams, + RackSkusListBySubscriptionOptionalParams, + RackSkusListBySubscriptionResponse, + RackSkusGetOptionalParams, + RackSkusGetResponse, + RackSkusListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing RackSkus operations. */ +export class RackSkusImpl implements RackSkus { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class RackSkus class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of rack SKUs in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: RackSkusListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: RackSkusListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: RackSkusListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: RackSkusListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Get a list of rack SKUs in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: RackSkusListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Get the properties of the provided rack SKU. + * @param rackSkuName The name of the rack SKU. + * @param options The options parameters. + */ + get( + rackSkuName: string, + options?: RackSkusGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { rackSkuName, options }, + getOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: RackSkusListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RackSkuList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RackSku + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.rackSkuName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RackSkuList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/racks.ts b/sdk/networkcloud/arm-networkcloud/src/operations/racks.ts new file mode 100644 index 000000000000..0f081df942c5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/racks.ts @@ -0,0 +1,713 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Racks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Rack, + RacksListBySubscriptionNextOptionalParams, + RacksListBySubscriptionOptionalParams, + RacksListBySubscriptionResponse, + RacksListByResourceGroupNextOptionalParams, + RacksListByResourceGroupOptionalParams, + RacksListByResourceGroupResponse, + RacksGetOptionalParams, + RacksGetResponse, + RacksCreateOrUpdateOptionalParams, + RacksCreateOrUpdateResponse, + RacksDeleteOptionalParams, + RacksUpdateOptionalParams, + RacksUpdateResponse, + RacksListBySubscriptionNextResponse, + RacksListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Racks operations. */ +export class RacksImpl implements Racks { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class Racks class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of racks in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: RacksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: RacksListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: RacksListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: RacksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Get a list of racks in the provided resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: RacksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: RacksListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: RacksListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: RacksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of racks in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: RacksListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Get a list of racks in the provided resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: RacksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + rackName: string, + options?: RacksGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, rackName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + rackName: string, + rackParameters: Rack, + options?: RacksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + RacksCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, rackName, rackParameters, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + RacksCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + rackName: string, + rackParameters: Rack, + options?: RacksCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + rackName, + rackParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + rackName: string, + options?: RacksDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, rackName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + rackName: string, + options?: RacksDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceGroupName, rackName, options); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + rackName: string, + options?: RacksUpdateOptionalParams + ): Promise< + SimplePollerLike, RacksUpdateResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, rackName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + RacksUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + rackName: string, + options?: RacksUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate(resourceGroupName, rackName, options); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: RacksListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: RacksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/racks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RackList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RackList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Rack + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.rackName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Rack + }, + 201: { + bodyMapper: Mappers.Rack + }, + 202: { + bodyMapper: Mappers.Rack + }, + 204: { + bodyMapper: Mappers.Rack + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.rackParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.rackName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.rackName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Rack + }, + 201: { + bodyMapper: Mappers.Rack + }, + 202: { + bodyMapper: Mappers.Rack + }, + 204: { + bodyMapper: Mappers.Rack + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.rackUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.rackName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RackList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RackList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/storageAppliances.ts b/sdk/networkcloud/arm-networkcloud/src/operations/storageAppliances.ts new file mode 100644 index 000000000000..3b1f3219d7e3 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/storageAppliances.ts @@ -0,0 +1,1262 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { StorageAppliances } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + StorageAppliance, + StorageAppliancesListBySubscriptionNextOptionalParams, + StorageAppliancesListBySubscriptionOptionalParams, + StorageAppliancesListBySubscriptionResponse, + StorageAppliancesListByResourceGroupNextOptionalParams, + StorageAppliancesListByResourceGroupOptionalParams, + StorageAppliancesListByResourceGroupResponse, + StorageAppliancesGetOptionalParams, + StorageAppliancesGetResponse, + StorageAppliancesCreateOrUpdateOptionalParams, + StorageAppliancesCreateOrUpdateResponse, + StorageAppliancesDeleteOptionalParams, + StorageAppliancesUpdateOptionalParams, + StorageAppliancesUpdateResponse, + StorageAppliancesDisableRemoteVendorManagementOptionalParams, + StorageAppliancesDisableRemoteVendorManagementResponse, + StorageAppliancesEnableRemoteVendorManagementOptionalParams, + StorageAppliancesEnableRemoteVendorManagementResponse, + StorageApplianceRunReadCommandsParameters, + StorageAppliancesRunReadCommandsOptionalParams, + StorageAppliancesRunReadCommandsResponse, + StorageApplianceValidateHardwareParameters, + StorageAppliancesValidateHardwareOptionalParams, + StorageAppliancesValidateHardwareResponse, + StorageAppliancesListBySubscriptionNextResponse, + StorageAppliancesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing StorageAppliances operations. */ +export class StorageAppliancesImpl implements StorageAppliances { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class StorageAppliances class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of storage appliances in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: StorageAppliancesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: StorageAppliancesListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: StorageAppliancesListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: StorageAppliancesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: StorageAppliancesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: StorageAppliancesListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: StorageAppliancesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: StorageAppliancesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of storage appliances in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: StorageAppliancesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: StorageAppliancesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, storageApplianceName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceParameters: StorageAppliance, + options?: StorageAppliancesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + storageApplianceName, + storageApplianceParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + StorageAppliancesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceParameters: StorageAppliance, + options?: StorageAppliancesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + storageApplianceName, + storageApplianceParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, storageApplianceName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + storageApplianceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, storageApplianceName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + StorageAppliancesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + storageApplianceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDisableRemoteVendorManagement( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesDisableRemoteVendorManagementOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesDisableRemoteVendorManagementResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, storageApplianceName, options }, + spec: disableRemoteVendorManagementOperationSpec + }); + const poller = await createHttpPoller< + StorageAppliancesDisableRemoteVendorManagementResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDisableRemoteVendorManagementAndWait( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesDisableRemoteVendorManagementOptionalParams + ): Promise { + const poller = await this.beginDisableRemoteVendorManagement( + resourceGroupName, + storageApplianceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginEnableRemoteVendorManagement( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesEnableRemoteVendorManagementOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesEnableRemoteVendorManagementResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, storageApplianceName, options }, + spec: enableRemoteVendorManagementOperationSpec + }); + const poller = await createHttpPoller< + StorageAppliancesEnableRemoteVendorManagementResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginEnableRemoteVendorManagementAndWait( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesEnableRemoteVendorManagementOptionalParams + ): Promise { + const poller = await this.beginEnableRemoteVendorManagement( + resourceGroupName, + storageApplianceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginRunReadCommands( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceRunReadCommandsParameters: StorageApplianceRunReadCommandsParameters, + options?: StorageAppliancesRunReadCommandsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesRunReadCommandsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + storageApplianceName, + storageApplianceRunReadCommandsParameters, + options + }, + spec: runReadCommandsOperationSpec + }); + const poller = await createHttpPoller< + StorageAppliancesRunReadCommandsResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginRunReadCommandsAndWait( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceRunReadCommandsParameters: StorageApplianceRunReadCommandsParameters, + options?: StorageAppliancesRunReadCommandsOptionalParams + ): Promise { + const poller = await this.beginRunReadCommands( + resourceGroupName, + storageApplianceName, + storageApplianceRunReadCommandsParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginValidateHardware( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceValidateHardwareParameters: StorageApplianceValidateHardwareParameters, + options?: StorageAppliancesValidateHardwareOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesValidateHardwareResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + storageApplianceName, + storageApplianceValidateHardwareParameters, + options + }, + spec: validateHardwareOperationSpec + }); + const poller = await createHttpPoller< + StorageAppliancesValidateHardwareResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginValidateHardwareAndWait( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceValidateHardwareParameters: StorageApplianceValidateHardwareParameters, + options?: StorageAppliancesValidateHardwareOptionalParams + ): Promise { + const poller = await this.beginValidateHardware( + resourceGroupName, + storageApplianceName, + storageApplianceValidateHardwareParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: StorageAppliancesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: StorageAppliancesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/storageAppliances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageApplianceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageApplianceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageAppliance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageApplianceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.StorageAppliance + }, + 201: { + bodyMapper: Mappers.StorageAppliance + }, + 202: { + bodyMapper: Mappers.StorageAppliance + }, + 204: { + bodyMapper: Mappers.StorageAppliance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.storageApplianceParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageApplianceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageApplianceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.StorageAppliance + }, + 201: { + bodyMapper: Mappers.StorageAppliance + }, + 202: { + bodyMapper: Mappers.StorageAppliance + }, + 204: { + bodyMapper: Mappers.StorageAppliance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.storageApplianceUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageApplianceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const disableRemoteVendorManagementOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/disableRemoteVendorManagement", + httpMethod: "POST", + responses: { + 200: { + headersMapper: + Mappers.StorageAppliancesDisableRemoteVendorManagementHeaders + }, + 201: { + headersMapper: + Mappers.StorageAppliancesDisableRemoteVendorManagementHeaders + }, + 202: { + headersMapper: + Mappers.StorageAppliancesDisableRemoteVendorManagementHeaders + }, + 204: { + headersMapper: + Mappers.StorageAppliancesDisableRemoteVendorManagementHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageApplianceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const enableRemoteVendorManagementOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement", + httpMethod: "POST", + responses: { + 200: { + headersMapper: + Mappers.StorageAppliancesEnableRemoteVendorManagementHeaders + }, + 201: { + headersMapper: + Mappers.StorageAppliancesEnableRemoteVendorManagementHeaders + }, + 202: { + headersMapper: + Mappers.StorageAppliancesEnableRemoteVendorManagementHeaders + }, + 204: { + headersMapper: + Mappers.StorageAppliancesEnableRemoteVendorManagementHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: + Parameters.storageApplianceEnableRemoteVendorManagementParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageApplianceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const runReadCommandsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/runReadCommands", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.StorageAppliancesRunReadCommandsHeaders + }, + 201: { + headersMapper: Mappers.StorageAppliancesRunReadCommandsHeaders + }, + 202: { + headersMapper: Mappers.StorageAppliancesRunReadCommandsHeaders + }, + 204: { + headersMapper: Mappers.StorageAppliancesRunReadCommandsHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.storageApplianceRunReadCommandsParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageApplianceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const validateHardwareOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/validateHardware", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.StorageAppliancesValidateHardwareHeaders + }, + 201: { + headersMapper: Mappers.StorageAppliancesValidateHardwareHeaders + }, + 202: { + headersMapper: Mappers.StorageAppliancesValidateHardwareHeaders + }, + 204: { + headersMapper: Mappers.StorageAppliancesValidateHardwareHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.storageApplianceValidateHardwareParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageApplianceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageApplianceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageApplianceList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/trunkedNetworks.ts b/sdk/networkcloud/arm-networkcloud/src/operations/trunkedNetworks.ts new file mode 100644 index 000000000000..9988469393bb --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/trunkedNetworks.ts @@ -0,0 +1,636 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { TrunkedNetworks } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + TrunkedNetwork, + TrunkedNetworksListBySubscriptionNextOptionalParams, + TrunkedNetworksListBySubscriptionOptionalParams, + TrunkedNetworksListBySubscriptionResponse, + TrunkedNetworksListByResourceGroupNextOptionalParams, + TrunkedNetworksListByResourceGroupOptionalParams, + TrunkedNetworksListByResourceGroupResponse, + TrunkedNetworksGetOptionalParams, + TrunkedNetworksGetResponse, + TrunkedNetworksCreateOrUpdateOptionalParams, + TrunkedNetworksCreateOrUpdateResponse, + TrunkedNetworksDeleteOptionalParams, + TrunkedNetworksUpdateOptionalParams, + TrunkedNetworksUpdateResponse, + TrunkedNetworksListBySubscriptionNextResponse, + TrunkedNetworksListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing TrunkedNetworks operations. */ +export class TrunkedNetworksImpl implements TrunkedNetworks { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class TrunkedNetworks class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of trunked networks in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: TrunkedNetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: TrunkedNetworksListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: TrunkedNetworksListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: TrunkedNetworksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: TrunkedNetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: TrunkedNetworksListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: TrunkedNetworksListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: TrunkedNetworksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of trunked networks in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: TrunkedNetworksListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: TrunkedNetworksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + trunkedNetworkName: string, + options?: TrunkedNetworksGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, trunkedNetworkName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + trunkedNetworkName: string, + trunkedNetworkParameters: TrunkedNetwork, + options?: TrunkedNetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + TrunkedNetworksCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + trunkedNetworkName, + trunkedNetworkParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + TrunkedNetworksCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + trunkedNetworkName: string, + trunkedNetworkParameters: TrunkedNetwork, + options?: TrunkedNetworksCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + trunkedNetworkName, + trunkedNetworkParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + trunkedNetworkName: string, + options?: TrunkedNetworksDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, trunkedNetworkName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + trunkedNetworkName: string, + options?: TrunkedNetworksDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + trunkedNetworkName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + trunkedNetworkName: string, + options?: TrunkedNetworksUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, trunkedNetworkName, options }, + updateOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: TrunkedNetworksListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: TrunkedNetworksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/trunkedNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TrunkedNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TrunkedNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TrunkedNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.trunkedNetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TrunkedNetwork + }, + 201: { + bodyMapper: Mappers.TrunkedNetwork + }, + 202: { + bodyMapper: Mappers.TrunkedNetwork + }, + 204: { + bodyMapper: Mappers.TrunkedNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.trunkedNetworkParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.trunkedNetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.trunkedNetworkName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.TrunkedNetwork + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.trunkedNetworkUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.trunkedNetworkName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TrunkedNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TrunkedNetworkList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/virtualMachines.ts b/sdk/networkcloud/arm-networkcloud/src/operations/virtualMachines.ts new file mode 100644 index 000000000000..8f34c2af2a91 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/virtualMachines.ts @@ -0,0 +1,1492 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { VirtualMachines } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + VirtualMachine, + VirtualMachinesListBySubscriptionNextOptionalParams, + VirtualMachinesListBySubscriptionOptionalParams, + VirtualMachinesListBySubscriptionResponse, + VirtualMachinesListByResourceGroupNextOptionalParams, + VirtualMachinesListByResourceGroupOptionalParams, + VirtualMachinesListByResourceGroupResponse, + VirtualMachinesGetOptionalParams, + VirtualMachinesGetResponse, + VirtualMachinesCreateOrUpdateOptionalParams, + VirtualMachinesCreateOrUpdateResponse, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesUpdateResponse, + VirtualMachineVolumeParameters, + VirtualMachinesAttachVolumeOptionalParams, + VirtualMachinesAttachVolumeResponse, + VirtualMachinesDetachVolumeOptionalParams, + VirtualMachinesDetachVolumeResponse, + VirtualMachinesPowerOffOptionalParams, + VirtualMachinesPowerOffResponse, + VirtualMachinesReimageOptionalParams, + VirtualMachinesReimageResponse, + VirtualMachinesRestartOptionalParams, + VirtualMachinesRestartResponse, + VirtualMachinesStartOptionalParams, + VirtualMachinesStartResponse, + VirtualMachinesListBySubscriptionNextResponse, + VirtualMachinesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing VirtualMachines operations. */ +export class VirtualMachinesImpl implements VirtualMachines { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class VirtualMachines class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of virtual machines in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: VirtualMachinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: VirtualMachinesListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VirtualMachinesListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: VirtualMachinesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * 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 options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VirtualMachinesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of virtual machines in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: VirtualMachinesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualMachineName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineParameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualMachineName, + virtualMachineParameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + VirtualMachinesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineParameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + virtualMachineName, + virtualMachineParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualMachineName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualMachineName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + VirtualMachinesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginAttachVolume( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineAttachVolumeParameters: VirtualMachineVolumeParameters, + options?: VirtualMachinesAttachVolumeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesAttachVolumeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualMachineName, + virtualMachineAttachVolumeParameters, + options + }, + spec: attachVolumeOperationSpec + }); + const poller = await createHttpPoller< + VirtualMachinesAttachVolumeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginAttachVolumeAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineAttachVolumeParameters: VirtualMachineVolumeParameters, + options?: VirtualMachinesAttachVolumeOptionalParams + ): Promise { + const poller = await this.beginAttachVolume( + resourceGroupName, + virtualMachineName, + virtualMachineAttachVolumeParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDetachVolume( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineDetachVolumeParameters: VirtualMachineVolumeParameters, + options?: VirtualMachinesDetachVolumeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesDetachVolumeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualMachineName, + virtualMachineDetachVolumeParameters, + options + }, + spec: detachVolumeOperationSpec + }); + const poller = await createHttpPoller< + VirtualMachinesDetachVolumeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDetachVolumeAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineDetachVolumeParameters: VirtualMachineVolumeParameters, + options?: VirtualMachinesDetachVolumeOptionalParams + ): Promise { + const poller = await this.beginDetachVolume( + resourceGroupName, + virtualMachineName, + virtualMachineDetachVolumeParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginPowerOff( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesPowerOffOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesPowerOffResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualMachineName, options }, + spec: powerOffOperationSpec + }); + const poller = await createHttpPoller< + VirtualMachinesPowerOffResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginPowerOffAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesPowerOffOptionalParams + ): Promise { + const poller = await this.beginPowerOff( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginReimage( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesReimageOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesReimageResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualMachineName, options }, + spec: reimageOperationSpec + }); + const poller = await createHttpPoller< + VirtualMachinesReimageResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginReimageAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesReimageOptionalParams + ): Promise { + const poller = await this.beginReimage( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginRestart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesRestartOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesRestartResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualMachineName, options }, + spec: restartOperationSpec + }); + const poller = await createHttpPoller< + VirtualMachinesRestartResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginRestartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesRestartOptionalParams + ): Promise { + const poller = await this.beginRestart( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginStart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesStartResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualMachineName, options }, + spec: startOperationSpec + }); + const poller = await createHttpPoller< + VirtualMachinesStartResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginStartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroupName, + virtualMachineName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: VirtualMachinesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: VirtualMachinesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/virtualMachines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachine + }, + 201: { + bodyMapper: Mappers.VirtualMachine + }, + 202: { + bodyMapper: Mappers.VirtualMachine + }, + 204: { + bodyMapper: Mappers.VirtualMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.virtualMachineParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachine + }, + 201: { + bodyMapper: Mappers.VirtualMachine + }, + 202: { + bodyMapper: Mappers.VirtualMachine + }, + 204: { + bodyMapper: Mappers.VirtualMachine + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.virtualMachineUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const attachVolumeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/attachVolume", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.VirtualMachinesAttachVolumeHeaders + }, + 201: { + headersMapper: Mappers.VirtualMachinesAttachVolumeHeaders + }, + 202: { + headersMapper: Mappers.VirtualMachinesAttachVolumeHeaders + }, + 204: { + headersMapper: Mappers.VirtualMachinesAttachVolumeHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.virtualMachineAttachVolumeParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const detachVolumeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/detachVolume", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.VirtualMachinesDetachVolumeHeaders + }, + 201: { + headersMapper: Mappers.VirtualMachinesDetachVolumeHeaders + }, + 202: { + headersMapper: Mappers.VirtualMachinesDetachVolumeHeaders + }, + 204: { + headersMapper: Mappers.VirtualMachinesDetachVolumeHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.virtualMachineDetachVolumeParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const powerOffOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.VirtualMachinesPowerOffHeaders + }, + 201: { + headersMapper: Mappers.VirtualMachinesPowerOffHeaders + }, + 202: { + headersMapper: Mappers.VirtualMachinesPowerOffHeaders + }, + 204: { + headersMapper: Mappers.VirtualMachinesPowerOffHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.virtualMachinePowerOffParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const reimageOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/reimage", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.VirtualMachinesReimageHeaders + }, + 201: { + headersMapper: Mappers.VirtualMachinesReimageHeaders + }, + 202: { + headersMapper: Mappers.VirtualMachinesReimageHeaders + }, + 204: { + headersMapper: Mappers.VirtualMachinesReimageHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const restartOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/restart", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.VirtualMachinesRestartHeaders + }, + 201: { + headersMapper: Mappers.VirtualMachinesRestartHeaders + }, + 202: { + headersMapper: Mappers.VirtualMachinesRestartHeaders + }, + 204: { + headersMapper: Mappers.VirtualMachinesRestartHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const startOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/start", + httpMethod: "POST", + responses: { + 200: { + headersMapper: Mappers.VirtualMachinesStartHeaders + }, + 201: { + headersMapper: Mappers.VirtualMachinesStartHeaders + }, + 202: { + headersMapper: Mappers.VirtualMachinesStartHeaders + }, + 204: { + headersMapper: Mappers.VirtualMachinesStartHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualMachineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualMachineList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operations/volumes.ts b/sdk/networkcloud/arm-networkcloud/src/operations/volumes.ts new file mode 100644 index 000000000000..0e47ce7f7848 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operations/volumes.ts @@ -0,0 +1,631 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Volumes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { NetworkCloud } from "../networkCloud"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + Volume, + VolumesListBySubscriptionNextOptionalParams, + VolumesListBySubscriptionOptionalParams, + VolumesListBySubscriptionResponse, + VolumesListByResourceGroupNextOptionalParams, + VolumesListByResourceGroupOptionalParams, + VolumesListByResourceGroupResponse, + VolumesGetOptionalParams, + VolumesGetResponse, + VolumesCreateOrUpdateOptionalParams, + VolumesCreateOrUpdateResponse, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesUpdateResponse, + VolumesListBySubscriptionNextResponse, + VolumesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Volumes operations. */ +export class VolumesImpl implements Volumes { + private readonly client: NetworkCloud; + + /** + * Initialize a new instance of the class Volumes class. + * @param client Reference to the service client + */ + constructor(client: NetworkCloud) { + this.client = client; + } + + /** + * Get a list of volumes in the provided subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: VolumesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: VolumesListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VolumesListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: VolumesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Get a list of volumes in the provided resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: VolumesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: VolumesListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VolumesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: VolumesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Get a list of volumes in the provided subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: VolumesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Get a list of volumes in the provided resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: VolumesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, volumeName, options }, + getOperationSpec + ); + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + volumeName: string, + volumeParameters: Volume, + options?: VolumesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VolumesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, volumeName, volumeParameters, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + VolumesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + volumeName: string, + volumeParameters: Volume, + options?: VolumesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + volumeName, + volumeParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, volumeName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * 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 options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + volumeName, + options + ); + return poller.pollUntilDone(); + } + + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + volumeName: string, + options?: VolumesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, volumeName, options }, + updateOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: VolumesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: VolumesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/volumes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Volume + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Volume + }, + 201: { + bodyMapper: Mappers.Volume + }, + 202: { + bodyMapper: Mappers.Volume + }, + 204: { + bodyMapper: Mappers.Volume + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.volumeParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Volume + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.volumeUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bareMetalMachineKeySets.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bareMetalMachineKeySets.ts new file mode 100644 index 000000000000..3c3b0c9e4a08 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bareMetalMachineKeySets.ts @@ -0,0 +1,144 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + BareMetalMachineKeySet, + BareMetalMachineKeySetsListByResourceGroupOptionalParams, + BareMetalMachineKeySetsGetOptionalParams, + BareMetalMachineKeySetsGetResponse, + BareMetalMachineKeySetsCreateOrUpdateOptionalParams, + BareMetalMachineKeySetsCreateOrUpdateResponse, + BareMetalMachineKeySetsDeleteOptionalParams, + BareMetalMachineKeySetsUpdateOptionalParams, + BareMetalMachineKeySetsUpdateResponse +} from "../models"; + +/// +/** Interface representing a BareMetalMachineKeySets. */ +export interface BareMetalMachineKeySets { + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + clusterName: string, + options?: BareMetalMachineKeySetsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + bareMetalMachineKeySetParameters: BareMetalMachineKeySet, + options?: BareMetalMachineKeySetsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachineKeySetsCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + bareMetalMachineKeySetParameters: BareMetalMachineKeySet, + options?: BareMetalMachineKeySetsCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachineKeySetsUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + bareMetalMachineKeySetName: string, + options?: BareMetalMachineKeySetsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bareMetalMachines.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bareMetalMachines.ts new file mode 100644 index 000000000000..cbab13c4b0d0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bareMetalMachines.ts @@ -0,0 +1,495 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + BareMetalMachine, + BareMetalMachinesListBySubscriptionOptionalParams, + BareMetalMachinesListByResourceGroupOptionalParams, + BareMetalMachinesGetOptionalParams, + BareMetalMachinesGetResponse, + BareMetalMachinesCreateOrUpdateOptionalParams, + BareMetalMachinesCreateOrUpdateResponse, + BareMetalMachinesDeleteOptionalParams, + BareMetalMachinesUpdateOptionalParams, + BareMetalMachinesUpdateResponse, + BareMetalMachinesCordonOptionalParams, + BareMetalMachinesCordonResponse, + BareMetalMachinesPowerOffOptionalParams, + BareMetalMachinesPowerOffResponse, + BareMetalMachinesReimageOptionalParams, + BareMetalMachinesReimageResponse, + BareMetalMachinesReplaceOptionalParams, + BareMetalMachinesReplaceResponse, + BareMetalMachinesRestartOptionalParams, + BareMetalMachinesRestartResponse, + BareMetalMachineRunCommandParameters, + BareMetalMachinesRunCommandOptionalParams, + BareMetalMachinesRunCommandResponse, + BareMetalMachineRunDataExtractsParameters, + BareMetalMachinesRunDataExtractsOptionalParams, + BareMetalMachinesRunDataExtractsResponse, + BareMetalMachineRunReadCommandsParameters, + BareMetalMachinesRunReadCommandsOptionalParams, + BareMetalMachinesRunReadCommandsResponse, + BareMetalMachinesStartOptionalParams, + BareMetalMachinesStartResponse, + BareMetalMachinesUncordonOptionalParams, + BareMetalMachinesUncordonResponse, + BareMetalMachineValidateHardwareParameters, + BareMetalMachinesValidateHardwareOptionalParams, + BareMetalMachinesValidateHardwareResponse +} from "../models"; + +/// +/** Interface representing a BareMetalMachines. */ +export interface BareMetalMachines { + /** + * Get a list of bare metal machines in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: BareMetalMachinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: BareMetalMachinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineParameters: BareMetalMachine, + options?: BareMetalMachinesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineParameters: BareMetalMachine, + options?: BareMetalMachinesCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCordon( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesCordonOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesCordonResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCordonAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesCordonOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginPowerOff( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesPowerOffOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesPowerOffResponse + > + >; + /** + * 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 options The options parameters. + */ + beginPowerOffAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesPowerOffOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginReimage( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesReimageOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesReimageResponse + > + >; + /** + * 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 options The options parameters. + */ + beginReimageAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesReimageOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginReplace( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesReplaceOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesReplaceResponse + > + >; + /** + * 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 options The options parameters. + */ + beginReplaceAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesReplaceOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginRestart( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesRestartOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesRestartResponse + > + >; + /** + * 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 options The options parameters. + */ + beginRestartAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesRestartOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginRunCommand( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunCommandParameters: BareMetalMachineRunCommandParameters, + options?: BareMetalMachinesRunCommandOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesRunCommandResponse + > + >; + /** + * 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 options The options parameters. + */ + beginRunCommandAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunCommandParameters: BareMetalMachineRunCommandParameters, + options?: BareMetalMachinesRunCommandOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginRunDataExtracts( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunDataExtractsParameters: BareMetalMachineRunDataExtractsParameters, + options?: BareMetalMachinesRunDataExtractsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesRunDataExtractsResponse + > + >; + /** + * 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 options The options parameters. + */ + beginRunDataExtractsAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunDataExtractsParameters: BareMetalMachineRunDataExtractsParameters, + options?: BareMetalMachinesRunDataExtractsOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginRunReadCommands( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunReadCommandsParameters: BareMetalMachineRunReadCommandsParameters, + options?: BareMetalMachinesRunReadCommandsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesRunReadCommandsResponse + > + >; + /** + * 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 options The options parameters. + */ + beginRunReadCommandsAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineRunReadCommandsParameters: BareMetalMachineRunReadCommandsParameters, + options?: BareMetalMachinesRunReadCommandsOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginStart( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesStartOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesStartResponse + > + >; + /** + * 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 options The options parameters. + */ + beginStartAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesStartOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUncordon( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesUncordonOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesUncordonResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUncordonAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + options?: BareMetalMachinesUncordonOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginValidateHardware( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineValidateHardwareParameters: BareMetalMachineValidateHardwareParameters, + options?: BareMetalMachinesValidateHardwareOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BareMetalMachinesValidateHardwareResponse + > + >; + /** + * 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 options The options parameters. + */ + beginValidateHardwareAndWait( + resourceGroupName: string, + bareMetalMachineName: string, + bareMetalMachineValidateHardwareParameters: BareMetalMachineValidateHardwareParameters, + options?: BareMetalMachinesValidateHardwareOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bmcKeySets.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bmcKeySets.ts new file mode 100644 index 000000000000..4b0dfddf95cc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/bmcKeySets.ts @@ -0,0 +1,147 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + BmcKeySet, + BmcKeySetsListByResourceGroupOptionalParams, + BmcKeySetsGetOptionalParams, + BmcKeySetsGetResponse, + BmcKeySetsCreateOrUpdateOptionalParams, + BmcKeySetsCreateOrUpdateResponse, + BmcKeySetsDeleteOptionalParams, + BmcKeySetsUpdateOptionalParams, + BmcKeySetsUpdateResponse +} from "../models"; + +/// +/** Interface representing a BmcKeySets. */ +export interface BmcKeySets { + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + clusterName: string, + options?: BmcKeySetsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + bmcKeySetParameters: BmcKeySet, + options?: BmcKeySetsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BmcKeySetsCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + bmcKeySetParameters: BmcKeySet, + options?: BmcKeySetsCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + BmcKeySetsUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + bmcKeySetName: string, + options?: BmcKeySetsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/cloudServicesNetworks.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/cloudServicesNetworks.ts new file mode 100644 index 000000000000..1a0d1367c252 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/cloudServicesNetworks.ts @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + CloudServicesNetwork, + CloudServicesNetworksListBySubscriptionOptionalParams, + CloudServicesNetworksListByResourceGroupOptionalParams, + CloudServicesNetworksGetOptionalParams, + CloudServicesNetworksGetResponse, + CloudServicesNetworksCreateOrUpdateOptionalParams, + CloudServicesNetworksCreateOrUpdateResponse, + CloudServicesNetworksDeleteOptionalParams, + CloudServicesNetworksUpdateOptionalParams, + CloudServicesNetworksUpdateResponse +} from "../models"; + +/// +/** Interface representing a CloudServicesNetworks. */ +export interface CloudServicesNetworks { + /** + * Get a list of cloud services networks in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: CloudServicesNetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: CloudServicesNetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + cloudServicesNetworkName: string, + cloudServicesNetworkParameters: CloudServicesNetwork, + options?: CloudServicesNetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CloudServicesNetworksCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + cloudServicesNetworkName: string, + cloudServicesNetworkParameters: CloudServicesNetwork, + options?: CloudServicesNetworksCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CloudServicesNetworksUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + cloudServicesNetworkName: string, + options?: CloudServicesNetworksUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/clusterManagers.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/clusterManagers.ts new file mode 100644 index 000000000000..2f28cd2b5848 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/clusterManagers.ts @@ -0,0 +1,119 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + ClusterManager, + ClusterManagersListBySubscriptionOptionalParams, + ClusterManagersListByResourceGroupOptionalParams, + ClusterManagersGetOptionalParams, + ClusterManagersGetResponse, + ClusterManagersCreateOrUpdateOptionalParams, + ClusterManagersCreateOrUpdateResponse, + ClusterManagersDeleteOptionalParams, + ClusterManagersUpdateOptionalParams, + ClusterManagersUpdateResponse +} from "../models"; + +/// +/** Interface representing a ClusterManagers. */ +export interface ClusterManagers { + /** + * Get a list of cluster managers in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: ClusterManagersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ClusterManagersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterManagerName: string, + options?: ClusterManagersGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + clusterManagerName: string, + clusterManagerParameters: ClusterManager, + options?: ClusterManagersCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClusterManagersCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterManagerName: string, + clusterManagerParameters: ClusterManager, + options?: ClusterManagersCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterManagerName: string, + options?: ClusterManagersDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterManagerName: string, + options?: ClusterManagersDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + clusterManagerName: string, + options?: ClusterManagersUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/clusters.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/clusters.ts new file mode 100644 index 000000000000..40222010c20d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/clusters.ts @@ -0,0 +1,199 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Cluster, + ClustersListBySubscriptionOptionalParams, + ClustersListByResourceGroupOptionalParams, + ClustersGetOptionalParams, + ClustersGetResponse, + ClustersCreateOrUpdateOptionalParams, + ClustersCreateOrUpdateResponse, + ClustersDeleteOptionalParams, + ClustersUpdateOptionalParams, + ClustersUpdateResponse, + ClustersDeployOptionalParams, + ClustersDeployResponse, + ClusterUpdateVersionParameters, + ClustersUpdateVersionOptionalParams, + ClustersUpdateVersionResponse +} from "../models"; + +/// +/** Interface representing a Clusters. */ +export interface Clusters { + /** + * Get a list of clusters in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: ClustersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of clusters in the provided resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + options?: ClustersGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + clusterParameters: Cluster, + options?: ClustersCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClustersCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + clusterParameters: Cluster, + options?: ClustersCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterName: string, + options?: ClustersUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClustersUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDeploy( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeployOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClustersDeployResponse + > + >; + /** + * 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 options The options parameters. + */ + beginDeployAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeployOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdateVersion( + resourceGroupName: string, + clusterName: string, + clusterUpdateVersionParameters: ClusterUpdateVersionParameters, + options?: ClustersUpdateVersionOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ClustersUpdateVersionResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateVersionAndWait( + resourceGroupName: string, + clusterName: string, + clusterUpdateVersionParameters: ClusterUpdateVersionParameters, + options?: ClustersUpdateVersionOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/consoles.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/consoles.ts new file mode 100644 index 000000000000..f041c3f9f526 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/consoles.ts @@ -0,0 +1,146 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Console, + ConsolesListByResourceGroupOptionalParams, + ConsolesGetOptionalParams, + ConsolesGetResponse, + ConsolesCreateOrUpdateOptionalParams, + ConsolesCreateOrUpdateResponse, + ConsolesDeleteOptionalParams, + ConsolesUpdateOptionalParams, + ConsolesUpdateResponse +} from "../models"; + +/// +/** Interface representing a Consoles. */ +export interface Consoles { + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + virtualMachineName: string, + options?: ConsolesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + consoleParameters: Console, + options?: ConsolesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConsolesCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + consoleParameters: Console, + options?: ConsolesCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ConsolesUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + consoleName: string, + options?: ConsolesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/defaultCniNetworks.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/defaultCniNetworks.ts new file mode 100644 index 000000000000..c7ab54fd5ab5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/defaultCniNetworks.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + DefaultCniNetwork, + DefaultCniNetworksListBySubscriptionOptionalParams, + DefaultCniNetworksListByResourceGroupOptionalParams, + DefaultCniNetworksGetOptionalParams, + DefaultCniNetworksGetResponse, + DefaultCniNetworksCreateOrUpdateOptionalParams, + DefaultCniNetworksCreateOrUpdateResponse, + DefaultCniNetworksDeleteOptionalParams, + DefaultCniNetworksUpdateOptionalParams, + DefaultCniNetworksUpdateResponse +} from "../models"; + +/// +/** Interface representing a DefaultCniNetworks. */ +export interface DefaultCniNetworks { + /** + * Get a list of default CNI networks in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: DefaultCniNetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DefaultCniNetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + defaultCniNetworkName: string, + options?: DefaultCniNetworksGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + defaultCniNetworkName: string, + defaultCniNetworkParameters: DefaultCniNetwork, + options?: DefaultCniNetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + DefaultCniNetworksCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + defaultCniNetworkName: string, + defaultCniNetworkParameters: DefaultCniNetwork, + options?: DefaultCniNetworksCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + defaultCniNetworkName: string, + options?: DefaultCniNetworksDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + defaultCniNetworkName: string, + options?: DefaultCniNetworksDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + defaultCniNetworkName: string, + options?: DefaultCniNetworksUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/hybridAksClusters.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/hybridAksClusters.ts new file mode 100644 index 000000000000..20cc88f6846a --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/hybridAksClusters.ts @@ -0,0 +1,163 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + HybridAksCluster, + HybridAksClustersListBySubscriptionOptionalParams, + HybridAksClustersListByResourceGroupOptionalParams, + HybridAksClustersGetOptionalParams, + HybridAksClustersGetResponse, + HybridAksClustersCreateOrUpdateOptionalParams, + HybridAksClustersCreateOrUpdateResponse, + HybridAksClustersDeleteOptionalParams, + HybridAksClustersUpdateOptionalParams, + HybridAksClustersUpdateResponse, + HybridAksClusterRestartNodeParameters, + HybridAksClustersRestartNodeOptionalParams, + HybridAksClustersRestartNodeResponse +} from "../models"; + +/// +/** Interface representing a HybridAksClusters. */ +export interface HybridAksClusters { + /** + * Get a list of additional details related to Hybrid AKS provisioned clusters in the provided + * subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: HybridAksClustersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: HybridAksClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + hybridAksClusterName: string, + options?: HybridAksClustersGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + hybridAksClusterName: string, + hybridAksClusterParameters: HybridAksCluster, + options?: HybridAksClustersCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + HybridAksClustersCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + hybridAksClusterName: string, + hybridAksClusterParameters: HybridAksCluster, + options?: HybridAksClustersCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + hybridAksClusterName: string, + options?: HybridAksClustersDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + hybridAksClusterName: string, + options?: HybridAksClustersDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + hybridAksClusterName: string, + options?: HybridAksClustersUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginRestartNode( + resourceGroupName: string, + hybridAksClusterName: string, + hybridAksClusterRestartNodeParameters: HybridAksClusterRestartNodeParameters, + options?: HybridAksClustersRestartNodeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + HybridAksClustersRestartNodeResponse + > + >; + /** + * 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 options The options parameters. + */ + beginRestartNodeAndWait( + resourceGroupName: string, + hybridAksClusterName: string, + hybridAksClusterRestartNodeParameters: HybridAksClusterRestartNodeParameters, + options?: HybridAksClustersRestartNodeOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/index.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..100d8ce82179 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/index.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./bareMetalMachines"; +export * from "./cloudServicesNetworks"; +export * from "./clusterManagers"; +export * from "./clusters"; +export * from "./defaultCniNetworks"; +export * from "./hybridAksClusters"; +export * from "./l2Networks"; +export * from "./l3Networks"; +export * from "./rackSkus"; +export * from "./racks"; +export * from "./storageAppliances"; +export * from "./trunkedNetworks"; +export * from "./virtualMachines"; +export * from "./volumes"; +export * from "./bareMetalMachineKeySets"; +export * from "./bmcKeySets"; +export * from "./metricsConfigurations"; +export * from "./consoles"; diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/l2Networks.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/l2Networks.ts new file mode 100644 index 000000000000..8ee0bd6ab229 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/l2Networks.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + L2Network, + L2NetworksListBySubscriptionOptionalParams, + L2NetworksListByResourceGroupOptionalParams, + L2NetworksGetOptionalParams, + L2NetworksGetResponse, + L2NetworksCreateOrUpdateOptionalParams, + L2NetworksCreateOrUpdateResponse, + L2NetworksDeleteOptionalParams, + L2NetworksUpdateOptionalParams, + L2NetworksUpdateResponse +} from "../models"; + +/// +/** Interface representing a L2Networks. */ +export interface L2Networks { + /** + * Get a list of layer 2 (L2) networks in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: L2NetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: L2NetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + l2NetworkName: string, + options?: L2NetworksGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + l2NetworkName: string, + l2NetworkParameters: L2Network, + options?: L2NetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + L2NetworksCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + l2NetworkName: string, + l2NetworkParameters: L2Network, + options?: L2NetworksCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + l2NetworkName: string, + options?: L2NetworksDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + l2NetworkName: string, + options?: L2NetworksDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + l2NetworkName: string, + options?: L2NetworksUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/l3Networks.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/l3Networks.ts new file mode 100644 index 000000000000..31b29a0508f3 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/l3Networks.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + L3Network, + L3NetworksListBySubscriptionOptionalParams, + L3NetworksListByResourceGroupOptionalParams, + L3NetworksGetOptionalParams, + L3NetworksGetResponse, + L3NetworksCreateOrUpdateOptionalParams, + L3NetworksCreateOrUpdateResponse, + L3NetworksDeleteOptionalParams, + L3NetworksUpdateOptionalParams, + L3NetworksUpdateResponse +} from "../models"; + +/// +/** Interface representing a L3Networks. */ +export interface L3Networks { + /** + * Get a list of layer 3 (L3) networks in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: L3NetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: L3NetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + l3NetworkName: string, + options?: L3NetworksGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + l3NetworkName: string, + l3NetworkParameters: L3Network, + options?: L3NetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + L3NetworksCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + l3NetworkName: string, + l3NetworkParameters: L3Network, + options?: L3NetworksCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + l3NetworkName: string, + options?: L3NetworksDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + l3NetworkName: string, + options?: L3NetworksDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + l3NetworkName: string, + options?: L3NetworksUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/metricsConfigurations.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/metricsConfigurations.ts new file mode 100644 index 000000000000..80a519a1a8bc --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/metricsConfigurations.ts @@ -0,0 +1,144 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + ClusterMetricsConfiguration, + MetricsConfigurationsListByResourceGroupOptionalParams, + MetricsConfigurationsGetOptionalParams, + MetricsConfigurationsGetResponse, + MetricsConfigurationsCreateOrUpdateOptionalParams, + MetricsConfigurationsCreateOrUpdateResponse, + MetricsConfigurationsDeleteOptionalParams, + MetricsConfigurationsUpdateOptionalParams, + MetricsConfigurationsUpdateResponse +} from "../models"; + +/// +/** Interface representing a MetricsConfigurations. */ +export interface MetricsConfigurations { + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + clusterName: string, + options?: MetricsConfigurationsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + metricsConfigurationParameters: ClusterMetricsConfiguration, + options?: MetricsConfigurationsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MetricsConfigurationsCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + metricsConfigurationParameters: ClusterMetricsConfiguration, + options?: MetricsConfigurationsCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + MetricsConfigurationsUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + clusterName: string, + metricsConfigurationName: string, + options?: MetricsConfigurationsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/operations.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..6ed0b0f5f5d0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/operations.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Get a list of all available resource provider operations. It contains a URL link to get the next set + * of results. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/rackSkus.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/rackSkus.ts new file mode 100644 index 000000000000..2db34945ea54 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/rackSkus.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RackSku, + RackSkusListBySubscriptionOptionalParams, + RackSkusGetOptionalParams, + RackSkusGetResponse +} from "../models"; + +/// +/** Interface representing a RackSkus. */ +export interface RackSkus { + /** + * Get a list of rack SKUs in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: RackSkusListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the properties of the provided rack SKU. + * @param rackSkuName The name of the rack SKU. + * @param options The options parameters. + */ + get( + rackSkuName: string, + options?: RackSkusGetOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/racks.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/racks.ts new file mode 100644 index 000000000000..a6fae86014e0 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/racks.ts @@ -0,0 +1,141 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Rack, + RacksListBySubscriptionOptionalParams, + RacksListByResourceGroupOptionalParams, + RacksGetOptionalParams, + RacksGetResponse, + RacksCreateOrUpdateOptionalParams, + RacksCreateOrUpdateResponse, + RacksDeleteOptionalParams, + RacksUpdateOptionalParams, + RacksUpdateResponse +} from "../models"; + +/// +/** Interface representing a Racks. */ +export interface Racks { + /** + * Get a list of racks in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: RacksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of racks in the provided resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: RacksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + rackName: string, + options?: RacksGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + rackName: string, + rackParameters: Rack, + options?: RacksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + RacksCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + rackName: string, + rackParameters: Rack, + options?: RacksCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + rackName: string, + options?: RacksDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + rackName: string, + options?: RacksDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + rackName: string, + options?: RacksUpdateOptionalParams + ): Promise< + SimplePollerLike, RacksUpdateResponse> + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + rackName: string, + options?: RacksUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/storageAppliances.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/storageAppliances.ts new file mode 100644 index 000000000000..f1876e956f8d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/storageAppliances.ts @@ -0,0 +1,270 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + StorageAppliance, + StorageAppliancesListBySubscriptionOptionalParams, + StorageAppliancesListByResourceGroupOptionalParams, + StorageAppliancesGetOptionalParams, + StorageAppliancesGetResponse, + StorageAppliancesCreateOrUpdateOptionalParams, + StorageAppliancesCreateOrUpdateResponse, + StorageAppliancesDeleteOptionalParams, + StorageAppliancesUpdateOptionalParams, + StorageAppliancesUpdateResponse, + StorageAppliancesDisableRemoteVendorManagementOptionalParams, + StorageAppliancesDisableRemoteVendorManagementResponse, + StorageAppliancesEnableRemoteVendorManagementOptionalParams, + StorageAppliancesEnableRemoteVendorManagementResponse, + StorageApplianceRunReadCommandsParameters, + StorageAppliancesRunReadCommandsOptionalParams, + StorageAppliancesRunReadCommandsResponse, + StorageApplianceValidateHardwareParameters, + StorageAppliancesValidateHardwareOptionalParams, + StorageAppliancesValidateHardwareResponse +} from "../models"; + +/// +/** Interface representing a StorageAppliances. */ +export interface StorageAppliances { + /** + * Get a list of storage appliances in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: StorageAppliancesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: StorageAppliancesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceParameters: StorageAppliance, + options?: StorageAppliancesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceParameters: StorageAppliance, + options?: StorageAppliancesCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDisableRemoteVendorManagement( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesDisableRemoteVendorManagementOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesDisableRemoteVendorManagementResponse + > + >; + /** + * 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 options The options parameters. + */ + beginDisableRemoteVendorManagementAndWait( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesDisableRemoteVendorManagementOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginEnableRemoteVendorManagement( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesEnableRemoteVendorManagementOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesEnableRemoteVendorManagementResponse + > + >; + /** + * 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 options The options parameters. + */ + beginEnableRemoteVendorManagementAndWait( + resourceGroupName: string, + storageApplianceName: string, + options?: StorageAppliancesEnableRemoteVendorManagementOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginRunReadCommands( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceRunReadCommandsParameters: StorageApplianceRunReadCommandsParameters, + options?: StorageAppliancesRunReadCommandsOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesRunReadCommandsResponse + > + >; + /** + * 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 options The options parameters. + */ + beginRunReadCommandsAndWait( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceRunReadCommandsParameters: StorageApplianceRunReadCommandsParameters, + options?: StorageAppliancesRunReadCommandsOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginValidateHardware( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceValidateHardwareParameters: StorageApplianceValidateHardwareParameters, + options?: StorageAppliancesValidateHardwareOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + StorageAppliancesValidateHardwareResponse + > + >; + /** + * 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 options The options parameters. + */ + beginValidateHardwareAndWait( + resourceGroupName: string, + storageApplianceName: string, + storageApplianceValidateHardwareParameters: StorageApplianceValidateHardwareParameters, + options?: StorageAppliancesValidateHardwareOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/trunkedNetworks.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/trunkedNetworks.ts new file mode 100644 index 000000000000..9c1e1567eaba --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/trunkedNetworks.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + TrunkedNetwork, + TrunkedNetworksListBySubscriptionOptionalParams, + TrunkedNetworksListByResourceGroupOptionalParams, + TrunkedNetworksGetOptionalParams, + TrunkedNetworksGetResponse, + TrunkedNetworksCreateOrUpdateOptionalParams, + TrunkedNetworksCreateOrUpdateResponse, + TrunkedNetworksDeleteOptionalParams, + TrunkedNetworksUpdateOptionalParams, + TrunkedNetworksUpdateResponse +} from "../models"; + +/// +/** Interface representing a TrunkedNetworks. */ +export interface TrunkedNetworks { + /** + * Get a list of trunked networks in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: TrunkedNetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: TrunkedNetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + trunkedNetworkName: string, + options?: TrunkedNetworksGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + trunkedNetworkName: string, + trunkedNetworkParameters: TrunkedNetwork, + options?: TrunkedNetworksCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + TrunkedNetworksCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + trunkedNetworkName: string, + trunkedNetworkParameters: TrunkedNetwork, + options?: TrunkedNetworksCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + trunkedNetworkName: string, + options?: TrunkedNetworksDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + trunkedNetworkName: string, + options?: TrunkedNetworksDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + trunkedNetworkName: string, + options?: TrunkedNetworksUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/virtualMachines.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/virtualMachines.ts new file mode 100644 index 000000000000..8bc150b29381 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/virtualMachines.ts @@ -0,0 +1,319 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + VirtualMachine, + VirtualMachinesListBySubscriptionOptionalParams, + VirtualMachinesListByResourceGroupOptionalParams, + VirtualMachinesGetOptionalParams, + VirtualMachinesGetResponse, + VirtualMachinesCreateOrUpdateOptionalParams, + VirtualMachinesCreateOrUpdateResponse, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesUpdateResponse, + VirtualMachineVolumeParameters, + VirtualMachinesAttachVolumeOptionalParams, + VirtualMachinesAttachVolumeResponse, + VirtualMachinesDetachVolumeOptionalParams, + VirtualMachinesDetachVolumeResponse, + VirtualMachinesPowerOffOptionalParams, + VirtualMachinesPowerOffResponse, + VirtualMachinesReimageOptionalParams, + VirtualMachinesReimageResponse, + VirtualMachinesRestartOptionalParams, + VirtualMachinesRestartResponse, + VirtualMachinesStartOptionalParams, + VirtualMachinesStartResponse +} from "../models"; + +/// +/** Interface representing a VirtualMachines. */ +export interface VirtualMachines { + /** + * Get a list of virtual machines in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: VirtualMachinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: VirtualMachinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineParameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineParameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginAttachVolume( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineAttachVolumeParameters: VirtualMachineVolumeParameters, + options?: VirtualMachinesAttachVolumeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesAttachVolumeResponse + > + >; + /** + * 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 options The options parameters. + */ + beginAttachVolumeAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineAttachVolumeParameters: VirtualMachineVolumeParameters, + options?: VirtualMachinesAttachVolumeOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDetachVolume( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineDetachVolumeParameters: VirtualMachineVolumeParameters, + options?: VirtualMachinesDetachVolumeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesDetachVolumeResponse + > + >; + /** + * 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 options The options parameters. + */ + beginDetachVolumeAndWait( + resourceGroupName: string, + virtualMachineName: string, + virtualMachineDetachVolumeParameters: VirtualMachineVolumeParameters, + options?: VirtualMachinesDetachVolumeOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginPowerOff( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesPowerOffOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesPowerOffResponse + > + >; + /** + * 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 options The options parameters. + */ + beginPowerOffAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesPowerOffOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginReimage( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesReimageOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesReimageResponse + > + >; + /** + * 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 options The options parameters. + */ + beginReimageAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesReimageOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginRestart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesRestartOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesRestartResponse + > + >; + /** + * 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 options The options parameters. + */ + beginRestartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesRestartOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginStart( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VirtualMachinesStartResponse + > + >; + /** + * 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 options The options parameters. + */ + beginStartAndWait( + resourceGroupName: string, + virtualMachineName: string, + options?: VirtualMachinesStartOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/volumes.ts b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/volumes.ts new file mode 100644 index 000000000000..bd1bb999d76d --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/operationsInterfaces/volumes.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + Volume, + VolumesListBySubscriptionOptionalParams, + VolumesListByResourceGroupOptionalParams, + VolumesGetOptionalParams, + VolumesGetResponse, + VolumesCreateOrUpdateOptionalParams, + VolumesCreateOrUpdateResponse, + VolumesDeleteOptionalParams, + VolumesUpdateOptionalParams, + VolumesUpdateResponse +} from "../models"; + +/// +/** Interface representing a Volumes. */ +export interface Volumes { + /** + * Get a list of volumes in the provided subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: VolumesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of volumes in the provided resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: VolumesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * 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 options The options parameters. + */ + get( + resourceGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + volumeName: string, + volumeParameters: Volume, + options?: VolumesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + VolumesCreateOrUpdateResponse + > + >; + /** + * 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 options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + volumeName: string, + volumeParameters: Volume, + options?: VolumesCreateOrUpdateOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + beginDelete( + resourceGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams + ): Promise, void>>; + /** + * 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 options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams + ): Promise; + /** + * 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 options The options parameters. + */ + update( + resourceGroupName: string, + volumeName: string, + options?: VolumesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/networkcloud/arm-networkcloud/src/pagingHelper.ts b/sdk/networkcloud/arm-networkcloud/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/networkcloud/arm-networkcloud/test/networkcloud_operations_test.spec.ts b/sdk/networkcloud/arm-networkcloud/test/networkcloud_operations_test.spec.ts new file mode 100644 index 000000000000..e41dbabfa1f8 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/test/networkcloud_operations_test.spec.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + Recorder, + RecorderStartOptions, + delay, + isPlaybackMode, +} from "@azure-tools/test-recorder"; +import { createTestCredential } from "@azure-tools/test-credential"; +import { assert } from "chai"; +import { Context } from "mocha"; +import { NetworkCloud } from "../src/networkCloud"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +export const testPollingOptions = { + updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +}; + +describe("NetworkCloud test", () => { + let recorder: Recorder; + let subscriptionId: string; + let client: NetworkCloud; + let location: string; + let resourceGroup: string; + let resourcename: string; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + subscriptionId = env.SUBSCRIPTION_ID || ''; + // This is an example of how the environment variables are used + const credential = createTestCredential(); + client = new NetworkCloud(credential, subscriptionId, recorder.configureClientOptions({})); + location = "eastus"; + resourceGroup = "myjstest"; + resourcename = "resourcetest"; + + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("operation list test", async function () { + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + assert.notEqual(resArray.length, 0); + }); +}) diff --git a/sdk/networkcloud/arm-networkcloud/tsconfig.json b/sdk/networkcloud/arm-networkcloud/tsconfig.json new file mode 100644 index 000000000000..a7e7562065d5 --- /dev/null +++ b/sdk/networkcloud/arm-networkcloud/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true, + "paths": { + "@azure/arm-networkcloud": [ + "./src/index" + ] + } + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/networkcloud/ci.mgmt.yml b/sdk/networkcloud/ci.mgmt.yml new file mode 100644 index 000000000000..53e755bd1797 --- /dev/null +++ b/sdk/networkcloud/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/networkcloud/arm-networkcloud + - sdk/networkcloud/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/networkcloud/arm-networkcloud + - sdk/networkcloud/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: networkcloud + Artifacts: + - name: azure-arm-networkcloud + safeName: azurearmnetworkcloud + \ No newline at end of file