From d1878b5dc90d6fd95073b2cafd45570b8705a1e0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 16 Mar 2021 02:03:42 +0000 Subject: [PATCH] CodeGen from PR 13374 in Azure/azure-rest-api-specs Merge 12472fe42d2aee362052d67c5ac958dff00512dc into ada21ec1b5c89d71e3784898b90b4ab1e0b7faa2 --- .../arm-kubernetesconfiguration/README.md | 12 +- ...rationsMappers.ts => extensionsMappers.ts} | 16 +- .../src/models/index.ts | 430 +++++++-------- .../src/models/mappers.ts | 457 +++++++-------- .../src/models/operationsMappers.ts | 15 - .../src/models/parameters.ts | 20 +- .../src/operations/extensions.ts | 518 ++++++++++++++++++ .../src/operations/index.ts | 3 +- .../src/operations/operations.ts | 125 ----- .../operations/sourceControlConfigurations.ts | 419 -------------- .../src/sourceControlConfigurationClient.ts | 6 +- ...sourceControlConfigurationClientContext.ts | 8 +- 12 files changed, 954 insertions(+), 1075 deletions(-) rename sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/{sourceControlConfigurationsMappers.ts => extensionsMappers.ts} (66%) delete mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/operationsMappers.ts create mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/extensions.ts delete mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/operations.ts delete mode 100644 sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/sourceControlConfigurations.ts diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/README.md b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/README.md index b0fcd6f94621..ad4bf8a943bb 100644 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/README.md +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-kubernetesconfiguration ### How to use -#### nodejs - client creation and get sourceControlConfigurations as an example written in TypeScript. +#### nodejs - client creation and get extensions as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -38,8 +38,8 @@ msRestNodeAuth.interactiveLogin().then((creds) => { const clusterRp = "Microsoft.ContainerService"; const clusterResourceName = "managedClusters"; const clusterName = "testclusterName"; - const sourceControlConfigurationName = "testsourceControlConfigurationName"; - client.sourceControlConfigurations.get(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName).then((result) => { + const extensionInstanceName = "testextensionInstanceName"; + client.extensions.get(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName).then((result) => { console.log("The result is:"); console.log(result); }); @@ -48,7 +48,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { }); ``` -#### browser - Authentication, client creation and get sourceControlConfigurations as an example written in JavaScript. +#### browser - Authentication, client creation and get extensions as an example written in JavaScript. ##### Install @azure/ms-rest-browserauth @@ -86,8 +86,8 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to const clusterRp = "Microsoft.ContainerService"; const clusterResourceName = "managedClusters"; const clusterName = "testclusterName"; - const sourceControlConfigurationName = "testsourceControlConfigurationName"; - client.sourceControlConfigurations.get(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName).then((result) => { + const extensionInstanceName = "testextensionInstanceName"; + client.extensions.get(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/sourceControlConfigurationsMappers.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/extensionsMappers.ts similarity index 66% rename from sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/sourceControlConfigurationsMappers.ts rename to sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/extensionsMappers.ts index d4c79a2cb886..1804e38970d2 100644 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/sourceControlConfigurationsMappers.ts +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/extensionsMappers.ts @@ -7,16 +7,18 @@ */ export { - AzureEntityResource, BaseResource, - ComplianceStatus, + ConfigurationIdentity, ErrorDefinition, ErrorResponse, - HelmOperatorProperties, + ExtensionInstance, + ExtensionInstancesList, + ExtensionInstanceUpdate, + ExtensionStatus, ProxyResource, Resource, - SourceControlConfiguration, - SourceControlConfigurationList, - SystemData, - TrackedResource + Scope, + ScopeCluster, + ScopeNamespace, + SystemData } from "../models/mappers"; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/index.ts index a073fedae0ab..7d8aadfea8fc 100644 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/index.ts +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/index.ts @@ -12,13 +12,72 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; /** - * Sample result definition + * Top level metadata + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources */ -export interface Result { +export interface SystemData { + /** + * A string identifier for the identity that created the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdBy?: string; + /** + * The type of identity that created the resource: user, application, managedIdentity, key + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdByType?: string; + /** + * The timestamp of resource creation (UTC) + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdAt?: Date; /** - * Sample property of type string + * A string identifier for the identity that last modified the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastModifiedBy?: string; + /** + * The type of identity that last modified the resource: user, application, managedIdentity, key + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastModifiedByType?: string; + /** + * The timestamp of resource last modification (UTC) + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - sampleProperty?: string; + readonly lastModifiedAt?: Date; +} + +/** + * The Resource model definition. + */ +export interface Resource extends BaseResource { + /** + * Resource Id + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Resource name + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Resource type + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Top level metadata + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + */ + systemData?: SystemData; +} + +/** + * ARM proxy resource. + */ +export interface ProxyResource extends Resource { } /** @@ -46,245 +105,179 @@ export interface ErrorResponse { } /** - * Compliance Status details + * Specifies that the scope of the extensionInstance is Cluster */ -export interface ComplianceStatus { - /** - * The compliance state of the configuration. Possible values include: 'Pending', 'Compliant', - * 'Noncompliant', 'Installed', 'Failed' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly complianceState?: ComplianceStateType; - /** - * Datetime the configuration was last applied. - */ - lastConfigApplied?: Date; +export interface ScopeCluster { /** - * Message from when the configuration was applied. + * Namespace where the extension Release must be placed, for a Cluster scoped extensionInstance. + * If this namespace does not exist, it will be created */ - message?: string; + releaseNamespace?: string; +} + +/** + * Specifies that the scope of the extensionInstance is Namespace + */ +export interface ScopeNamespace { /** - * Level of the message. Possible values include: 'Error', 'Warning', 'Information' + * Namespace where the extensionInstance will be created for an Namespace scoped + * extensionInstance. If this namespace does not exist, it will be created */ - messageLevel?: MessageLevelType; + targetNamespace?: string; } /** - * Properties for Helm operator. + * Scope of the extensionInstance. It can be either Cluster or Namespace; but not both. */ -export interface HelmOperatorProperties { +export interface Scope { /** - * Version of the operator Helm chart. + * Specifies that the scope of the extensionInstance is Cluster */ - chartVersion?: string; + cluster?: ScopeCluster; /** - * Values override for the operator Helm chart. + * Specifies that the scope of the extensionInstance is Namespace */ - chartValues?: string; + namespace?: ScopeNamespace; } /** - * Metadata pertaining to creation and last modification of the resource. + * Status from this instance of the extension. */ -export interface SystemData { - /** - * The identity that created the resource. - */ - createdBy?: string; +export interface ExtensionStatus { /** - * The type of identity that created the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' + * Status code provided by the Extension */ - createdByType?: CreatedByType; + code?: string; /** - * The timestamp of resource creation (UTC). + * Short description of status of this instance of the extension. */ - createdAt?: Date; + displayStatus?: string; /** - * The identity that last modified the resource. + * Level of the status. Possible values include: 'Error', 'Warning', 'Information'. Default + * value: 'Information'. */ - lastModifiedBy?: string; + level?: LevelType; /** - * The type of identity that last modified the resource. Possible values include: 'User', - * 'Application', 'ManagedIdentity', 'Key' + * Detailed message of the status from the Extension instance. */ - lastModifiedByType?: CreatedByType; + message?: string; /** - * The type of identity that last modified the resource. + * DateLiteral (per ISO8601) noting the time of installation status. */ - lastModifiedAt?: Date; + time?: string; } /** - * Common fields that are returned in the response for all Azure Resource Manager resources - * @summary Resource + * Identity for the managed cluster. */ -export interface Resource extends BaseResource { +export interface ConfigurationIdentity { /** - * Fully qualified resource ID for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * The principal id of the system assigned identity which is used by the configuration. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly id?: string; + readonly principalId?: string; /** - * The name of the resource + * The tenant id of the system assigned identity which is used by the configuration. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly name?: string; + readonly tenantId?: 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.** + * The type of identity used for the configuration. Type 'SystemAssigned' will use an implicitly + * created identity. Type 'None' will not use Managed Identity for the configuration. Possible + * values include: 'SystemAssigned', 'None' */ - readonly type?: string; -} - -/** - * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags - * and a location - * @summary Proxy Resource - */ -export interface ProxyResource extends Resource { + type?: ResourceIdentityType; } /** - * The SourceControl Configuration object returned in Get & Put response. + * The Extension Instance object. */ -export interface SourceControlConfiguration extends ProxyResource { +export interface ExtensionInstance extends ProxyResource { /** - * Url of the SourceControl Repository. + * Type of the Extension, of which this resource is an instance of. It must be one of the + * Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. */ - repositoryUrl?: string; + extensionType?: string; /** - * The namespace to which this operator is installed to. Maximum of 253 lower case alphanumeric - * characters, hyphen and period only. Default value: 'default'. + * Flag to note if this instance participates in auto upgrade of minor version, or not. */ - operatorNamespace?: string; + autoUpgradeMinorVersion?: boolean; /** - * Instance name of the operator - identifying the specific configuration. + * ReleaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, + * etc.) - only if autoUpgradeMinorVersion is 'true'. */ - operatorInstanceName?: string; + releaseTrain?: string; /** - * Type of the operator. Possible values include: 'Flux' + * Version of the extension for this extension instance, if it is 'pinned' to a specific version. + * autoUpgradeMinorVersion must be 'false'. */ - operatorType?: OperatorType; + version?: string; /** - * Any Parameters for the Operator instance in string format. + * Scope at which the extension instance is installed. */ - operatorParams?: string; + scope?: Scope; /** - * Name-value pairs of protected configuration settings for the configuration + * Configuration settings, as name-value pairs for configuring this instance of the extension. */ - configurationProtectedSettings?: { [propertyName: string]: string }; + configurationSettings?: { [propertyName: string]: string }; /** - * Scope at which the operator will be installed. Possible values include: 'cluster', - * 'namespace'. Default value: 'cluster'. + * Configuration settings that are sensitive, as name-value pairs for configuring this instance + * of the extension. */ - operatorScope?: OperatorScopeType; - /** - * Public Key associated with this SourceControl configuration (either generated within the - * cluster or provided by the user). - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly repositoryPublicKey?: string; - /** - * Base64-encoded known_hosts contents containing public SSH keys required to access private Git - * instances - */ - sshKnownHostsContents?: string; + configurationProtectedSettings?: { [propertyName: string]: string }; /** - * Option to enable Helm Operator for this git configuration. + * Status of installation of this instance of the extension. Possible values include: 'Pending', + * 'Installed', 'Failed' */ - enableHelmOperator?: boolean; + installState?: InstallStateType; /** - * Properties for Helm operator. + * Status from this instance of the extension. */ - helmOperatorProperties?: HelmOperatorProperties; + statuses?: ExtensionStatus[]; /** - * The provisioning state of the resource provider. Possible values include: 'Accepted', - * 'Deleting', 'Running', 'Succeeded', 'Failed' + * DateLiteral (per ISO8601) noting the time the resource was created by the client (user). * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly provisioningState?: ProvisioningStateType; + readonly creationTime?: string; /** - * Compliance Status of the Configuration + * DateLiteral (per ISO8601) noting the time the resource was modified by the client (user). * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly complianceStatus?: ComplianceStatus; + readonly lastModifiedTime?: string; /** - * Top level metadata - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources - */ - systemData?: SystemData; -} - -/** - * Display metadata associated with the operation. - */ -export interface ResourceProviderOperationDisplay { - /** - * Resource provider: Microsoft KubernetesConfiguration. - */ - provider?: string; - /** - * Resource on which the operation is performed. - */ - resource?: string; - /** - * Type of operation: get, read, delete, etc. - */ - operation?: string; - /** - * Description of this operation. - */ - description?: string; -} - -/** - * Supported operation of this resource provider. - */ -export interface ResourceProviderOperation { - /** - * Operation name, in format of {provider}/{resource}/{operation} + * DateLiteral (per ISO8601) noting the time of last status from the agent. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - name?: string; + readonly lastStatusTime?: string; /** - * Display metadata associated with the operation. + * Error information from the Agent - e.g. errors during installation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - display?: ResourceProviderOperationDisplay; + readonly errorInfo?: ErrorDefinition; /** - * The flag that indicates whether the operation applies to data plane. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The identity of the configuration. */ - readonly isDataAction?: boolean; + identity?: ConfigurationIdentity; } /** - * The resource model definition for an Azure Resource Manager tracked top level resource which has - * 'tags' and a 'location' - * @summary Tracked Resource + * Update Extension Instance request object. */ -export interface TrackedResource extends Resource { +export interface ExtensionInstanceUpdate { /** - * Resource tags. + * Flag to note if this instance participates in Extension Lifecycle Management or not. */ - tags?: { [propertyName: string]: string }; + autoUpgradeMinorVersion?: boolean; /** - * The geo-location where the resource lives + * ReleaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, + * etc.) - only if autoUpgradeMinorVersion is 'true'. */ - location: string; -} - -/** - * The resource model definition for an Azure Resource Manager resource with an etag. - * @summary Entity Resource - */ -export interface AzureEntityResource extends Resource { + releaseTrain?: string; /** - * Resource Etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Version number of extension, to 'pin' to a specific version. autoUpgradeMinorVersion must be + * 'false'. */ - readonly etag?: string; + version?: string; } /** @@ -296,78 +289,41 @@ export interface SourceControlConfigurationClientOptions extends AzureServiceCli /** * @interface - * Result of the request to list Source Control Configurations. It contains a list of - * SourceControlConfiguration objects and a URL link to get the next set of results. - * @extends Array + * Result of the request to list Extension Instances. It contains a list of ExtensionInstance + * objects and a URL link to get the next set of results. + * @extends Array */ -export interface SourceControlConfigurationList extends Array { +export interface ExtensionInstancesList extends Array { /** - * URL to get the next set of configuration objects, if any. + * URL to get the next set of extension instance objects, if any. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly nextLink?: string; } /** - * @interface - * Result of the request to list operations. - * @extends Array - */ -export interface ResourceProviderOperationList extends Array { - /** - * URL to the next set of results, if any. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * Defines values for ComplianceStateType. - * Possible values include: 'Pending', 'Compliant', 'Noncompliant', 'Installed', 'Failed' + * Defines values for InstallStateType. + * Possible values include: 'Pending', 'Installed', 'Failed' * @readonly * @enum {string} */ -export type ComplianceStateType = 'Pending' | 'Compliant' | 'Noncompliant' | 'Installed' | 'Failed'; +export type InstallStateType = 'Pending' | 'Installed' | 'Failed'; /** - * Defines values for MessageLevelType. + * Defines values for LevelType. * Possible values include: 'Error', 'Warning', 'Information' * @readonly * @enum {string} */ -export type MessageLevelType = 'Error' | 'Warning' | 'Information'; - -/** - * Defines values for OperatorType. - * Possible values include: 'Flux' - * @readonly - * @enum {string} - */ -export type OperatorType = 'Flux'; - -/** - * Defines values for OperatorScopeType. - * Possible values include: 'cluster', 'namespace' - * @readonly - * @enum {string} - */ -export type OperatorScopeType = 'cluster' | 'namespace'; +export type LevelType = 'Error' | 'Warning' | 'Information'; /** - * Defines values for ProvisioningStateType. - * Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', 'Failed' + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned', 'None' * @readonly * @enum {string} */ -export type ProvisioningStateType = 'Accepted' | 'Deleting' | 'Running' | 'Succeeded' | 'Failed'; - -/** - * Defines values for CreatedByType. - * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - * @readonly - * @enum {string} - */ -export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; +export type ResourceIdentityType = 'SystemAssigned' | 'None'; /** * Defines values for ClusterRp. @@ -434,29 +390,25 @@ export type ClusterRp3 = 'Microsoft.ContainerService' | 'Microsoft.Kubernetes'; export type ClusterResourceName3 = 'managedClusters' | 'connectedClusters'; /** - * Contains response data for the get operation. + * Defines values for ClusterRp4. + * Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @readonly + * @enum {string} */ -export type SourceControlConfigurationsGetResponse = SourceControlConfiguration & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type ClusterRp4 = 'Microsoft.ContainerService' | 'Microsoft.Kubernetes'; - /** - * The response body as parsed JSON or XML - */ - parsedBody: SourceControlConfiguration; - }; -}; +/** + * Defines values for ClusterResourceName4. + * Possible values include: 'managedClusters', 'connectedClusters' + * @readonly + * @enum {string} + */ +export type ClusterResourceName4 = 'managedClusters' | 'connectedClusters'; /** - * Contains response data for the createOrUpdate operation. + * Contains response data for the create operation. */ -export type SourceControlConfigurationsCreateOrUpdateResponse = SourceControlConfiguration & { +export type ExtensionsCreateResponse = ExtensionInstance & { /** * The underlying HTTP response. */ @@ -469,14 +421,14 @@ export type SourceControlConfigurationsCreateOrUpdateResponse = SourceControlCon /** * The response body as parsed JSON or XML */ - parsedBody: SourceControlConfiguration; + parsedBody: ExtensionInstance; }; }; /** - * Contains response data for the list operation. + * Contains response data for the get operation. */ -export type SourceControlConfigurationsListResponse = SourceControlConfigurationList & { +export type ExtensionsGetResponse = ExtensionInstance & { /** * The underlying HTTP response. */ @@ -489,14 +441,14 @@ export type SourceControlConfigurationsListResponse = SourceControlConfiguration /** * The response body as parsed JSON or XML */ - parsedBody: SourceControlConfigurationList; + parsedBody: ExtensionInstance; }; }; /** - * Contains response data for the listNext operation. + * Contains response data for the update operation. */ -export type SourceControlConfigurationsListNextResponse = SourceControlConfigurationList & { +export type ExtensionsUpdateResponse = ExtensionInstance & { /** * The underlying HTTP response. */ @@ -509,14 +461,14 @@ export type SourceControlConfigurationsListNextResponse = SourceControlConfigura /** * The response body as parsed JSON or XML */ - parsedBody: SourceControlConfigurationList; + parsedBody: ExtensionInstance; }; }; /** * Contains response data for the list operation. */ -export type OperationsListResponse = ResourceProviderOperationList & { +export type ExtensionsListResponse = ExtensionInstancesList & { /** * The underlying HTTP response. */ @@ -529,14 +481,14 @@ export type OperationsListResponse = ResourceProviderOperationList & { /** * The response body as parsed JSON or XML */ - parsedBody: ResourceProviderOperationList; + parsedBody: ExtensionInstancesList; }; }; /** * Contains response data for the listNext operation. */ -export type OperationsListNextResponse = ResourceProviderOperationList & { +export type ExtensionsListNextResponse = ExtensionInstancesList & { /** * The underlying HTTP response. */ @@ -549,6 +501,6 @@ export type OperationsListNextResponse = ResourceProviderOperationList & { /** * The response body as parsed JSON or XML */ - parsedBody: ResourceProviderOperationList; + parsedBody: ExtensionInstancesList; }; }; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/mappers.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/mappers.ts index 1b253cc00559..f7ff5f7eabec 100644 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/mappers.ts +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/mappers.ts @@ -12,22 +12,107 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; -export const Result: msRest.CompositeMapper = { - serializedName: "Result", +export const SystemData: msRest.CompositeMapper = { + serializedName: "SystemData", type: { name: "Composite", - className: "Result", + className: "SystemData", modelProperties: { - sampleProperty: { - serializedName: "sampleProperty", + createdBy: { + readOnly: true, + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + readOnly: true, + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + readOnly: true, + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + readOnly: true, + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + readOnly: true, + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + readOnly: true, + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", type: { name: "String" } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } }; +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + export const ErrorDefinition: msRest.CompositeMapper = { serializedName: "ErrorDefinition", type: { @@ -69,33 +154,30 @@ export const ErrorResponse: msRest.CompositeMapper = { } }; -export const ComplianceStatus: msRest.CompositeMapper = { - serializedName: "ComplianceStatus", +export const ScopeCluster: msRest.CompositeMapper = { + serializedName: "ScopeCluster", type: { name: "Composite", - className: "ComplianceStatus", + className: "ScopeCluster", modelProperties: { - complianceState: { - readOnly: true, - serializedName: "complianceState", + releaseNamespace: { + serializedName: "releaseNamespace", type: { name: "String" } - }, - lastConfigApplied: { - serializedName: "lastConfigApplied", - type: { - name: "DateTime" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - }, - messageLevel: { - serializedName: "messageLevel", + } + } + } +}; + +export const ScopeNamespace: msRest.CompositeMapper = { + serializedName: "ScopeNamespace", + type: { + name: "Composite", + className: "ScopeNamespace", + modelProperties: { + targetNamespace: { + serializedName: "targetNamespace", type: { name: "String" } @@ -104,156 +186,145 @@ export const ComplianceStatus: msRest.CompositeMapper = { } }; -export const HelmOperatorProperties: msRest.CompositeMapper = { - serializedName: "HelmOperatorProperties", +export const Scope: msRest.CompositeMapper = { + serializedName: "Scope", type: { name: "Composite", - className: "HelmOperatorProperties", + className: "Scope", modelProperties: { - chartVersion: { - serializedName: "chartVersion", + cluster: { + serializedName: "cluster", type: { - name: "String" + name: "Composite", + className: "ScopeCluster" } }, - chartValues: { - serializedName: "chartValues", + namespace: { + serializedName: "namespace", type: { - name: "String" + name: "Composite", + className: "ScopeNamespace" } } } } }; -export const SystemData: msRest.CompositeMapper = { - serializedName: "systemData", +export const ExtensionStatus: msRest.CompositeMapper = { + serializedName: "ExtensionStatus", type: { name: "Composite", - className: "SystemData", + className: "ExtensionStatus", modelProperties: { - createdBy: { - serializedName: "createdBy", + code: { + serializedName: "code", type: { name: "String" } }, - createdByType: { - serializedName: "createdByType", + displayStatus: { + serializedName: "displayStatus", type: { name: "String" } }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime" - } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + level: { + serializedName: "level", + defaultValue: 'Information', type: { name: "String" } }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + message: { + serializedName: "message", type: { name: "String" } }, - lastModifiedAt: { - serializedName: "lastModifiedAt", + time: { + serializedName: "time", type: { - name: "DateTime" + name: "String" } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const ConfigurationIdentity: msRest.CompositeMapper = { + serializedName: "ConfigurationIdentity", type: { name: "Composite", - className: "Resource", + className: "ConfigurationIdentity", modelProperties: { - id: { + principalId: { readOnly: true, - serializedName: "id", + serializedName: "principalId", type: { name: "String" } }, - name: { + tenantId: { readOnly: true, - serializedName: "name", + serializedName: "tenantId", type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", type: { - name: "String" + name: "Enum", + allowedValues: [ + "SystemAssigned", + "None" + ] } } } } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", +export const ExtensionInstance: msRest.CompositeMapper = { + serializedName: "ExtensionInstance", type: { name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties - } - } -}; - -export const SourceControlConfiguration: msRest.CompositeMapper = { - serializedName: "SourceControlConfiguration", - type: { - name: "Composite", - className: "SourceControlConfiguration", + className: "ExtensionInstance", modelProperties: { ...ProxyResource.type.modelProperties, - repositoryUrl: { - serializedName: "properties.repositoryUrl", + extensionType: { + serializedName: "properties.extensionType", type: { name: "String" } }, - operatorNamespace: { - serializedName: "properties.operatorNamespace", - defaultValue: 'default', + autoUpgradeMinorVersion: { + serializedName: "properties.autoUpgradeMinorVersion", type: { - name: "String" + name: "Boolean" } }, - operatorInstanceName: { - serializedName: "properties.operatorInstanceName", + releaseTrain: { + serializedName: "properties.releaseTrain", type: { name: "String" } }, - operatorType: { - serializedName: "properties.operatorType", + version: { + serializedName: "properties.version", type: { name: "String" } }, - operatorParams: { - serializedName: "properties.operatorParams", + scope: { + serializedName: "properties.scope", type: { - name: "String" + name: "Composite", + className: "Scope" } }, - configurationProtectedSettings: { - serializedName: "properties.configurationProtectedSettings", + configurationSettings: { + serializedName: "properties.configurationSettings", type: { name: "Dictionary", value: { @@ -263,198 +334,95 @@ export const SourceControlConfiguration: msRest.CompositeMapper = { } } }, - operatorScope: { - serializedName: "properties.operatorScope", - defaultValue: 'cluster', - type: { - name: "String" - } - }, - repositoryPublicKey: { - readOnly: true, - serializedName: "properties.repositoryPublicKey", + configurationProtectedSettings: { + serializedName: "properties.configurationProtectedSettings", type: { - name: "String" + name: "Dictionary", + value: { + type: { + name: "String" + } + } } }, - sshKnownHostsContents: { - serializedName: "properties.sshKnownHostsContents", + installState: { + serializedName: "properties.installState", type: { name: "String" } }, - enableHelmOperator: { - serializedName: "properties.enableHelmOperator", + statuses: { + serializedName: "properties.statuses", type: { - name: "Boolean" - } - }, - helmOperatorProperties: { - serializedName: "properties.helmOperatorProperties", - type: { - name: "Composite", - className: "HelmOperatorProperties" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExtensionStatus" + } + } } }, - provisioningState: { + creationTime: { readOnly: true, - serializedName: "properties.provisioningState", + serializedName: "properties.creationTime", type: { name: "String" } }, - complianceStatus: { + lastModifiedTime: { readOnly: true, - serializedName: "properties.complianceStatus", - type: { - name: "Composite", - className: "ComplianceStatus" - } - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - } - } - } -}; - -export const ResourceProviderOperationDisplay: msRest.CompositeMapper = { - serializedName: "ResourceProviderOperation_display", - type: { - name: "Composite", - className: "ResourceProviderOperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", + serializedName: "properties.lastModifiedTime", type: { name: "String" } }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - -export const ResourceProviderOperation: msRest.CompositeMapper = { - serializedName: "ResourceProviderOperation", - type: { - name: "Composite", - className: "ResourceProviderOperation", - modelProperties: { - name: { - serializedName: "name", + lastStatusTime: { + readOnly: true, + serializedName: "properties.lastStatusTime", type: { name: "String" } }, - display: { - serializedName: "display", + errorInfo: { + readOnly: true, + serializedName: "properties.errorInfo", type: { name: "Composite", - className: "ResourceProviderOperationDisplay" + className: "ErrorDefinition" } }, - isDataAction: { - readOnly: true, - serializedName: "isDataAction", + identity: { + serializedName: "properties.identity", type: { - name: "Boolean" + name: "Composite", + className: "ConfigurationIdentity" } } } } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const ExtensionInstanceUpdate: msRest.CompositeMapper = { + serializedName: "ExtensionInstanceUpdate", type: { name: "Composite", - className: "TrackedResource", + className: "ExtensionInstanceUpdate", modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", + autoUpgradeMinorVersion: { + serializedName: "properties.autoUpgradeMinorVersion", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Boolean" } }, - location: { - required: true, - serializedName: "location", + releaseTrain: { + serializedName: "properties.releaseTrain", type: { name: "String" } - } - } - } -}; - -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", - type: { - name: "Composite", - className: "AzureEntityResource", - modelProperties: { - ...Resource.type.modelProperties, - etag: { - readOnly: true, - serializedName: "etag", - type: { - name: "String" - } - } - } - } -}; - -export const SourceControlConfigurationList: msRest.CompositeMapper = { - serializedName: "SourceControlConfigurationList", - type: { - name: "Composite", - className: "SourceControlConfigurationList", - modelProperties: { - value: { - readOnly: true, - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SourceControlConfiguration" - } - } - } }, - nextLink: { - readOnly: true, - serializedName: "nextLink", + version: { + serializedName: "properties.version", type: { name: "String" } @@ -463,20 +431,21 @@ export const SourceControlConfigurationList: msRest.CompositeMapper = { } }; -export const ResourceProviderOperationList: msRest.CompositeMapper = { - serializedName: "ResourceProviderOperationList", +export const ExtensionInstancesList: msRest.CompositeMapper = { + serializedName: "ExtensionInstancesList", type: { name: "Composite", - className: "ResourceProviderOperationList", + className: "ExtensionInstancesList", modelProperties: { value: { + readOnly: true, serializedName: "", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ResourceProviderOperation" + className: "ExtensionInstance" } } } diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/operationsMappers.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/operationsMappers.ts deleted file mode 100644 index e275551c2766..000000000000 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/operationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 { - ErrorDefinition, - ErrorResponse, - ResourceProviderOperation, - ResourceProviderOperationDisplay, - ResourceProviderOperationList -} from "../models/mappers"; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/parameters.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/parameters.ts index c46fa660fefe..7beaa6ff12f5 100644 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/parameters.ts +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/models/parameters.ts @@ -59,6 +59,16 @@ export const clusterRp: msRest.OperationURLParameter = { } } }; +export const extensionInstanceName: msRest.OperationURLParameter = { + parameterPath: "extensionInstanceName", + mapper: { + required: true, + serializedName: "extensionInstanceName", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { @@ -80,16 +90,6 @@ export const resourceGroupName: msRest.OperationURLParameter = { } } }; -export const sourceControlConfigurationName: msRest.OperationURLParameter = { - parameterPath: "sourceControlConfigurationName", - mapper: { - required: true, - serializedName: "sourceControlConfigurationName", - type: { - name: "String" - } - } -}; export const subscriptionId: msRest.OperationURLParameter = { parameterPath: "subscriptionId", mapper: { diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/extensions.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/extensions.ts new file mode 100644 index 000000000000..b5c90165042f --- /dev/null +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/extensions.ts @@ -0,0 +1,518 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/extensionsMappers"; +import * as Parameters from "../models/parameters"; +import { SourceControlConfigurationClientContext } from "../sourceControlConfigurationClientContext"; + +/** Class representing a Extensions. */ +export class Extensions { + private readonly client: SourceControlConfigurationClientContext; + + /** + * Create a Extensions. + * @param {SourceControlConfigurationClientContext} client Reference to the service client. + */ + constructor(client: SourceControlConfigurationClientContext) { + this.client = client; + } + + /** + * Create a new Kubernetes Cluster Extension Instance. + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties necessary to Create an Extension Instance. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, clusterRp: Models.ClusterRp, clusterResourceName: Models.ClusterResourceName, clusterName: string, extensionInstanceName: string, extensionInstance: Models.ExtensionInstance, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties necessary to Create an Extension Instance. + * @param callback The callback + */ + create(resourceGroupName: string, clusterRp: Models.ClusterRp, clusterResourceName: Models.ClusterResourceName, clusterName: string, extensionInstanceName: string, extensionInstance: Models.ExtensionInstance, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties necessary to Create an Extension Instance. + * @param options The optional parameters + * @param callback The callback + */ + create(resourceGroupName: string, clusterRp: Models.ClusterRp, clusterResourceName: Models.ClusterResourceName, clusterName: string, extensionInstanceName: string, extensionInstance: Models.ExtensionInstance, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, clusterRp: Models.ClusterRp, clusterResourceName: Models.ClusterResourceName, clusterName: string, extensionInstanceName: string, extensionInstance: Models.ExtensionInstance, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionInstanceName, + extensionInstance, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Gets details of the Kubernetes Cluster Extension Instance. + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, clusterRp: Models.ClusterRp1, clusterResourceName: Models.ClusterResourceName1, clusterName: string, extensionInstanceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param callback The callback + */ + get(resourceGroupName: string, clusterRp: Models.ClusterRp1, clusterResourceName: Models.ClusterResourceName1, clusterName: string, extensionInstanceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, clusterRp: Models.ClusterRp1, clusterResourceName: Models.ClusterResourceName1, clusterName: string, extensionInstanceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, clusterRp: Models.ClusterRp1, clusterResourceName: Models.ClusterResourceName1, clusterName: string, extensionInstanceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionInstanceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Update an existing Kubernetes Cluster Extension Instance. + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties to Update in the Extension Instance. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, clusterRp: Models.ClusterRp2, clusterResourceName: Models.ClusterResourceName2, clusterName: string, extensionInstanceName: string, extensionInstance: Models.ExtensionInstanceUpdate, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties to Update in the Extension Instance. + * @param callback The callback + */ + update(resourceGroupName: string, clusterRp: Models.ClusterRp2, clusterResourceName: Models.ClusterResourceName2, clusterName: string, extensionInstanceName: string, extensionInstance: Models.ExtensionInstanceUpdate, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties to Update in the Extension Instance. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, clusterRp: Models.ClusterRp2, clusterResourceName: Models.ClusterResourceName2, clusterName: string, extensionInstanceName: string, extensionInstance: Models.ExtensionInstanceUpdate, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, clusterRp: Models.ClusterRp2, clusterResourceName: Models.ClusterResourceName2, clusterName: string, extensionInstanceName: string, extensionInstance: Models.ExtensionInstanceUpdate, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionInstanceName, + extensionInstance, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Delete a Kubernetes Cluster Extension Instance. This will cause the Agent to Uninstall the + * extension instance from the cluster. + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, clusterRp: Models.ClusterRp3, clusterResourceName: Models.ClusterResourceName3, clusterName: string, extensionInstanceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, clusterRp: Models.ClusterRp3, clusterResourceName: Models.ClusterResourceName3, clusterName: string, extensionInstanceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, clusterRp: Models.ClusterRp3, clusterResourceName: Models.ClusterResourceName3, clusterName: string, extensionInstanceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterRp: Models.ClusterRp3, clusterResourceName: Models.ClusterResourceName3, clusterName: string, extensionInstanceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + extensionInstanceName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * List all Source Control Configurations. + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, clusterRp: Models.ClusterRp4, clusterResourceName: Models.ClusterResourceName4, clusterName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param callback The callback + */ + list(resourceGroupName: string, clusterRp: Models.ClusterRp4, clusterResourceName: Models.ClusterResourceName4, clusterName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: + * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for + * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: + * 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, clusterRp: Models.ClusterRp4, clusterResourceName: Models.ClusterResourceName4, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, clusterRp: Models.ClusterRp4, clusterResourceName: Models.ClusterResourceName4, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + clusterRp, + clusterResourceName, + clusterName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * List all Source Control Configurations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.extensionInstanceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "extensionInstance", + mapper: { + ...Mappers.ExtensionInstance, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ExtensionInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.extensionInstanceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExtensionInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.extensionInstanceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "extensionInstance", + mapper: { + ...Mappers.ExtensionInstanceUpdate, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ExtensionInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName, + Parameters.extensionInstanceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterRp, + Parameters.clusterResourceName, + Parameters.clusterName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExtensionInstancesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExtensionInstancesList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/index.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/index.ts index 0747a061f3f2..7541dc636c27 100644 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/index.ts +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/index.ts @@ -7,5 +7,4 @@ * regenerated. */ -export * from "./sourceControlConfigurations"; -export * from "./operations"; +export * from "./extensions"; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/operations.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/operations.ts deleted file mode 100644 index e749cc7bf2dd..000000000000 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/operations.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; -import * as Parameters from "../models/parameters"; -import { SourceControlConfigurationClientContext } from "../sourceControlConfigurationClientContext"; - -/** Class representing a Operations. */ -export class Operations { - private readonly client: SourceControlConfigurationClientContext; - - /** - * Create a Operations. - * @param {SourceControlConfigurationClientContext} client Reference to the service client. - */ - constructor(client: SourceControlConfigurationClientContext) { - this.client = client; - } - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "providers/Microsoft.KubernetesConfiguration/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResourceProviderOperationList - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.ResourceProviderOperationList - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/sourceControlConfigurations.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/sourceControlConfigurations.ts deleted file mode 100644 index 490f633c5fa9..000000000000 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/operations/sourceControlConfigurations.ts +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the 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 msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/sourceControlConfigurationsMappers"; -import * as Parameters from "../models/parameters"; -import { SourceControlConfigurationClientContext } from "../sourceControlConfigurationClientContext"; - -/** Class representing a SourceControlConfigurations. */ -export class SourceControlConfigurations { - private readonly client: SourceControlConfigurationClientContext; - - /** - * Create a SourceControlConfigurations. - * @param {SourceControlConfigurationClientContext} client Reference to the service client. - */ - constructor(client: SourceControlConfigurationClientContext) { - this.client = client; - } - - /** - * Gets details of the Source Control Configuration. - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, clusterRp: Models.ClusterRp, clusterResourceName: Models.ClusterResourceName, clusterName: string, sourceControlConfigurationName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param callback The callback - */ - get(resourceGroupName: string, clusterRp: Models.ClusterRp, clusterResourceName: Models.ClusterResourceName, clusterName: string, sourceControlConfigurationName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, clusterRp: Models.ClusterRp, clusterResourceName: Models.ClusterResourceName, clusterName: string, sourceControlConfigurationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, clusterRp: Models.ClusterRp, clusterResourceName: Models.ClusterResourceName, clusterName: string, sourceControlConfigurationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Create a new Kubernetes Source Control Configuration. - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, clusterRp: Models.ClusterRp1, clusterResourceName: Models.ClusterResourceName1, clusterName: string, sourceControlConfigurationName: string, sourceControlConfiguration: Models.SourceControlConfiguration, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, clusterRp: Models.ClusterRp1, clusterResourceName: Models.ClusterResourceName1, clusterName: string, sourceControlConfigurationName: string, sourceControlConfiguration: Models.SourceControlConfiguration, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, clusterRp: Models.ClusterRp1, clusterResourceName: Models.ClusterResourceName1, clusterName: string, sourceControlConfigurationName: string, sourceControlConfiguration: Models.SourceControlConfiguration, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, clusterRp: Models.ClusterRp1, clusterResourceName: Models.ClusterResourceName1, clusterName: string, sourceControlConfigurationName: string, sourceControlConfiguration: Models.SourceControlConfiguration, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - sourceControlConfiguration, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping - * future sync from the source repo. - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, clusterRp: Models.ClusterRp2, clusterResourceName: Models.ClusterResourceName2, clusterName: string, sourceControlConfigurationName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,clusterRp,clusterResourceName,clusterName,sourceControlConfigurationName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } - - /** - * List all Source Control Configurations. - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param [options] The optional parameters - * @returns Promise - */ - list(resourceGroupName: string, clusterRp: Models.ClusterRp3, clusterResourceName: Models.ClusterResourceName3, clusterName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param callback The callback - */ - list(resourceGroupName: string, clusterRp: Models.ClusterRp3, clusterResourceName: Models.ClusterResourceName3, clusterName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param options The optional parameters - * @param callback The callback - */ - list(resourceGroupName: string, clusterRp: Models.ClusterRp3, clusterResourceName: Models.ClusterResourceName3, clusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, clusterRp: Models.ClusterRp3, clusterResourceName: Models.ClusterResourceName3, clusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - options - }, - listOperationSpec, - callback) as Promise; - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping - * future sync from the source repo. - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS - * clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: - * 'Microsoft.ContainerService', 'Microsoft.Kubernetes' - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for - * AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: - * 'managedClusters', 'connectedClusters' - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param [options] The optional parameters - * @returns Promise - */ - beginDeleteMethod(resourceGroupName: string, clusterRp: Models.ClusterRp2, clusterResourceName: Models.ClusterResourceName2, clusterName: string, sourceControlConfigurationName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - options - }, - beginDeleteMethodOperationSpec, - options); - } - - /** - * List all Source Control Configurations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback - */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.clusterRp, - Parameters.clusterResourceName, - Parameters.clusterName, - Parameters.sourceControlConfigurationName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.SourceControlConfiguration - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.clusterRp, - Parameters.clusterResourceName, - Parameters.clusterName, - Parameters.sourceControlConfigurationName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "sourceControlConfiguration", - mapper: { - ...Mappers.SourceControlConfiguration, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.SourceControlConfiguration - }, - 201: { - bodyMapper: Mappers.SourceControlConfiguration - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.clusterRp, - Parameters.clusterResourceName, - Parameters.clusterName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.SourceControlConfigurationList - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.clusterRp, - Parameters.clusterResourceName, - Parameters.clusterName, - Parameters.sourceControlConfigurationName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", - path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.SourceControlConfigurationList - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -}; diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/sourceControlConfigurationClient.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/sourceControlConfigurationClient.ts index bd2cc20ebd69..39813a6a480a 100644 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/sourceControlConfigurationClient.ts +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/sourceControlConfigurationClient.ts @@ -16,8 +16,7 @@ import { SourceControlConfigurationClientContext } from "./sourceControlConfigur class SourceControlConfigurationClient extends SourceControlConfigurationClientContext { // Operation groups - sourceControlConfigurations: operations.SourceControlConfigurations; - operations: operations.Operations; + extensions: operations.Extensions; /** * Initializes a new instance of the SourceControlConfigurationClient class. @@ -28,8 +27,7 @@ class SourceControlConfigurationClient extends SourceControlConfigurationClientC */ constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.SourceControlConfigurationClientOptions) { super(credentials, subscriptionId, options); - this.sourceControlConfigurations = new operations.SourceControlConfigurations(this); - this.operations = new operations.Operations(this); + this.extensions = new operations.Extensions(this); } } diff --git a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/sourceControlConfigurationClientContext.ts b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/sourceControlConfigurationClientContext.ts index 2b240880b2e7..7df7481beda8 100644 --- a/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/sourceControlConfigurationClientContext.ts +++ b/sdk/kubernetesconfiguration/arm-kubernetesconfiguration/src/sourceControlConfigurationClientContext.ts @@ -37,14 +37,14 @@ export class SourceControlConfigurationClientContext extends msRestAzure.AzureSe if (!options) { options = {}; } - if (!options.userAgent) { + if(!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); - this.apiVersion = '2021-03-01'; + this.apiVersion = '2020-07-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; @@ -52,10 +52,10 @@ export class SourceControlConfigurationClientContext extends msRestAzure.AzureSe this.credentials = credentials; this.subscriptionId = subscriptionId; - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } }