Skip to content

Commit

Permalink
[AutoPR] containerinstance/resource-manager (#385)
Browse files Browse the repository at this point in the history
* Generated from b28170d473471c298dc43f09299dd655d8e03982 (#374)

Update swagger with DNSConfig and GPU

* Regenerated "@azure/arm-containerinstance" SDK.

* Remove .npmignore
  • Loading branch information
AutorestCI authored and kpajdzik committed Nov 2, 2018
1 parent 0b88c7c commit 29dbe29
Show file tree
Hide file tree
Showing 8 changed files with 270 additions and 145 deletions.
35 changes: 0 additions & 35 deletions packages/@azure/arm-containerinstance/.npmignore

This file was deleted.

42 changes: 21 additions & 21 deletions packages/@azure/arm-containerinstance/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 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.
The MIT License (MIT)
Copyright (c) 2018 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.
154 changes: 77 additions & 77 deletions packages/@azure/arm-containerinstance/README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
# Azure ContainerInstanceManagementClient SDK for JavaScript
This package contains an isomorphic SDK for ContainerInstanceManagementClient.

## Currently supported environments
- Node.js version 6.x.x or higher
- Browser JavaScript

## How to Install
```
npm install @azure/arm-containerinstance
```


## How to use

### nodejs - Authentication, client creation and list containerGroups as an example written in TypeScript.

```ts
import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { ContainerInstanceManagementClient, ContainerInstanceManagementModels, ContainerInstanceManagementMappers } from "@azure/arm-containerinstance";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new ContainerInstanceManagementClient(creds, subscriptionId);
client.containerGroups.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

### browser - Authentication, client creation and list containerGroups as an example written in JavaScript.
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/arm-containerinstance sample</title>
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-containerinstance/dist/arm-containerinstance.js"></script>
<script>
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.ArmContainerinstance.ContainerInstanceManagementClient(res.creds, subscriptionId);
client.containerGroups.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log('An error occurred:');
console.error(err);
});
});
</script>
</head>
<body>
</body>
</html>
```

# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
# Azure ContainerInstanceManagementClient SDK for JavaScript
This package contains an isomorphic SDK for ContainerInstanceManagementClient.

## Currently supported environments
- Node.js version 6.x.x or higher
- Browser JavaScript

## How to Install
```
npm install @azure/arm-containerinstance
```


## How to use

### nodejs - Authentication, client creation and list containerGroups as an example written in TypeScript.

```ts
import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { ContainerInstanceManagementClient, ContainerInstanceManagementModels, ContainerInstanceManagementMappers } from "@azure/arm-containerinstance";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new ContainerInstanceManagementClient(creds, subscriptionId);
client.containerGroups.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

### browser - Authentication, client creation and list containerGroups as an example written in JavaScript.
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/arm-containerinstance sample</title>
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-containerinstance/dist/arm-containerinstance.js"></script>
<script>
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.ArmContainerinstance.ContainerInstanceManagementClient(res.creds, subscriptionId);
client.containerGroups.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
});
</script>
</head>
<body>
</body>
</html>
```

# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@ const packageName = "@azure/arm-containerinstance";
const packageVersion = "1.0.0";

export class ContainerInstanceManagementClientContext extends msRestAzure.AzureServiceClient {

credentials: msRest.ServiceClientCredentials;

subscriptionId: string;

apiVersion: string;

acceptLanguage: string;

longRunningOperationRetryTimeout: number;
apiVersion?: string;

/**
* Initializes a new instance of the ContainerInstanceManagementClient class.
Expand All @@ -45,6 +38,11 @@ export class ContainerInstanceManagementClientContext extends msRestAzure.AzureS
if (!options) {
options = {};
}
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(credentials, options);

this.apiVersion = '2018-10-01';
Expand All @@ -55,7 +53,6 @@ export class ContainerInstanceManagementClientContext extends msRestAzure.AzureS
this.credentials = credentials;
this.subscriptionId = subscriptionId;

this.addUserAgentInfo(`${packageName}/${packageVersion}`);
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export {
Event,
ResourceRequirements,
ResourceRequests,
GpuResource,
ResourceLimits,
VolumeMount,
ContainerProbe,
Expand All @@ -38,6 +39,7 @@ export {
ContainerGroupDiagnostics,
LogAnalytics,
ContainerGroupNetworkProfile,
DnsConfiguration,
CloudError
} from "../models/mappers";

69 changes: 69 additions & 0 deletions packages/@azure/arm-containerinstance/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,24 @@ export interface ContainerPropertiesInstanceView {
readonly events?: Event[];
}

/**
* @interface
* An interface representing GpuResource.
* The GPU resource.
*
*/
export interface GpuResource {
/**
* @member {number} count The count of the GPU resource.
*/
count: number;
/**
* @member {GpuSku} sku The SKU of the GPU resource. Possible values include:
* 'K80', 'P100', 'V100'
*/
sku: GpuSku;
}

/**
* @interface
* An interface representing ResourceRequests.
Expand All @@ -172,6 +190,10 @@ export interface ResourceRequests {
* @member {number} cpu The CPU request of this container instance.
*/
cpu: number;
/**
* @member {GpuResource} [gpu] The GPU request of this container instance.
*/
gpu?: GpuResource;
}

/**
Expand All @@ -190,6 +212,10 @@ export interface ResourceLimits {
* @member {number} [cpu] The CPU limit of this container instance.
*/
cpu?: number;
/**
* @member {GpuResource} [gpu] The GPU limit of this container instance.
*/
gpu?: GpuResource;
}

/**
Expand Down Expand Up @@ -657,6 +683,28 @@ export interface ContainerGroupNetworkProfile {
id: string;
}

/**
* @interface
* An interface representing DnsConfiguration.
* DNS configuration for the container group.
*
*/
export interface DnsConfiguration {
/**
* @member {string[]} nameServers The DNS servers for the container group.
*/
nameServers: string[];
/**
* @member {string} [searchDomains] The DNS search domains for hostname
* lookup in the container group.
*/
searchDomains?: string;
/**
* @member {string} [options] The DNS options for the container group.
*/
options?: string;
}

/**
* @interface
* An interface representing Resource.
Expand Down Expand Up @@ -765,6 +813,11 @@ export interface ContainerGroup extends Resource {
* profile information for a container group.
*/
networkProfile?: ContainerGroupNetworkProfile;
/**
* @member {DnsConfiguration} [dnsConfig] The DNS config information for a
* container group.
*/
dnsConfig?: DnsConfiguration;
}

/**
Expand Down Expand Up @@ -1028,6 +1081,22 @@ export enum ContainerNetworkProtocol {
UDP = 'UDP',
}

/**
* Defines values for GpuSku.
* Possible values include: 'K80', 'P100', 'V100'
* There could be more values for this enum apart from the ones defined here.If
* you want to set a value that is not from the known values then you can do
* the following:
* let param: GpuSku = <GpuSku>"someUnknownValueThatWillStillBeValid";
* @readonly
* @enum {string}
*/
export enum GpuSku {
K80 = 'K80',
P100 = 'P100',
V100 = 'V100',
}

/**
* Defines values for ResourceIdentityType.
* Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,
Expand Down
Loading

0 comments on commit 29dbe29

Please sign in to comment.