Skip to content

Commit e500420

Browse files
committed
generated @azure/arm-compute-profile-2019-03-01-hybrid
1 parent 85a54a5 commit e500420

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+23506
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 Microsoft
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
## Azure ComputeManagementClient SDK for JavaScript
2+
3+
This package contains an isomorphic SDK for ComputeManagementClient.
4+
5+
### Currently supported environments
6+
7+
- Node.js version 6.x.x or higher
8+
- Browser JavaScript
9+
10+
### How to Install
11+
12+
```bash
13+
npm install @azure/arm-compute-profile-2019-03-01-hybrid
14+
```
15+
16+
### How to use
17+
18+
#### nodejs - Authentication, client creation and list operations as an example written in TypeScript.
19+
20+
##### Install @azure/ms-rest-nodeauth
21+
22+
```bash
23+
npm install @azure/ms-rest-nodeauth
24+
```
25+
26+
##### Sample code
27+
28+
```typescript
29+
import * as msRest from "@azure/ms-rest-js";
30+
import * as msRestAzure from "@azure/ms-rest-azure-js";
31+
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
32+
import { ComputeManagementClient, ComputeManagementModels, ComputeManagementMappers } from "@azure/arm-compute-profile-2019-03-01-hybrid";
33+
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
34+
35+
msRestNodeAuth.interactiveLogin().then((creds) => {
36+
const client = new ComputeManagementClient(creds, subscriptionId);
37+
client.operations.list().then((result) => {
38+
console.log("The result is:");
39+
console.log(result);
40+
});
41+
}).catch((err) => {
42+
console.error(err);
43+
});
44+
```
45+
46+
#### browser - Authentication, client creation and list operations as an example written in JavaScript.
47+
48+
##### Install @azure/ms-rest-browserauth
49+
50+
```bash
51+
npm install @azure/ms-rest-browserauth
52+
```
53+
54+
##### Sample code
55+
56+
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
57+
58+
- index.html
59+
```html
60+
<!DOCTYPE html>
61+
<html lang="en">
62+
<head>
63+
<title>@azure/arm-compute-profile-2019-03-01-hybrid sample</title>
64+
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
65+
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
66+
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
67+
<script src="node_modules/@azure/arm-compute-profile-2019-03-01-hybrid/dist/arm-compute-profile-2019-03-01-hybrid.js"></script>
68+
<script type="text/javascript">
69+
const subscriptionId = "<Subscription_Id>";
70+
const authManager = new msAuth.AuthManager({
71+
clientId: "<client id for your Azure AD app>",
72+
tenant: "<optional tenant for your organization>"
73+
});
74+
authManager.finalizeLogin().then((res) => {
75+
if (!res.isLoggedIn) {
76+
// may cause redirects
77+
authManager.login();
78+
}
79+
const client = new Azure.ArmComputeProfile20190301Hybrid.ComputeManagementClient(res.creds, subscriptionId);
80+
client.operations.list().then((result) => {
81+
console.log("The result is:");
82+
console.log(result);
83+
}).catch((err) => {
84+
console.log("An error occurred:");
85+
console.error(err);
86+
});
87+
});
88+
</script>
89+
</head>
90+
<body></body>
91+
</html>
92+
```
93+
94+
## Related projects
95+
96+
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "@azure/arm-compute-profile-2019-03-01-hybrid",
3+
"author": "Microsoft Corporation",
4+
"description": "ComputeManagementClient Library with typescript type definitions for node.js and browser.",
5+
"version": "1.0.0",
6+
"dependencies": {
7+
"@azure/ms-rest-azure-js": "^1.3.2",
8+
"@azure/ms-rest-js": "^1.8.1",
9+
"tslib": "^1.9.3"
10+
},
11+
"keywords": [
12+
"node",
13+
"azure",
14+
"typescript",
15+
"browser",
16+
"isomorphic",
17+
"profile-2019-03-01-hybrid"
18+
],
19+
"license": "MIT",
20+
"main": "./dist/arm-compute-profile-2019-03-01-hybrid.js",
21+
"module": "./esm/computeManagementClient.js",
22+
"types": "./esm/computeManagementClient.d.ts",
23+
"devDependencies": {
24+
"typescript": "^3.1.1",
25+
"rollup": "^0.66.2",
26+
"rollup-plugin-node-resolve": "^3.4.0",
27+
"rollup-plugin-sourcemaps": "^0.4.2",
28+
"uglify-js": "^3.4.9"
29+
},
30+
"homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/compute/arm-compute-profile-2019-03-01-hybrid",
31+
"repository": {
32+
"type": "git",
33+
"url": "https://github.com/azure/azure-sdk-for-js.git"
34+
},
35+
"bugs": {
36+
"url": "https://github.com/azure/azure-sdk-for-js/issues"
37+
},
38+
"files": [
39+
"dist/**/*.js",
40+
"dist/**/*.js.map",
41+
"dist/**/*.d.ts",
42+
"dist/**/*.d.ts.map",
43+
"esm/**/*.js",
44+
"esm/**/*.js.map",
45+
"esm/**/*.d.ts",
46+
"esm/**/*.d.ts.map",
47+
"src/**/*.ts",
48+
"README.md",
49+
"rollup.config.js",
50+
"tsconfig.json"
51+
],
52+
"scripts": {
53+
"build": "tsc && rollup -c rollup.config.js && npm run minify",
54+
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-compute-profile-2019-03-01-hybrid.js.map'\" -o ./dist/arm-compute-profile-2019-03-01-hybrid.min.js ./dist/arm-compute-profile-2019-03-01-hybrid.js",
55+
"prepack": "npm install && npm run build"
56+
},
57+
"sideEffects": false,
58+
"autoPublish": true
59+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import rollup from "rollup";
2+
import nodeResolve from "rollup-plugin-node-resolve";
3+
import sourcemaps from "rollup-plugin-sourcemaps";
4+
5+
/**
6+
* @type {rollup.RollupFileOptions}
7+
*/
8+
const config = {
9+
input: "./esm/computeManagementClient.js",
10+
external: [
11+
"@azure/ms-rest-js",
12+
"@azure/ms-rest-azure-js"
13+
],
14+
output: {
15+
file: "./dist/arm-compute-profile-2019-03-01-hybrid.js",
16+
format: "umd",
17+
name: "Azure.ArmComputeProfile20190301Hybrid",
18+
sourcemap: true,
19+
globals: {
20+
"@azure/ms-rest-js": "msRest",
21+
"@azure/ms-rest-azure-js": "msRestAzure"
22+
},
23+
banner: `/*
24+
* Copyright (c) Microsoft Corporation. All rights reserved.
25+
* Licensed under the MIT License. See License.txt in the project root for license information.
26+
*
27+
* Code generated by Microsoft (R) AutoRest Code Generator.
28+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
29+
*/`
30+
},
31+
plugins: [
32+
nodeResolve({ module: true }),
33+
sourcemaps()
34+
]
35+
};
36+
37+
export default config;
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for
4+
* license information.
5+
*
6+
* Code generated by Microsoft (R) AutoRest Code Generator.
7+
* Changes may cause incorrect behavior and will be lost if the code is
8+
* regenerated.
9+
*/
10+
11+
import * as msRest from "@azure/ms-rest-js";
12+
import * as Models from "./models";
13+
import * as Mappers from "./models/mappers";
14+
import * as operations from "./operations";
15+
import { ComputeManagementClientContext } from "./computeManagementClientContext";
16+
17+
18+
class ComputeManagementClient extends ComputeManagementClientContext {
19+
// Operation groups
20+
operations: operations.Operations;
21+
availabilitySets: operations.AvailabilitySets;
22+
virtualMachineExtensionImages: operations.VirtualMachineExtensionImages;
23+
virtualMachineExtensions: operations.VirtualMachineExtensions;
24+
virtualMachines: operations.VirtualMachines;
25+
virtualMachineImages: operations.VirtualMachineImages;
26+
usage: operations.UsageOperations;
27+
virtualMachineSizes: operations.VirtualMachineSizes;
28+
images: operations.Images;
29+
virtualMachineScaleSets: operations.VirtualMachineScaleSets;
30+
virtualMachineScaleSetExtensions: operations.VirtualMachineScaleSetExtensions;
31+
virtualMachineScaleSetRollingUpgrades: operations.VirtualMachineScaleSetRollingUpgrades;
32+
virtualMachineScaleSetVMs: operations.VirtualMachineScaleSetVMs;
33+
logAnalytics: operations.LogAnalytics;
34+
disks: operations.Disks;
35+
snapshots: operations.Snapshots;
36+
37+
/**
38+
* Initializes a new instance of the ComputeManagementClient class.
39+
* @param credentials Credentials needed for the client to connect to Azure.
40+
* @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure
41+
* subscription. The subscription ID forms part of the URI for every service call.
42+
* @param [options] The parameter options
43+
*/
44+
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ComputeManagementClientOptions) {
45+
super(credentials, subscriptionId, options);
46+
this.operations = new operations.Operations(this);
47+
this.availabilitySets = new operations.AvailabilitySets(this);
48+
this.virtualMachineExtensionImages = new operations.VirtualMachineExtensionImages(this);
49+
this.virtualMachineExtensions = new operations.VirtualMachineExtensions(this);
50+
this.virtualMachines = new operations.VirtualMachines(this);
51+
this.virtualMachineImages = new operations.VirtualMachineImages(this);
52+
this.usage = new operations.UsageOperations(this);
53+
this.virtualMachineSizes = new operations.VirtualMachineSizes(this);
54+
this.images = new operations.Images(this);
55+
this.virtualMachineScaleSets = new operations.VirtualMachineScaleSets(this);
56+
this.virtualMachineScaleSetExtensions = new operations.VirtualMachineScaleSetExtensions(this);
57+
this.virtualMachineScaleSetRollingUpgrades = new operations.VirtualMachineScaleSetRollingUpgrades(this);
58+
this.virtualMachineScaleSetVMs = new operations.VirtualMachineScaleSetVMs(this);
59+
this.logAnalytics = new operations.LogAnalytics(this);
60+
this.disks = new operations.Disks(this);
61+
this.snapshots = new operations.Snapshots(this);
62+
}
63+
}
64+
65+
// Operation Specifications
66+
67+
export {
68+
ComputeManagementClient,
69+
ComputeManagementClientContext,
70+
Models as ComputeManagementModels,
71+
Mappers as ComputeManagementMappers
72+
};
73+
export * from "./operations";
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for
4+
* license information.
5+
*
6+
* Code generated by Microsoft (R) AutoRest Code Generator.
7+
* Changes may cause incorrect behavior and will be lost if the code is
8+
* regenerated.
9+
*/
10+
11+
import * as Models from "./models";
12+
import * as msRest from "@azure/ms-rest-js";
13+
import * as msRestAzure from "@azure/ms-rest-azure-js";
14+
15+
const packageName = "@azure/arm-compute-profile-2019-03-01-hybrid";
16+
const packageVersion = "1.0.0";
17+
18+
export class ComputeManagementClientContext extends msRestAzure.AzureServiceClient {
19+
credentials: msRest.ServiceClientCredentials;
20+
subscriptionId: string;
21+
22+
/**
23+
* Initializes a new instance of the ComputeManagementClient class.
24+
* @param credentials Credentials needed for the client to connect to Azure.
25+
* @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure
26+
* subscription. The subscription ID forms part of the URI for every service call.
27+
* @param [options] The parameter options
28+
*/
29+
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ComputeManagementClientOptions) {
30+
if (credentials == undefined) {
31+
throw new Error('\'credentials\' cannot be null.');
32+
}
33+
if (subscriptionId == undefined) {
34+
throw new Error('\'subscriptionId\' cannot be null.');
35+
}
36+
37+
if (!options) {
38+
options = {};
39+
}
40+
if(!options.userAgent) {
41+
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
42+
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
43+
}
44+
45+
super(credentials, options);
46+
47+
this.acceptLanguage = 'en-US';
48+
this.longRunningOperationRetryTimeout = 30;
49+
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
50+
this.requestContentType = "application/json; charset=utf-8";
51+
this.credentials = credentials;
52+
this.subscriptionId = subscriptionId;
53+
54+
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
55+
this.acceptLanguage = options.acceptLanguage;
56+
}
57+
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
58+
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)