Skip to content

Commit

Permalink
CodeGen from PR 12500 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Dev kubernetesconfiguration microsoft.kubernetes configuration stable 2021 03 01 (Azure#12500)

* Adds base for updating Microsoft.KubernetesConfiguration from version preview/2020-10-01-preview to version 2021-03-01

* Updates readme

* Updates API version in new specs and examples

* Fixed review comment

* Fixed reference path error

* Fixed casing error in enum
  • Loading branch information
SDKAuto committed Jan 27, 2021
1 parent 0af3b5e commit d94283b
Show file tree
Hide file tree
Showing 13 changed files with 343 additions and 153 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Microsoft
Copyright (c) 2021 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install @azure/arm-kubernetesconfiguration

### How to use

#### nodejs - Authentication, client creation and get sourceControlConfigurations as an example written in TypeScript.
#### nodejs - client creation and get sourceControlConfigurations as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

Expand All @@ -26,11 +26,10 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0"

##### Sample code

While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package
```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { SourceControlConfigurationClient, SourceControlConfigurationModels, SourceControlConfigurationMappers } from "@azure/arm-kubernetesconfiguration";
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const { SourceControlConfigurationClient } = require("@azure/arm-kubernetesconfiguration");
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const config = {
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand All @@ -11,33 +11,6 @@ import * as msRest from "@azure/ms-rest-js";

export { BaseResource, CloudError };

/**
* 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;
}

/**
* ARM proxy resource.
*/
export interface ProxyResource extends Resource {
}

/**
* Sample result definition
*/
Expand All @@ -54,19 +27,12 @@ export interface Result {
export interface ErrorDefinition {
/**
* Service specific error code which serves as the substatus for the HTTP error code.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly code?: string;
code: string;
/**
* Description of the error.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly message?: string;
/**
* Internal error details.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly details?: ErrorDefinition[];
message: string;
}

/**
Expand All @@ -88,7 +54,7 @@ export interface ComplianceStatus {
* 'Noncompliant', 'Installed', 'Failed'
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly complianceState?: ComplianceState;
readonly complianceState?: ComplianceStateType;
/**
* Datetime the configuration was last applied.
*/
Expand All @@ -100,7 +66,7 @@ export interface ComplianceStatus {
/**
* Level of the message. Possible values include: 'Error', 'Warning', 'Information'
*/
messageLevel?: MessageLevel;
messageLevel?: MessageLevelType;
}

/**
Expand All @@ -118,7 +84,71 @@ export interface HelmOperatorProperties {
}

/**
* The SourceControl Configuration object.
* Metadata pertaining to creation and last modification of the resource.
*/
export interface SystemData {
/**
* The identity that created the resource.
*/
createdBy?: string;
/**
* The type of identity that created the resource. Possible values include: 'User',
* 'Application', 'ManagedIdentity', 'Key'
*/
createdByType?: CreatedByType;
/**
* The timestamp of resource creation (UTC).
*/
createdAt?: Date;
/**
* The identity that last modified the resource.
*/
lastModifiedBy?: string;
/**
* The type of identity that last modified the resource. Possible values include: 'User',
* 'Application', 'ManagedIdentity', 'Key'
*/
lastModifiedByType?: CreatedByType;
/**
* The type of identity that last modified the resource.
*/
lastModifiedAt?: Date;
}

/**
* Common fields that are returned in the response for all Azure Resource Manager resources
* @summary Resource
*/
export interface Resource extends BaseResource {
/**
* Fully qualified resource ID for the resource. Ex -
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly id?: string;
/**
* The name of the resource
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly name?: string;
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
* "Microsoft.Storage/storageAccounts"
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly type?: string;
}

/**
* 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 {
}

/**
* The SourceControl Configuration object returned in Get & Put response.
*/
export interface SourceControlConfiguration extends ProxyResource {
/**
Expand All @@ -142,22 +172,30 @@ export interface SourceControlConfiguration extends ProxyResource {
* Any Parameters for the Operator instance in string format.
*/
operatorParams?: string;
/**
* Name-value pairs of protected configuration settings for the configuration
*/
configurationProtectedSettings?: { [propertyName: string]: string };
/**
* Scope at which the operator will be installed. Possible values include: 'cluster',
* 'namespace'. Default value: 'cluster'.
*/
operatorScope?: OperatorScope;
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;
/**
* Option to enable Helm Operator for this git configuration. Possible values include: 'true',
* 'false'
* Base64-encoded known_hosts contents containing public SSH keys required to access private Git
* instances
*/
sshKnownHostsContents?: string;
/**
* Option to enable Helm Operator for this git configuration.
*/
enableHelmOperator?: EnableHelmOperator;
enableHelmOperator?: boolean;
/**
* Properties for Helm operator.
*/
Expand All @@ -167,12 +205,17 @@ export interface SourceControlConfiguration extends ProxyResource {
* 'Deleting', 'Running', 'Succeeded', 'Failed'
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly provisioningState?: ProvisioningState;
readonly provisioningState?: ProvisioningStateType;
/**
* Compliance Status of the Configuration
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly complianceStatus?: ComplianceStatus;
/**
* 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;
}

/**
Expand Down Expand Up @@ -209,6 +252,39 @@ export interface ResourceProviderOperation {
* Display metadata associated with the operation.
*/
display?: ResourceProviderOperationDisplay;
/**
* 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.**
*/
readonly isDataAction?: boolean;
}

/**
* The resource model definition for an Azure Resource Manager tracked top level resource which has
* 'tags' and a 'location'
* @summary Tracked Resource
*/
export interface TrackedResource extends Resource {
/**
* Resource tags.
*/
tags?: { [propertyName: string]: string };
/**
* The geo-location where the resource lives
*/
location: string;
}

/**
* The resource model definition for an Azure Resource Manager resource with an etag.
* @summary Entity Resource
*/
export interface AzureEntityResource extends Resource {
/**
* Resource Etag.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly etag?: string;
}

/**
Expand Down Expand Up @@ -246,20 +322,20 @@ export interface ResourceProviderOperationList extends Array<ResourceProviderOpe
}

/**
* Defines values for ComplianceState.
* Defines values for ComplianceStateType.
* Possible values include: 'Pending', 'Compliant', 'Noncompliant', 'Installed', 'Failed'
* @readonly
* @enum {string}
*/
export type ComplianceState = 'Pending' | 'Compliant' | 'Noncompliant' | 'Installed' | 'Failed';
export type ComplianceStateType = 'Pending' | 'Compliant' | 'Noncompliant' | 'Installed' | 'Failed';

/**
* Defines values for MessageLevel.
* Defines values for MessageLevelType.
* Possible values include: 'Error', 'Warning', 'Information'
* @readonly
* @enum {string}
*/
export type MessageLevel = 'Error' | 'Warning' | 'Information';
export type MessageLevelType = 'Error' | 'Warning' | 'Information';

/**
* Defines values for OperatorType.
Expand All @@ -270,28 +346,28 @@ export type MessageLevel = 'Error' | 'Warning' | 'Information';
export type OperatorType = 'Flux';

/**
* Defines values for OperatorScope.
* Defines values for OperatorScopeType.
* Possible values include: 'cluster', 'namespace'
* @readonly
* @enum {string}
*/
export type OperatorScope = 'cluster' | 'namespace';
export type OperatorScopeType = 'cluster' | 'namespace';

/**
* Defines values for EnableHelmOperator.
* Possible values include: 'true', 'false'
* Defines values for ProvisioningStateType.
* Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', 'Failed'
* @readonly
* @enum {string}
*/
export type EnableHelmOperator = 'true' | 'false';
export type ProvisioningStateType = 'Accepted' | 'Deleting' | 'Running' | 'Succeeded' | 'Failed';

/**
* Defines values for ProvisioningState.
* Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', 'Failed'
* Defines values for CreatedByType.
* Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
* @readonly
* @enum {string}
*/
export type ProvisioningState = 'Accepted' | 'Deleting' | 'Running' | 'Succeeded' | 'Failed';
export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key';

/**
* Defines values for ClusterRp.
Expand Down
Loading

0 comments on commit d94283b

Please sign in to comment.