@azure/arm-compute
Version:
A generated SDK for ComputeManagementClient.
175 lines • 9.85 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the 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 { OperationsImpl, AvailabilitySetsImpl, CapacityReservationGroupsImpl, DedicatedHostGroupsImpl, ImagesImpl, VirtualMachineImagesEdgeZoneImpl, VirtualMachineImagesImpl, LogAnalyticsImpl, VirtualMachineExtensionImagesImpl, VirtualMachineRunCommandsImpl, UsageOperationsImpl, VirtualMachineScaleSetsImpl, VirtualMachinesImpl, VirtualMachineSizesImpl, ProximityPlacementGroupsImpl, RestorePointCollectionsImpl, SshPublicKeysImpl, CapacityReservationsImpl, DedicatedHostsImpl, RestorePointsImpl, VirtualMachineScaleSetRollingUpgradesImpl, VirtualMachineScaleSetExtensionsImpl, VirtualMachineScaleSetVMsImpl, VirtualMachineScaleSetVMExtensionsImpl, VirtualMachineScaleSetVMRunCommandsImpl, VirtualMachineExtensionsImpl, DiskAccessesImpl, DiskEncryptionSetsImpl, DisksImpl, SnapshotsImpl, DiskRestorePointOperationsImpl, ResourceSkusImpl, GalleriesImpl, CommunityGalleriesImpl, CommunityGalleryImagesImpl, CommunityGalleryImageVersionsImpl, SharedGalleriesImpl, SharedGalleryImagesImpl, SharedGalleryImageVersionsImpl, GalleryApplicationsImpl, GalleryApplicationVersionsImpl, GalleryImagesImpl, GalleryImageVersionsImpl, GalleryInVMAccessControlProfilesImpl, GalleryInVMAccessControlProfileVersionsImpl, GallerySharingProfileImpl, SoftDeletedResourceImpl, CloudServiceRoleInstancesImpl, CloudServiceRolesImpl, CloudServicesImpl, CloudServicesUpdateDomainImpl, CloudServiceOperatingSystemsImpl, } from "./operations/index.js";
export class ComputeManagementClient extends coreClient.ServiceClient {
$host;
subscriptionId;
/**
* Initializes a new instance of the ComputeManagementClient 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, subscriptionId, options) {
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 = {
requestContentType: "application/json; charset=utf-8",
credential: credentials,
};
const packageDetails = `azsdk-js-arm-compute/23.2.0`;
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 = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies = 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.operations = new OperationsImpl(this);
this.availabilitySets = new AvailabilitySetsImpl(this);
this.capacityReservationGroups = new CapacityReservationGroupsImpl(this);
this.dedicatedHostGroups = new DedicatedHostGroupsImpl(this);
this.images = new ImagesImpl(this);
this.virtualMachineImagesEdgeZone = new VirtualMachineImagesEdgeZoneImpl(this);
this.virtualMachineImages = new VirtualMachineImagesImpl(this);
this.logAnalytics = new LogAnalyticsImpl(this);
this.virtualMachineExtensionImages = new VirtualMachineExtensionImagesImpl(this);
this.virtualMachineRunCommands = new VirtualMachineRunCommandsImpl(this);
this.usageOperations = new UsageOperationsImpl(this);
this.virtualMachineScaleSets = new VirtualMachineScaleSetsImpl(this);
this.virtualMachines = new VirtualMachinesImpl(this);
this.virtualMachineSizes = new VirtualMachineSizesImpl(this);
this.proximityPlacementGroups = new ProximityPlacementGroupsImpl(this);
this.restorePointCollections = new RestorePointCollectionsImpl(this);
this.sshPublicKeys = new SshPublicKeysImpl(this);
this.capacityReservations = new CapacityReservationsImpl(this);
this.dedicatedHosts = new DedicatedHostsImpl(this);
this.restorePoints = new RestorePointsImpl(this);
this.virtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesImpl(this);
this.virtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsImpl(this);
this.virtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsImpl(this);
this.virtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsImpl(this);
this.virtualMachineScaleSetVMRunCommands = new VirtualMachineScaleSetVMRunCommandsImpl(this);
this.virtualMachineExtensions = new VirtualMachineExtensionsImpl(this);
this.diskAccesses = new DiskAccessesImpl(this);
this.diskEncryptionSets = new DiskEncryptionSetsImpl(this);
this.disks = new DisksImpl(this);
this.snapshots = new SnapshotsImpl(this);
this.diskRestorePointOperations = new DiskRestorePointOperationsImpl(this);
this.resourceSkus = new ResourceSkusImpl(this);
this.galleries = new GalleriesImpl(this);
this.communityGalleries = new CommunityGalleriesImpl(this);
this.communityGalleryImages = new CommunityGalleryImagesImpl(this);
this.communityGalleryImageVersions = new CommunityGalleryImageVersionsImpl(this);
this.sharedGalleries = new SharedGalleriesImpl(this);
this.sharedGalleryImages = new SharedGalleryImagesImpl(this);
this.sharedGalleryImageVersions = new SharedGalleryImageVersionsImpl(this);
this.galleryApplications = new GalleryApplicationsImpl(this);
this.galleryApplicationVersions = new GalleryApplicationVersionsImpl(this);
this.galleryImages = new GalleryImagesImpl(this);
this.galleryImageVersions = new GalleryImageVersionsImpl(this);
this.galleryInVMAccessControlProfiles = new GalleryInVMAccessControlProfilesImpl(this);
this.galleryInVMAccessControlProfileVersions = new GalleryInVMAccessControlProfileVersionsImpl(this);
this.gallerySharingProfile = new GallerySharingProfileImpl(this);
this.softDeletedResource = new SoftDeletedResourceImpl(this);
this.cloudServiceRoleInstances = new CloudServiceRoleInstancesImpl(this);
this.cloudServiceRoles = new CloudServiceRolesImpl(this);
this.cloudServices = new CloudServicesImpl(this);
this.cloudServicesUpdateDomain = new CloudServicesUpdateDomainImpl(this);
this.cloudServiceOperatingSystems = new CloudServiceOperatingSystemsImpl(this);
}
operations;
availabilitySets;
capacityReservationGroups;
dedicatedHostGroups;
images;
virtualMachineImagesEdgeZone;
virtualMachineImages;
logAnalytics;
virtualMachineExtensionImages;
virtualMachineRunCommands;
usageOperations;
virtualMachineScaleSets;
virtualMachines;
virtualMachineSizes;
proximityPlacementGroups;
restorePointCollections;
sshPublicKeys;
capacityReservations;
dedicatedHosts;
restorePoints;
virtualMachineScaleSetRollingUpgrades;
virtualMachineScaleSetExtensions;
virtualMachineScaleSetVMs;
virtualMachineScaleSetVMExtensions;
virtualMachineScaleSetVMRunCommands;
virtualMachineExtensions;
diskAccesses;
diskEncryptionSets;
disks;
snapshots;
diskRestorePointOperations;
resourceSkus;
galleries;
communityGalleries;
communityGalleryImages;
communityGalleryImageVersions;
sharedGalleries;
sharedGalleryImages;
sharedGalleryImageVersions;
galleryApplications;
galleryApplicationVersions;
galleryImages;
galleryImageVersions;
galleryInVMAccessControlProfiles;
galleryInVMAccessControlProfileVersions;
gallerySharingProfile;
softDeletedResource;
cloudServiceRoleInstances;
cloudServiceRoles;
cloudServices;
cloudServicesUpdateDomain;
cloudServiceOperatingSystems;
}
//# sourceMappingURL=computeManagementClient.js.map