diff --git a/sdk/chaos/arm-chaos/LICENSE.txt b/sdk/chaos/arm-chaos/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/chaos/arm-chaos/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/chaos/arm-chaos/README.md b/sdk/chaos/arm-chaos/README.md new file mode 100644 index 000000000000..fa9c93f21dec --- /dev/null +++ b/sdk/chaos/arm-chaos/README.md @@ -0,0 +1,118 @@ +## Azure ChaosManagementClient SDK for JavaScript + +This package contains an isomorphic SDK (runs both in node.js and in browsers) for ChaosManagementClient. + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +You must have an [Azure subscription](https://azure.microsoft.com/free/). + +### How to install + +To use this SDK in your project, you will need to install two packages. +- `@azure/arm-chaos` that contains the client. +- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. + +Install both packages using the below command: +```bash +npm install --save @azure/arm-chaos @azure/identity +``` +> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. +If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. + +### How to use + +- If you are writing a client side browser application, + - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. + - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. +- If you are writing a server side application, + - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) + - Complete the set up steps required by the credential if any. + - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. + +In the below samples, we pass the credential and the Azure subscription id to instantiate the client. +Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +#### nodejs - Authentication, client creation, and list capabilities as an example written in JavaScript. + +##### Sample code + +```javascript +const { DefaultAzureCredential } = require("@azure/identity"); +const { ChaosManagementClient } = require("@azure/arm-chaos"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples +// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. +const creds = new DefaultAzureCredential(); +const client = new ChaosManagementClient(creds, subscriptionId); +const resourceGroupName = "testresourceGroupName"; +const parentProviderNamespace = "testparentProviderNamespace"; +const parentResourceType = "testparentResourceType"; +const parentResourceName = "testparentResourceName"; +const targetName = "testtargetName"; +const continuationToken = "testcontinuationToken"; +client.capabilities.list(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, continuationToken).then((result) => { + console.log("The result is:"); + console.log(result); +}).catch((err) => { + console.log("An error occurred:"); + console.error(err); +}); +``` + +#### browser - Authentication, client creation, and list capabilities as an example written in JavaScript. + +In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. + - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. + - Note down the client Id from the previous step and use it in the browser sample below. + +##### Sample code + +- index.html + +```html + + + + @azure/arm-chaos sample + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/chaos/arm-chaos/README.png) diff --git a/sdk/chaos/arm-chaos/package.json b/sdk/chaos/arm-chaos/package.json new file mode 100644 index 000000000000..9cba7d65e19a --- /dev/null +++ b/sdk/chaos/arm-chaos/package.json @@ -0,0 +1,59 @@ +{ + "name": "@azure/arm-chaos", + "author": "Microsoft Corporation", + "description": "ChaosManagementClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.1.0", + "@azure/ms-rest-js": "^2.2.0", + "@azure/core-auth": "^1.1.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-chaos.js", + "module": "./esm/chaosManagementClient.js", + "types": "./esm/chaosManagementClient.d.ts", + "devDependencies": { + "typescript": "^3.6.0", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/chaos/arm-chaos", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-chaos.js.map'\" -o ./dist/arm-chaos.min.js ./dist/arm-chaos.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/chaos/arm-chaos/rollup.config.js b/sdk/chaos/arm-chaos/rollup.config.js new file mode 100644 index 000000000000..001c1406ac06 --- /dev/null +++ b/sdk/chaos/arm-chaos/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/chaosManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-chaos.js", + format: "umd", + name: "Azure.ArmChaos", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@azure/ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */` + }, + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/chaos/arm-chaos/src/chaosManagementClient.ts b/sdk/chaos/arm-chaos/src/chaosManagementClient.ts new file mode 100644 index 000000000000..6bf597545d84 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/chaosManagementClient.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import { TokenCredential } from "@azure/core-auth"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { ChaosManagementClientContext } from "./chaosManagementClientContext"; + + +class ChaosManagementClient extends ChaosManagementClientContext { + // Operation groups + capabilities: operations.Capabilities; + experiments: operations.Experiments; + operations: operations.Operations; + targets: operations.Targets; + targetTypes: operations.TargetTypes; + capabilityTypes: operations.CapabilityTypes; + + /** + * Initializes a new instance of the ChaosManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. + * @param subscriptionId GUID that represents an Azure subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ChaosManagementClientOptions) { + super(credentials, subscriptionId, options); + this.capabilities = new operations.Capabilities(this); + this.experiments = new operations.Experiments(this); + this.operations = new operations.Operations(this); + this.targets = new operations.Targets(this); + this.targetTypes = new operations.TargetTypes(this); + this.capabilityTypes = new operations.CapabilityTypes(this); + } +} + +// Operation Specifications + +export { + ChaosManagementClient, + ChaosManagementClientContext, + Models as ChaosManagementModels, + Mappers as ChaosManagementMappers +}; +export * from "./operations"; diff --git a/sdk/chaos/arm-chaos/src/chaosManagementClientContext.ts b/sdk/chaos/arm-chaos/src/chaosManagementClientContext.ts new file mode 100644 index 000000000000..898a73eca47c --- /dev/null +++ b/sdk/chaos/arm-chaos/src/chaosManagementClientContext.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; + +const packageName = "@azure/arm-chaos"; +const packageVersion = "1.0.0"; + +export class ChaosManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials | TokenCredential; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the ChaosManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. + * @param subscriptionId GUID that represents an Azure subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ChaosManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if (!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2021-09-15-preview'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/chaos/arm-chaos/src/models/capabilitiesMappers.ts b/sdk/chaos/arm-chaos/src/models/capabilitiesMappers.ts new file mode 100644 index 000000000000..d7071f7f5ca5 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/capabilitiesMappers.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + discriminators, + Action, + AzureEntityResource, + BaseResource, + Branch, + Capability, + CapabilityListResult, + CapabilityType, + ContinuousAction, + DelayAction, + DiscreteAction, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Experiment, + KeyValuePair, + ProxyResource, + Resource, + ResourceIdentity, + Selector, + Step, + SystemData, + Target, + TargetReference, + TargetType, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/chaos/arm-chaos/src/models/capabilityTypesMappers.ts b/sdk/chaos/arm-chaos/src/models/capabilityTypesMappers.ts new file mode 100644 index 000000000000..850575dec1be --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/capabilityTypesMappers.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + discriminators, + Action, + AzureEntityResource, + BaseResource, + Branch, + Capability, + CapabilityType, + CapabilityTypeListResult, + ContinuousAction, + DelayAction, + DiscreteAction, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Experiment, + KeyValuePair, + ProxyResource, + Resource, + ResourceIdentity, + Selector, + Step, + SystemData, + Target, + TargetReference, + TargetType, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/chaos/arm-chaos/src/models/experimentsMappers.ts b/sdk/chaos/arm-chaos/src/models/experimentsMappers.ts new file mode 100644 index 000000000000..d82fb4dd11f4 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/experimentsMappers.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + discriminators, + Action, + ActionStatus, + AzureEntityResource, + BaseResource, + Branch, + BranchStatus, + Capability, + CapabilityType, + ContinuousAction, + DelayAction, + DiscreteAction, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Experiment, + ExperimentCancelOperationResult, + ExperimentExecutionActionTargetDetailsError, + ExperimentExecutionActionTargetDetailsProperties, + ExperimentExecutionDetails, + ExperimentExecutionDetailsListResult, + ExperimentExecutionDetailsPropertiesRunInformation, + ExperimentListResult, + ExperimentStartOperationResult, + ExperimentStatus, + ExperimentStatusListResult, + KeyValuePair, + ProxyResource, + Resource, + ResourceIdentity, + Selector, + Step, + StepStatus, + SystemData, + Target, + TargetReference, + TargetType, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/chaos/arm-chaos/src/models/index.ts b/sdk/chaos/arm-chaos/src/models/index.ts new file mode 100644 index 000000000000..15cdb1b470d9 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/index.ts @@ -0,0 +1,1763 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + +/** + * The resource management error additional info. + */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly info?: any; +} + +/** + * The error detail. + */ +export interface ErrorDetail { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The error target. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + /** + * The error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.). + * @summary Error response + */ +export interface ErrorResponse { + /** + * The error object. + */ + error?: ErrorDetail; +} + +/** + * 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 timestamp of resource last modification (UTC) + */ + 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 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; +} + +/** + * Model that represents a Capability resource. + */ +export interface Capability extends Resource { + /** + * The standard system metadata of a resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; + /** + * String of the Publisher that this Capability extends. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly publisher?: string; + /** + * String of the Target Type that this Capability extends. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly targetType?: string; + /** + * Localized string of the description. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * URL to retrieve JSON schema of the Capability parameters. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly parametersSchema?: string; + /** + * String of the URN for this Capability Type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly urn?: string; +} + +/** + * Model that represents the Experiment action target details error model. + */ +export interface ExperimentExecutionActionTargetDetailsError { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; +} + +/** + * Model that represents the Experiment action target details properties model. + */ +export interface ExperimentExecutionActionTargetDetailsProperties { + /** + * The status of the execution. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: string; + /** + * The target for the action. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + /** + * String that represents the failed date time. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly failedDateUtc?: Date; + /** + * String that represents the completed date time. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly completedDateUtc?: Date; + /** + * The error of the action. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly error?: ExperimentExecutionActionTargetDetailsError; +} + +/** + * Model that represents the an action and its status. + */ +export interface ActionStatus { + /** + * The name of the action status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The id of the action status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The status of the action. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: string; + /** + * The array of targets. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly targets?: ExperimentExecutionActionTargetDetailsProperties[]; +} + +/** + * Model that represents the a list of actions and action statuses. + */ +export interface BranchStatus { + /** + * The name of the branch status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The id of the branch status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The status of the branch. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: string; + /** + * The array of actions. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly actions?: ActionStatus[]; +} + +/** + * Model that represents the a list of branches and branch statuses. + */ +export interface StepStatus { + /** + * The name of the step. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The id of the step. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The value of the status of the step. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: string; + /** + * The array of branches. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly branches?: BranchStatus[]; +} + +/** + * The information of the experiment run. + */ +export interface ExperimentExecutionDetailsPropertiesRunInformation { + /** + * The steps of the experiment run. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly steps?: StepStatus[]; +} + +/** + * Model that represents the execution details of a Experiment. + */ +export interface ExperimentExecutionDetails { + /** + * String of the resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * String of the fully qualified resource ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * String of the resource name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The id of the experiment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly experimentId?: string; + /** + * The value of the status of the experiment execution. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: string; + /** + * The reason why the execution failed. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly failureReason?: string; + /** + * String that represents the created date time. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdDateUtc?: Date; + /** + * String that represents the last action date time. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastActionDateUtc?: Date; + /** + * String that represents the start date time. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly startDateUtc?: Date; + /** + * String that represents the stop date time. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly stopDateUtc?: Date; + /** + * The information of the experiment run. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly runInformation?: ExperimentExecutionDetailsPropertiesRunInformation; +} + +/** + * Model that represents the status of a Experiment. + */ +export interface ExperimentStatus { + /** + * String of the resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * String of the fully qualified resource ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * String of the resource name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * String that represents the status of a Experiment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: string; + /** + * String that represents the created date time of a Experiment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdDateUtc?: Date; + /** + * String that represents the end date time of a Experiment. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly endDateUtc?: Date; +} + +/** + * Model that represents the result of a start Experiment operation. + */ +export interface ExperimentStartOperationResult { + /** + * String of the Experiment name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * URL to retrieve the Experiment status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly statusUrl?: string; +} + +/** + * Model that represents the result of a cancel Experiment operation. + */ +export interface ExperimentCancelOperationResult { + /** + * String of the Experiment name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * URL to retrieve the Experiment status. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly statusUrl?: string; +} + +/** + * Model that represents a reference to a Target in the selector. + */ +export interface TargetReference { + /** + * String of the resource ID of a Target resource. + */ + id: string; +} + +/** + * Model that represents a selector in the Experiment resource. + */ +export interface Selector { + /** + * Enum of the selector type. Possible values include: 'Percent', 'Random', 'Tag', 'List' + */ + type: SelectorType; + /** + * String of the selector ID. + */ + id: string; + /** + * List of Target references. + */ + targets: TargetReference[]; +} + +/** + * A map to describe the settings of an action. + */ +export interface KeyValuePair { + /** + * The name of the setting for the action. + */ + key: string; + /** + * The value of the setting for the action. + */ + value: string; +} + +/** + * Contains the possible cases for Action. + */ +export type ActionUnion = Action | ContinuousAction | DiscreteAction | DelayAction; + +/** + * Model that represents the base action model. + */ +export interface Action { + /** + * Polymorphic Discriminator + */ + type: "action"; + /** + * String that represents a Capability URN. + */ + name: string; +} + +/** + * Model that represents a continuous action. + */ +export interface ContinuousAction { + /** + * Polymorphic Discriminator + */ + type: "continuous"; + /** + * String that represents a Capability URN. + */ + name: string; + /** + * ISO8601 formatted string that represents a duration. + */ + duration: string; + /** + * List of key value pairs. + */ + parameters: KeyValuePair[]; + /** + * String that represents a selector. + */ + selectorId: string; +} + +/** + * Model that represents a discrete action. + */ +export interface DiscreteAction { + /** + * Polymorphic Discriminator + */ + type: "discrete"; + /** + * String that represents a Capability URN. + */ + name: string; + /** + * List of key value pairs. + */ + parameters: KeyValuePair[]; + /** + * String that represents a selector. + */ + selectorId: string; +} + +/** + * Model that represents a delay action. + */ +export interface DelayAction { + /** + * Polymorphic Discriminator + */ + type: "delay"; + /** + * String that represents a Capability URN. + */ + name: string; + /** + * ISO8601 formatted string that represents a duration. + */ + duration: string; +} + +/** + * Model that represents a branch in the step. + */ +export interface Branch { + /** + * String of the branch name. + */ + name: string; + /** + * List of actions. + */ + actions: ActionUnion[]; +} + +/** + * Model that represents a step in the Experiment resource. + */ +export interface Step { + /** + * String of the step name. + */ + name: string; + /** + * List of branches. + */ + branches: Branch[]; +} + +/** + * The managed identity of a resource. + */ +export interface ResourceIdentity { + /** + * String of the resource identity type. Possible values include: 'None', 'SystemAssigned' + */ + type: ResourceIdentityType; + /** + * GUID that represents the principal ID of this resource identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * GUID that represents the tenant ID of this resource identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; +} + +/** + * Model that represents a Experiment resource. + */ +export interface Experiment extends TrackedResource { + /** + * The system metadata of the experiment resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; + /** + * The identity of the experiment resource. + */ + identity?: ResourceIdentity; + /** + * List of steps. + */ + steps: Step[]; + /** + * List of selectors. + */ + selectors: Selector[]; + /** + * A boolean value that indicates if experiment should be started on creation or not. + */ + startOnCreation?: boolean; +} + +/** + * Localized display information for this particular operation. + */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual + * Machines" or "Job Schedule Collections". + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create + * or Update Virtual Machine", "Restart Virtual Machine". + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and + * detailed views. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; +} + +/** + * Details of a REST API operation, returned from the Resource Provider Operations API + * @summary REST API Operation + */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and + * "false" for ARM/control-plane operations. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isDataAction?: boolean; + /** + * Localized display information for this particular operation. + */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + * logs UX. Default value is "user,system". Possible values include: 'user', 'system', + * 'user,system' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Possible values include: 'Internal' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly actionType?: ActionType; +} + +/** + * Model that represents a Target resource. + */ +export interface Target extends Resource { + /** + * The system metadata of the target resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; + /** + * Location of the target resource. + */ + location?: string; + /** + * The properties of the target resource. + */ + properties: { [propertyName: string]: any }; +} + +/** + * Model that represents a Target Type resource. + */ +export interface TargetType extends Resource { + /** + * The system metadata properties of the target type resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; + /** + * Location of the Target Type resource. + */ + location?: string; + /** + * Localized string of the display name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly displayName?: string; + /** + * Localized string of the description. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * URL to retrieve JSON schema of the Target Type properties. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly propertiesSchema?: string; + /** + * List of resource types this Target Type can extend. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resourceTypes?: string[]; +} + +/** + * Model that represents a Capability Type resource. + */ +export interface CapabilityType extends Resource { + /** + * The system metadata properties of the capability type resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; + /** + * Location of the Capability Type resource. + */ + location?: string; + /** + * String of the Publisher that this Capability Type extends. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly publisher?: string; + /** + * String of the Target Type that this Capability Type extends. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly targetType?: string; + /** + * Localized string of the display name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly displayName?: string; + /** + * Localized string of the description. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * URL to retrieve JSON schema of the Capability Type parameters. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly parametersSchema?: string; + /** + * String of the URN for this Capability Type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly urn?: string; +} + +/** + * Optional Parameters. + */ +export interface CapabilitiesListOptionalParams extends msRest.RequestOptionsBase { + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface CapabilitiesListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface ExperimentsListAllOptionalParams extends msRest.RequestOptionsBase { + /** + * Optional value that indicates whether to filter results based on if the Experiment is + * currently running. If null, then the results will not be filtered. + */ + running?: boolean; + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface ExperimentsListOptionalParams extends msRest.RequestOptionsBase { + /** + * Optional value that indicates whether to filter results based on if the Experiment is + * currently running. If null, then the results will not be filtered. + */ + running?: boolean; + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface ExperimentsListAllNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Optional value that indicates whether to filter results based on if the Experiment is + * currently running. If null, then the results will not be filtered. + */ + running?: boolean; + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface ExperimentsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Optional value that indicates whether to filter results based on if the Experiment is + * currently running. If null, then the results will not be filtered. + */ + running?: boolean; + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface TargetsListOptionalParams extends msRest.RequestOptionsBase { + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface TargetsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface TargetTypesListOptionalParams extends msRest.RequestOptionsBase { + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface TargetTypesListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface CapabilityTypesListOptionalParams extends msRest.RequestOptionsBase { + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * Optional Parameters. + */ +export interface CapabilityTypesListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * String that sets the continuation token. + */ + continuationToken?: string; +} + +/** + * An interface representing ChaosManagementClientOptions. + */ +export interface ChaosManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * Model that represents a list of Capability resources and a link for pagination. + * @extends Array + */ +export interface CapabilityListResult extends Array { + /** + * URL to retrieve the next page of Capability resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Model that represents a list of Experiment resources and a link for pagination. + * @extends Array + */ +export interface ExperimentListResult extends Array { + /** + * URL to retrieve the next page of Experiment resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Model that represents a list of Experiment statuses and a link for pagination. + * @extends Array + */ +export interface ExperimentStatusListResult extends Array { + /** + * URL to retrieve the next page of Experiment statuses. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Model that represents a list of Experiment execution details and a link for pagination. + * @extends Array + */ +export interface ExperimentExecutionDetailsListResult extends Array { + /** + * URL to retrieve the next page of Experiment execution details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + * to get the next set of results. + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * URL to get the next set of operation list results (if there are any). + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Model that represents a list of Target resources and a link for pagination. + * @extends Array + */ +export interface TargetListResult extends Array { + /** + * URL to retrieve the next page of Target resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Model that represents a list of Target Type resources and a link for pagination. + * @extends Array + */ +export interface TargetTypeListResult extends Array { + /** + * URL to retrieve the next page of Target Type resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * Model that represents a list of Capability Type resources and a link for pagination. + * @extends Array + */ +export interface CapabilityTypeListResult extends Array { + /** + * URL to retrieve the next page of Capability Type resources. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + +/** + * Defines values for SelectorType. + * Possible values include: 'Percent', 'Random', 'Tag', 'List' + * @readonly + * @enum {string} + */ +export type SelectorType = 'Percent' | 'Random' | 'Tag' | 'List'; + +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'None', 'SystemAssigned' + * @readonly + * @enum {string} + */ +export type ResourceIdentityType = 'None' | 'SystemAssigned'; + +/** + * Defines values for Origin. + * Possible values include: 'user', 'system', 'user,system' + * @readonly + * @enum {string} + */ +export type Origin = 'user' | 'system' | 'user,system'; + +/** + * Defines values for ActionType. + * Possible values include: 'Internal' + * @readonly + * @enum {string} + */ +export type ActionType = 'Internal'; + +/** + * Contains response data for the list operation. + */ +export type CapabilitiesListResponse = CapabilityListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CapabilityListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CapabilitiesGetResponse = Capability & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Capability; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type CapabilitiesCreateOrUpdateResponse = Capability & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Capability; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type CapabilitiesListNextResponse = CapabilityListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CapabilityListResult; + }; +}; + +/** + * Contains response data for the listAll operation. + */ +export type ExperimentsListAllResponse = ExperimentListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ExperimentsListResponse = ExperimentListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ExperimentsGetResponse = Experiment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Experiment; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type ExperimentsCreateOrUpdateResponse = Experiment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Experiment; + }; +}; + +/** + * Contains response data for the cancel operation. + */ +export type ExperimentsCancelResponse = ExperimentCancelOperationResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentCancelOperationResult; + }; +}; + +/** + * Contains response data for the start operation. + */ +export type ExperimentsStartResponse = ExperimentStartOperationResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentStartOperationResult; + }; +}; + +/** + * Contains response data for the listAllStatuses operation. + */ +export type ExperimentsListAllStatusesResponse = ExperimentStatusListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentStatusListResult; + }; +}; + +/** + * Contains response data for the getStatus operation. + */ +export type ExperimentsGetStatusResponse = ExperimentStatus & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentStatus; + }; +}; + +/** + * Contains response data for the listExecutionDetails operation. + */ +export type ExperimentsListExecutionDetailsResponse = ExperimentExecutionDetailsListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentExecutionDetailsListResult; + }; +}; + +/** + * Contains response data for the getExecutionDetails operation. + */ +export type ExperimentsGetExecutionDetailsResponse = ExperimentExecutionDetails & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentExecutionDetails; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type ExperimentsBeginCreateOrUpdateResponse = Experiment & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Experiment; + }; +}; + +/** + * Contains response data for the beginCancel operation. + */ +export type ExperimentsBeginCancelResponse = ExperimentCancelOperationResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentCancelOperationResult; + }; +}; + +/** + * Contains response data for the listAllNext operation. + */ +export type ExperimentsListAllNextResponse = ExperimentListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ExperimentsListNextResponse = ExperimentListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentListResult; + }; +}; + +/** + * Contains response data for the listAllStatusesNext operation. + */ +export type ExperimentsListAllStatusesNextResponse = ExperimentStatusListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentStatusListResult; + }; +}; + +/** + * Contains response data for the listExecutionDetailsNext operation. + */ +export type ExperimentsListExecutionDetailsNextResponse = ExperimentExecutionDetailsListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ExperimentExecutionDetailsListResult; + }; +}; + +/** + * Contains response data for the listAll operation. + */ +export type OperationsListAllResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + +/** + * Contains response data for the listAllNext operation. + */ +export type OperationsListAllNextResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type TargetsListResponse = TargetListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TargetListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type TargetsGetResponse = Target & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Target; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type TargetsCreateOrUpdateResponse = Target & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Target; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type TargetsListNextResponse = TargetListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TargetListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type TargetTypesListResponse = TargetTypeListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TargetTypeListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type TargetTypesGetResponse = TargetType & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TargetType; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type TargetTypesListNextResponse = TargetTypeListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TargetTypeListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type CapabilityTypesListResponse = CapabilityTypeListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CapabilityTypeListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CapabilityTypesGetResponse = CapabilityType & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CapabilityType; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type CapabilityTypesListNextResponse = CapabilityTypeListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CapabilityTypeListResult; + }; +}; diff --git a/sdk/chaos/arm-chaos/src/models/mappers.ts b/sdk/chaos/arm-chaos/src/models/mappers.ts new file mode 100644 index 000000000000..1ae1765601cf --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/mappers.ts @@ -0,0 +1,1630 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + } + } + } +}; + +export const ErrorDetail: msRest.CompositeMapper = { + serializedName: "ErrorDetail", + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const 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" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + 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 Capability: msRest.CompositeMapper = { + serializedName: "capability", + type: { + name: "Composite", + className: "Capability", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + publisher: { + readOnly: true, + serializedName: "properties.publisher", + type: { + name: "String" + } + }, + targetType: { + readOnly: true, + serializedName: "properties.targetType", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "properties.description", + type: { + name: "String" + } + }, + parametersSchema: { + readOnly: true, + serializedName: "properties.parametersSchema", + type: { + name: "String" + } + }, + urn: { + readOnly: true, + serializedName: "properties.urn", + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentExecutionActionTargetDetailsError: msRest.CompositeMapper = { + serializedName: "experimentExecutionActionTargetDetailsError", + type: { + name: "Composite", + className: "ExperimentExecutionActionTargetDetailsError", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentExecutionActionTargetDetailsProperties: msRest.CompositeMapper = { + serializedName: "experimentExecutionActionTargetDetailsProperties", + type: { + name: "Composite", + className: "ExperimentExecutionActionTargetDetailsProperties", + modelProperties: { + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + failedDateUtc: { + nullable: true, + readOnly: true, + serializedName: "failedDateUtc", + type: { + name: "DateTime" + } + }, + completedDateUtc: { + nullable: true, + readOnly: true, + serializedName: "completedDateUtc", + type: { + name: "DateTime" + } + }, + error: { + nullable: true, + readOnly: true, + serializedName: "error", + type: { + name: "Composite", + className: "ExperimentExecutionActionTargetDetailsError" + } + } + } + } +}; + +export const ActionStatus: msRest.CompositeMapper = { + serializedName: "actionStatus", + type: { + name: "Composite", + className: "ActionStatus", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } + }, + targets: { + readOnly: true, + serializedName: "targets", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExperimentExecutionActionTargetDetailsProperties" + } + } + } + } + } + } +}; + +export const BranchStatus: msRest.CompositeMapper = { + serializedName: "branchStatus", + type: { + name: "Composite", + className: "BranchStatus", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } + }, + actions: { + readOnly: true, + serializedName: "actions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ActionStatus" + } + } + } + } + } + } +}; + +export const StepStatus: msRest.CompositeMapper = { + serializedName: "stepStatus", + type: { + name: "Composite", + className: "StepStatus", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } + }, + branches: { + readOnly: true, + serializedName: "branches", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BranchStatus" + } + } + } + } + } + } +}; + +export const ExperimentExecutionDetailsPropertiesRunInformation: msRest.CompositeMapper = { + serializedName: "experimentExecutionDetailsProperties_runInformation", + type: { + name: "Composite", + className: "ExperimentExecutionDetailsPropertiesRunInformation", + modelProperties: { + steps: { + readOnly: true, + serializedName: "steps", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StepStatus" + } + } + } + } + } + } +}; + +export const ExperimentExecutionDetails: msRest.CompositeMapper = { + serializedName: "experimentExecutionDetails", + type: { + name: "Composite", + className: "ExperimentExecutionDetails", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + experimentId: { + readOnly: true, + serializedName: "properties.experimentId", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "properties.status", + type: { + name: "String" + } + }, + failureReason: { + readOnly: true, + serializedName: "properties.failureReason", + type: { + name: "String" + } + }, + createdDateUtc: { + readOnly: true, + serializedName: "properties.createdDateUtc", + type: { + name: "DateTime" + } + }, + lastActionDateUtc: { + readOnly: true, + serializedName: "properties.lastActionDateUtc", + type: { + name: "DateTime" + } + }, + startDateUtc: { + readOnly: true, + serializedName: "properties.startDateUtc", + type: { + name: "DateTime" + } + }, + stopDateUtc: { + readOnly: true, + serializedName: "properties.stopDateUtc", + type: { + name: "DateTime" + } + }, + runInformation: { + readOnly: true, + serializedName: "properties.runInformation", + type: { + name: "Composite", + className: "ExperimentExecutionDetailsPropertiesRunInformation" + } + } + } + } +}; + +export const ExperimentStatus: msRest.CompositeMapper = { + serializedName: "experimentStatus", + type: { + name: "Composite", + className: "ExperimentStatus", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "properties.status", + type: { + name: "String" + } + }, + createdDateUtc: { + readOnly: true, + serializedName: "properties.createdDateUtc", + type: { + name: "DateTime" + } + }, + endDateUtc: { + nullable: true, + readOnly: true, + serializedName: "properties.endDateUtc", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ExperimentStartOperationResult: msRest.CompositeMapper = { + serializedName: "experimentStartOperationResult", + type: { + name: "Composite", + className: "ExperimentStartOperationResult", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + statusUrl: { + readOnly: true, + serializedName: "statusUrl", + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentCancelOperationResult: msRest.CompositeMapper = { + serializedName: "experimentCancelOperationResult", + type: { + name: "Composite", + className: "ExperimentCancelOperationResult", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + statusUrl: { + readOnly: true, + serializedName: "statusUrl", + type: { + name: "String" + } + } + } + } +}; + +export const TargetReference: msRest.CompositeMapper = { + serializedName: "targetReference", + type: { + name: "Composite", + className: "TargetReference", + modelProperties: { + type: { + required: true, + isConstant: true, + serializedName: "type", + defaultValue: 'ChaosTarget', + type: { + name: "String" + } + }, + id: { + required: true, + serializedName: "id", + constraints: { + Pattern: /^\/[Ss][Uu][Bb][Ss][Cc][Rr][Ii][Pp][Tt][Ii][Oo][Nn][Ss]\/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\/[Rr][Ee][Ss][Oo][Uu][Rr][Cc][Ee][Gg][Rr][Oo][Uu][Pp][Ss]\/[a-zA-Z0-9_\-\.\(\)]*[a-zA-Z0-9_\-\(\)]\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\/[a-zA-Z0-9]+\.[a-zA-Z0-9]+\/[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+\/[Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr][Ss]\/[Mm][Ii][Cc][Rr][Oo][Ss][Oo][Ff][Tt]\.[Cc][Hh][Aa][Oo][Ss]\/[Tt][Aa][Rr][Gg][Ee][Tt][Ss]\/[a-zA-Z0-9_\-\.]+$/ + }, + type: { + name: "String" + } + } + } + } +}; + +export const Selector: msRest.CompositeMapper = { + serializedName: "selector", + type: { + name: "Composite", + className: "Selector", + modelProperties: { + type: { + required: true, + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "Percent", + "Random", + "Tag", + "List" + ] + } + }, + id: { + required: true, + serializedName: "id", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + }, + targets: { + required: true, + serializedName: "targets", + constraints: { + MinItems: 1 + }, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetReference" + } + } + } + } + } + } +}; + +export const KeyValuePair: msRest.CompositeMapper = { + serializedName: "keyValuePair", + type: { + name: "Composite", + className: "KeyValuePair", + modelProperties: { + key: { + required: true, + serializedName: "key", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } + } + } +}; + +export const Action: msRest.CompositeMapper = { + serializedName: "action", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "type", + clientName: "type" + }, + uberParent: "Action", + className: "Action", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + required: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ContinuousAction: msRest.CompositeMapper = { + serializedName: "continuous", + type: { + name: "Composite", + polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + uberParent: "Action", + className: "ContinuousAction", + modelProperties: { + ...Action.type.modelProperties, + duration: { + required: true, + serializedName: "duration", + constraints: { + Pattern: /^P(\d+Y)?(\d+M)?(\d+D)?(T(\d+H)?(\d+M)?(\d+(\.\d+)?S)?)?$/ + }, + type: { + name: "String" + } + }, + parameters: { + required: true, + serializedName: "parameters", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyValuePair" + } + } + } + }, + selectorId: { + required: true, + serializedName: "selectorId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } + } + } +}; + +export const DiscreteAction: msRest.CompositeMapper = { + serializedName: "discrete", + type: { + name: "Composite", + polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + uberParent: "Action", + className: "DiscreteAction", + modelProperties: { + ...Action.type.modelProperties, + parameters: { + required: true, + serializedName: "parameters", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyValuePair" + } + } + } + }, + selectorId: { + required: true, + serializedName: "selectorId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } + } + } +}; + +export const DelayAction: msRest.CompositeMapper = { + serializedName: "delay", + type: { + name: "Composite", + polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + uberParent: "Action", + className: "DelayAction", + modelProperties: { + ...Action.type.modelProperties, + duration: { + required: true, + serializedName: "duration", + constraints: { + Pattern: /^P(\d+Y)?(\d+M)?(\d+D)?(T(\d+H)?(\d+M)?(\d+(\.\d+)?S)?)?$/ + }, + type: { + name: "String" + } + } + } + } +}; + +export const Branch: msRest.CompositeMapper = { + serializedName: "branch", + type: { + name: "Composite", + className: "Branch", + modelProperties: { + name: { + required: true, + serializedName: "name", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + }, + actions: { + required: true, + serializedName: "actions", + constraints: { + MinItems: 1 + }, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Action" + } + } + } + } + } + } +}; + +export const Step: msRest.CompositeMapper = { + serializedName: "step", + type: { + name: "Composite", + className: "Step", + modelProperties: { + name: { + required: true, + serializedName: "name", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + }, + branches: { + required: true, + serializedName: "branches", + constraints: { + MinItems: 1 + }, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Branch" + } + } + } + } + } + } +}; + +export const ResourceIdentity: msRest.CompositeMapper = { + serializedName: "resourceIdentity", + type: { + name: "Composite", + className: "ResourceIdentity", + modelProperties: { + type: { + required: true, + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "None", + "SystemAssigned" + ] + } + }, + principalId: { + readOnly: true, + serializedName: "principalId", + constraints: { + Pattern: /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/ + }, + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + constraints: { + Pattern: /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/ + }, + type: { + name: "String" + } + } + } + } +}; + +export const Experiment: msRest.CompositeMapper = { + serializedName: "experiment", + type: { + name: "Composite", + className: "Experiment", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ResourceIdentity" + } + }, + steps: { + required: true, + serializedName: "properties.steps", + constraints: { + MinItems: 1 + }, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Step" + } + } + } + }, + selectors: { + required: true, + serializedName: "properties.selectors", + constraints: { + MinItems: 1 + }, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Selector" + } + } + } + }, + startOnCreation: { + nullable: true, + serializedName: "properties.startOnCreation", + type: { + name: "Boolean" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + readOnly: true, + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + readOnly: true, + serializedName: "origin", + type: { + name: "String" + } + }, + actionType: { + readOnly: true, + serializedName: "actionType", + type: { + name: "String" + } + } + } + } +}; + +export const Target: msRest.CompositeMapper = { + serializedName: "target", + type: { + name: "Composite", + className: "Target", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "Object" + } + } + } + } + } + } +}; + +export const TargetType: msRest.CompositeMapper = { + serializedName: "targetType", + type: { + name: "Composite", + className: "TargetType", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + displayName: { + readOnly: true, + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "properties.description", + type: { + name: "String" + } + }, + propertiesSchema: { + readOnly: true, + serializedName: "properties.propertiesSchema", + type: { + name: "String" + } + }, + resourceTypes: { + readOnly: true, + serializedName: "properties.resourceTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CapabilityType: msRest.CompositeMapper = { + serializedName: "capabilityType", + type: { + name: "Composite", + className: "CapabilityType", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + publisher: { + readOnly: true, + serializedName: "properties.publisher", + type: { + name: "String" + } + }, + targetType: { + readOnly: true, + serializedName: "properties.targetType", + type: { + name: "String" + } + }, + displayName: { + readOnly: true, + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "properties.description", + type: { + name: "String" + } + }, + parametersSchema: { + readOnly: true, + serializedName: "properties.parametersSchema", + type: { + name: "String" + } + }, + urn: { + readOnly: true, + serializedName: "properties.urn", + type: { + name: "String" + } + } + } + } +}; + +export const CapabilityListResult: msRest.CompositeMapper = { + serializedName: "capabilityListResult", + type: { + name: "Composite", + className: "CapabilityListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Capability" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentListResult: msRest.CompositeMapper = { + serializedName: "experimentListResult", + type: { + name: "Composite", + className: "ExperimentListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Experiment" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentStatusListResult: msRest.CompositeMapper = { + serializedName: "experimentStatusListResult", + type: { + name: "Composite", + className: "ExperimentStatusListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExperimentStatus" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ExperimentExecutionDetailsListResult: msRest.CompositeMapper = { + serializedName: "experimentExecutionDetailsListResult", + type: { + name: "Composite", + className: "ExperimentExecutionDetailsListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExperimentExecutionDetails" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const TargetListResult: msRest.CompositeMapper = { + serializedName: "targetListResult", + type: { + name: "Composite", + className: "TargetListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Target" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const TargetTypeListResult: msRest.CompositeMapper = { + serializedName: "targetTypeListResult", + type: { + name: "Composite", + className: "TargetTypeListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetType" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CapabilityTypeListResult: msRest.CompositeMapper = { + serializedName: "capabilityTypeListResult", + type: { + name: "Composite", + className: "CapabilityTypeListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CapabilityType" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const discriminators = { + 'Action.continuous' : ContinuousAction, + 'Action.discrete' : DiscreteAction, + 'Action.delay' : DelayAction, + 'action' : Action + +}; diff --git a/sdk/chaos/arm-chaos/src/models/operationsMappers.ts b/sdk/chaos/arm-chaos/src/models/operationsMappers.ts new file mode 100644 index 000000000000..392eafc4561b --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/operationsMappers.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + discriminators, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Operation, + OperationDisplay, + OperationListResult +} from "../models/mappers"; diff --git a/sdk/chaos/arm-chaos/src/models/parameters.ts b/sdk/chaos/arm-chaos/src/models/parameters.ts new file mode 100644 index 000000000000..7bb01bc8e44f --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/parameters.ts @@ -0,0 +1,239 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + constraints: { + Pattern: /^[0-9]{4}-[0-9]{2}-[0-9]{2}(|-preview)$/ + }, + type: { + name: "String" + } + } +}; +export const capabilityName: msRest.OperationURLParameter = { + parameterPath: "capabilityName", + mapper: { + required: true, + serializedName: "capabilityName", + constraints: { + Pattern: /^[a-zA-Z0-9\-\.]+-\d\.\d$/ + }, + type: { + name: "String" + } + } +}; +export const capabilityTypeName: msRest.OperationURLParameter = { + parameterPath: "capabilityTypeName", + mapper: { + required: true, + serializedName: "capabilityTypeName", + constraints: { + Pattern: /^[a-zA-Z0-9\-\.]+-\d\.\d$/ + }, + type: { + name: "String" + } + } +}; +export const continuationToken: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "continuationToken" + ], + mapper: { + serializedName: "continuationToken", + type: { + name: "String" + } + } +}; +export const executionDetailsId: msRest.OperationURLParameter = { + parameterPath: "executionDetailsId", + mapper: { + required: true, + serializedName: "executionDetailsId", + constraints: { + Pattern: /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/ + }, + type: { + name: "String" + } + } +}; +export const experimentName: msRest.OperationURLParameter = { + parameterPath: "experimentName", + mapper: { + required: true, + serializedName: "experimentName", + constraints: { + MinLength: 1, + Pattern: /^[a-zA-Z0-9_\-\.]+$/ + }, + type: { + name: "String" + } + } +}; +export const locationName: msRest.OperationURLParameter = { + parameterPath: "locationName", + mapper: { + required: true, + serializedName: "locationName", + constraints: { + Pattern: /^[a-zA-Z0-9_\-\.]+$/ + }, + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const parentProviderNamespace: msRest.OperationURLParameter = { + parameterPath: "parentProviderNamespace", + mapper: { + required: true, + serializedName: "parentProviderNamespace", + constraints: { + Pattern: /^[a-zA-Z0-9]+\.[a-zA-Z0-9]+$/ + }, + type: { + name: "String" + } + } +}; +export const parentResourceName: msRest.OperationURLParameter = { + parameterPath: "parentResourceName", + mapper: { + required: true, + serializedName: "parentResourceName", + constraints: { + Pattern: /^[a-zA-Z0-9_\-\.]+$/ + }, + type: { + name: "String" + } + } +}; +export const parentResourceType: msRest.OperationURLParameter = { + parameterPath: "parentResourceType", + mapper: { + required: true, + serializedName: "parentResourceType", + constraints: { + Pattern: /^[a-zA-Z0-9_\-\.]+$/ + }, + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + Pattern: /^[a-zA-Z0-9_\-\.\(\)]*[a-zA-Z0-9_\-\(\)]$/ + }, + type: { + name: "String" + } + } +}; +export const running: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "running" + ], + mapper: { + serializedName: "running", + type: { + name: "Boolean" + } + } +}; +export const statusId: msRest.OperationURLParameter = { + parameterPath: "statusId", + mapper: { + required: true, + serializedName: "statusId", + constraints: { + Pattern: /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/ + }, + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + constraints: { + Pattern: /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/ + }, + type: { + name: "String" + } + } +}; +export const targetName: msRest.OperationURLParameter = { + parameterPath: "targetName", + mapper: { + required: true, + serializedName: "targetName", + constraints: { + Pattern: /^[a-zA-Z0-9_\-\.]+$/ + }, + type: { + name: "String" + } + } +}; +export const targetTypeName: msRest.OperationURLParameter = { + parameterPath: "targetTypeName", + mapper: { + required: true, + serializedName: "targetTypeName", + constraints: { + Pattern: /^[a-zA-Z0-9_\-\.]+$/ + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/chaos/arm-chaos/src/models/targetTypesMappers.ts b/sdk/chaos/arm-chaos/src/models/targetTypesMappers.ts new file mode 100644 index 000000000000..ed4bb170f844 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/targetTypesMappers.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + discriminators, + Action, + AzureEntityResource, + BaseResource, + Branch, + Capability, + CapabilityType, + ContinuousAction, + DelayAction, + DiscreteAction, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Experiment, + KeyValuePair, + ProxyResource, + Resource, + ResourceIdentity, + Selector, + Step, + SystemData, + Target, + TargetReference, + TargetType, + TargetTypeListResult, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/chaos/arm-chaos/src/models/targetsMappers.ts b/sdk/chaos/arm-chaos/src/models/targetsMappers.ts new file mode 100644 index 000000000000..bfd08e86236a --- /dev/null +++ b/sdk/chaos/arm-chaos/src/models/targetsMappers.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + discriminators, + Action, + AzureEntityResource, + BaseResource, + Branch, + Capability, + CapabilityType, + ContinuousAction, + DelayAction, + DiscreteAction, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Experiment, + KeyValuePair, + ProxyResource, + Resource, + ResourceIdentity, + Selector, + Step, + SystemData, + Target, + TargetListResult, + TargetReference, + TargetType, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/chaos/arm-chaos/src/operations/capabilities.ts b/sdk/chaos/arm-chaos/src/operations/capabilities.ts new file mode 100644 index 000000000000..d9506cc058f7 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/capabilities.ts @@ -0,0 +1,392 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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/capabilitiesMappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClientContext } from "../chaosManagementClientContext"; + +/** Class representing a Capabilities. */ +export class Capabilities { + private readonly client: ChaosManagementClientContext; + + /** + * Create a Capabilities. + * @param {ChaosManagementClientContext} client Reference to the service client. + */ + constructor(client: ChaosManagementClientContext) { + this.client = client; + } + + /** + * Get a list of Capability resources that extend a Target resource.. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options?: Models.CapabilitiesListOptionalParams): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param callback The callback + */ + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options: Models.CapabilitiesListOptionalParams, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options?: Models.CapabilitiesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get a Capability resource that extends a Target resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param callback The callback + */ + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + capabilityName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Delete a Capability that extends a Target resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + capabilityName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Create or update a Capability resource that extends a Target resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param capabilityName String that represents a Capability resource name. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, capabilityName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + capabilityName, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Get a list of Capability resources that extend a Target resource.. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: Models.CapabilitiesListNextOptionalParams): 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: Models.CapabilitiesListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.CapabilitiesListNextOptionalParams | 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: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CapabilityListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName, + Parameters.capabilityName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Capability + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName, + Parameters.capabilityName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName, + Parameters.capabilityName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "capability", + mapper: { + ...Mappers.Capability, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Capability + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CapabilityListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/capabilityTypes.ts b/sdk/chaos/arm-chaos/src/operations/capabilityTypes.ts new file mode 100644 index 000000000000..dc4b95418ce4 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/capabilityTypes.ts @@ -0,0 +1,202 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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/capabilityTypesMappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClientContext } from "../chaosManagementClientContext"; + +/** Class representing a CapabilityTypes. */ +export class CapabilityTypes { + private readonly client: ChaosManagementClientContext; + + /** + * Create a CapabilityTypes. + * @param {ChaosManagementClientContext} client Reference to the service client. + */ + constructor(client: ChaosManagementClientContext) { + this.client = client; + } + + /** + * Get a list of Capability Type resources for given Target Type and location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param [options] The optional parameters + * @returns Promise + */ + list(locationName: string, targetTypeName: string, options?: Models.CapabilityTypesListOptionalParams): Promise; + /** + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param callback The callback + */ + list(locationName: string, targetTypeName: string, callback: msRest.ServiceCallback): void; + /** + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param options The optional parameters + * @param callback The callback + */ + list(locationName: string, targetTypeName: string, options: Models.CapabilityTypesListOptionalParams, callback: msRest.ServiceCallback): void; + list(locationName: string, targetTypeName: string, options?: Models.CapabilityTypesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + locationName, + targetTypeName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get a Capability Type resource for given Target Type and location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param capabilityTypeName String that represents a Capability Type resource name. + * @param [options] The optional parameters + * @returns Promise + */ + get(locationName: string, targetTypeName: string, capabilityTypeName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param capabilityTypeName String that represents a Capability Type resource name. + * @param callback The callback + */ + get(locationName: string, targetTypeName: string, capabilityTypeName: string, callback: msRest.ServiceCallback): void; + /** + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param capabilityTypeName String that represents a Capability Type resource name. + * @param options The optional parameters + * @param callback The callback + */ + get(locationName: string, targetTypeName: string, capabilityTypeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(locationName: string, targetTypeName: string, capabilityTypeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + locationName, + targetTypeName, + capabilityTypeName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Get a list of Capability Type resources for given Target Type and location. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: Models.CapabilityTypesListNextOptionalParams): 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: Models.CapabilityTypesListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.CapabilityTypesListNextOptionalParams | 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: "subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes", + urlParameters: [ + Parameters.subscriptionId, + Parameters.locationName, + Parameters.targetTypeName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CapabilityTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.locationName, + Parameters.targetTypeName, + Parameters.capabilityTypeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CapabilityType + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CapabilityTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/experiments.ts b/sdk/chaos/arm-chaos/src/operations/experiments.ts new file mode 100644 index 000000000000..510e59496d51 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/experiments.ts @@ -0,0 +1,873 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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/experimentsMappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClientContext } from "../chaosManagementClientContext"; + +/** Class representing a Experiments. */ +export class Experiments { + private readonly client: ChaosManagementClientContext; + + /** + * Create a Experiments. + * @param {ChaosManagementClientContext} client Reference to the service client. + */ + constructor(client: ChaosManagementClientContext) { + this.client = client; + } + + /** + * Get a list of Experiment resources in a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listAll(options?: Models.ExperimentsListAllOptionalParams): Promise; + /** + * @param callback The callback + */ + listAll(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listAll(options: Models.ExperimentsListAllOptionalParams, callback: msRest.ServiceCallback): void; + listAll(options?: Models.ExperimentsListAllOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listAllOperationSpec, + callback) as Promise; + } + + /** + * Get a list of Experiment resources in a resource group. + * @param resourceGroupName String that represents an Azure resource group. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, options?: Models.ExperimentsListOptionalParams): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param callback The callback + */ + list(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, options: Models.ExperimentsListOptionalParams, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, options?: Models.ExperimentsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Delete a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, experimentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, experimentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + experimentName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Get a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param callback The callback + */ + get(resourceGroupName: string, experimentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, experimentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + experimentName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create or update a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Experiment resource to be created or updated. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, experimentName: string, experiment: Models.Experiment, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,experimentName,experiment,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Cancel a running Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param [options] The optional parameters + * @returns Promise + */ + cancel(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginCancel(resourceGroupName,experimentName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Start a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param [options] The optional parameters + * @returns Promise + */ + start(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param callback The callback + */ + start(resourceGroupName: string, experimentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The optional parameters + * @param callback The callback + */ + start(resourceGroupName: string, experimentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + start(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + experimentName, + options + }, + startOperationSpec, + callback) as Promise; + } + + /** + * Get a list of statuses of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param [options] The optional parameters + * @returns Promise + */ + listAllStatuses(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param callback The callback + */ + listAllStatuses(resourceGroupName: string, experimentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The optional parameters + * @param callback The callback + */ + listAllStatuses(resourceGroupName: string, experimentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAllStatuses(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + experimentName, + options + }, + listAllStatusesOperationSpec, + callback) as Promise; + } + + /** + * Get a status of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param statusId GUID that represents a Experiment status. + * @param [options] The optional parameters + * @returns Promise + */ + getStatus(resourceGroupName: string, experimentName: string, statusId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param statusId GUID that represents a Experiment status. + * @param callback The callback + */ + getStatus(resourceGroupName: string, experimentName: string, statusId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param statusId GUID that represents a Experiment status. + * @param options The optional parameters + * @param callback The callback + */ + getStatus(resourceGroupName: string, experimentName: string, statusId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getStatus(resourceGroupName: string, experimentName: string, statusId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + experimentName, + statusId, + options + }, + getStatusOperationSpec, + callback) as Promise; + } + + /** + * Get a list of execution details of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param [options] The optional parameters + * @returns Promise + */ + listExecutionDetails(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param callback The callback + */ + listExecutionDetails(resourceGroupName: string, experimentName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The optional parameters + * @param callback The callback + */ + listExecutionDetails(resourceGroupName: string, experimentName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listExecutionDetails(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + experimentName, + options + }, + listExecutionDetailsOperationSpec, + callback) as Promise; + } + + /** + * Get an execution detail of a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param executionDetailsId GUID that represents a Experiment execution detail. + * @param [options] The optional parameters + * @returns Promise + */ + getExecutionDetails(resourceGroupName: string, experimentName: string, executionDetailsId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param executionDetailsId GUID that represents a Experiment execution detail. + * @param callback The callback + */ + getExecutionDetails(resourceGroupName: string, experimentName: string, executionDetailsId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param executionDetailsId GUID that represents a Experiment execution detail. + * @param options The optional parameters + * @param callback The callback + */ + getExecutionDetails(resourceGroupName: string, experimentName: string, executionDetailsId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getExecutionDetails(resourceGroupName: string, experimentName: string, executionDetailsId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + experimentName, + executionDetailsId, + options + }, + getExecutionDetailsOperationSpec, + callback) as Promise; + } + + /** + * Create or update a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Experiment resource to be created or updated. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, experimentName: string, experiment: Models.Experiment, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + experimentName, + experiment, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Cancel a running Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param [options] The optional parameters + * @returns Promise + */ + beginCancel(resourceGroupName: string, experimentName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + experimentName, + options + }, + beginCancelOperationSpec, + options); + } + + /** + * Get a list of Experiment resources in a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAllNext(nextPageLink: string, options?: Models.ExperimentsListAllNextOptionalParams): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAllNext(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 + */ + listAllNext(nextPageLink: string, options: Models.ExperimentsListAllNextOptionalParams, callback: msRest.ServiceCallback): void; + listAllNext(nextPageLink: string, options?: Models.ExperimentsListAllNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAllNextOperationSpec, + callback) as Promise; + } + + /** + * Get a list of Experiment resources in a resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: Models.ExperimentsListNextOptionalParams): 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: Models.ExperimentsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.ExperimentsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * Get a list of statuses of a Experiment resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAllStatusesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAllStatusesNext(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 + */ + listAllStatusesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAllStatusesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAllStatusesNextOperationSpec, + callback) as Promise; + } + + /** + * Get a list of execution details of a Experiment resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listExecutionDetailsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listExecutionDetailsNext(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 + */ + listExecutionDetailsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listExecutionDetailsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listExecutionDetailsNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listAllOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Chaos/experiments", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.running, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.running, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Experiment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const startOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: { + bodyMapper: Mappers.ExperimentStartOperationResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listAllStatusesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/statuses", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentStatusListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/statuses/{statusId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName, + Parameters.statusId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentStatus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listExecutionDetailsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executionDetails", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentExecutionDetailsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getExecutionDetailsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executionDetails/{executionDetailsId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName, + Parameters.executionDetailsId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentExecutionDetails + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "experiment", + mapper: { + ...Mappers.Experiment, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Experiment + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCancelOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.experimentName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: { + bodyMapper: Mappers.ExperimentCancelOperationResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listAllNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.running, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.running, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listAllStatusesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentStatusListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listExecutionDetailsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ExperimentExecutionDetailsListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/index.ts b/sdk/chaos/arm-chaos/src/operations/index.ts new file mode 100644 index 000000000000..4a14f9e74d2c --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./capabilities"; +export * from "./experiments"; +export * from "./operations"; +export * from "./targets"; +export * from "./targetTypes"; +export * from "./capabilityTypes"; diff --git a/sdk/chaos/arm-chaos/src/operations/operations.ts b/sdk/chaos/arm-chaos/src/operations/operations.ts new file mode 100644 index 000000000000..6ec1acddf41d --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/operations.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { ChaosManagementClientContext } from "../chaosManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: ChaosManagementClientContext; + + /** + * Create a Operations. + * @param {ChaosManagementClientContext} client Reference to the service client. + */ + constructor(client: ChaosManagementClientContext) { + this.client = client; + } + + /** + * Get a list all available Operations. + * @param [options] The optional parameters + * @returns Promise + */ + listAll(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listAll(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listAll(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAll(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listAllOperationSpec, + callback) as Promise; + } + + /** + * Get a list all available Operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listAllNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listAllNext(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 + */ + listAllNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAllNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listAllNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listAllOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Chaos/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listAllNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/targetTypes.ts b/sdk/chaos/arm-chaos/src/operations/targetTypes.ts new file mode 100644 index 000000000000..930361fa2adb --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/targetTypes.ts @@ -0,0 +1,192 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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/targetTypesMappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClientContext } from "../chaosManagementClientContext"; + +/** Class representing a TargetTypes. */ +export class TargetTypes { + private readonly client: ChaosManagementClientContext; + + /** + * Create a TargetTypes. + * @param {ChaosManagementClientContext} client Reference to the service client. + */ + constructor(client: ChaosManagementClientContext) { + this.client = client; + } + + /** + * Get a list of Target Type resources for given location. + * @param locationName String that represents a Location resource name. + * @param [options] The optional parameters + * @returns Promise + */ + list(locationName: string, options?: Models.TargetTypesListOptionalParams): Promise; + /** + * @param locationName String that represents a Location resource name. + * @param callback The callback + */ + list(locationName: string, callback: msRest.ServiceCallback): void; + /** + * @param locationName String that represents a Location resource name. + * @param options The optional parameters + * @param callback The callback + */ + list(locationName: string, options: Models.TargetTypesListOptionalParams, callback: msRest.ServiceCallback): void; + list(locationName: string, options?: Models.TargetTypesListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + locationName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get a Target Type resources for given location. + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param [options] The optional parameters + * @returns Promise + */ + get(locationName: string, targetTypeName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param callback The callback + */ + get(locationName: string, targetTypeName: string, callback: msRest.ServiceCallback): void; + /** + * @param locationName String that represents a Location resource name. + * @param targetTypeName String that represents a Target Type resource name. + * @param options The optional parameters + * @param callback The callback + */ + get(locationName: string, targetTypeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(locationName: string, targetTypeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + locationName, + targetTypeName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Get a list of Target Type resources for given location. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: Models.TargetTypesListNextOptionalParams): 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: Models.TargetTypesListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.TargetTypesListNextOptionalParams | 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: "subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes", + urlParameters: [ + Parameters.subscriptionId, + Parameters.locationName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TargetTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.locationName, + Parameters.targetTypeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TargetType + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TargetTypeListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/targets.ts b/sdk/chaos/arm-chaos/src/operations/targets.ts new file mode 100644 index 000000000000..2bccc8af4e71 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/targets.ts @@ -0,0 +1,376 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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/targetsMappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClientContext } from "../chaosManagementClientContext"; + +/** Class representing a Targets. */ +export class Targets { + private readonly client: ChaosManagementClientContext; + + /** + * Create a Targets. + * @param {ChaosManagementClientContext} client Reference to the service client. + */ + constructor(client: ChaosManagementClientContext) { + this.client = client; + } + + /** + * Get a list of Target resources that extend a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, options?: Models.TargetsListOptionalParams): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param callback The callback + */ + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, options: Models.TargetsListOptionalParams, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, options?: Models.TargetsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get a Target resource that extends a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param callback The callback + */ + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Delete a Target resource that extends a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Create or update a Target resource that extends a tracked regional resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param target Target resource to be created or updated. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, target: Models.Target, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param target Target resource to be created or updated. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, target: Models.Target, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName String that represents an Azure resource group. + * @param parentProviderNamespace String that represents a resource provider namespace. + * @param parentResourceType String that represents a resource type. + * @param parentResourceName String that represents a resource name. + * @param targetName String that represents a Target resource name. + * @param target Target resource to be created or updated. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, target: Models.Target, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, parentProviderNamespace: string, parentResourceType: string, parentResourceName: string, targetName: string, target: Models.Target, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + parentProviderNamespace, + parentResourceType, + parentResourceName, + targetName, + target, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Get a list of Target resources that extend a tracked regional resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: Models.TargetsListNextOptionalParams): 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: Models.TargetsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.TargetsListNextOptionalParams | 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: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TargetListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Target + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.parentProviderNamespace, + Parameters.parentResourceType, + Parameters.parentResourceName, + Parameters.targetName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "target", + mapper: { + ...Mappers.Target, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Target + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.continuationToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TargetListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/chaos/arm-chaos/tsconfig.json b/sdk/chaos/arm-chaos/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/chaos/arm-chaos/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +}