Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions lib/services/batchManagement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,43 @@ uid: azure-arm-batch
summary: *content

---
# Microsoft Azure SDK for Node.js - BatchManagementClient
**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.**
## Microsoft Azure SDK for Node.js - BatchManagementClient

This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

## Features
### Features


## How to Install
### How to Install

```bash
npm install azure-arm-batch
```

## How to use
### How to use

### Authentication, client creation and get batchAccount as an example.
#### Authentication, client creation, and get batchAccount as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const BatchManagementClient = require("azure-arm-batch");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new BatchManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const accountName = "testaccountName";
return client.batchAccount.get(resourceGroupName, accountName).then((result) => {
console.log("The result is:");
console.log(result);
});
const subscriptionId = "<Subscription_Id>";
const client = new BatchManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const accountName = "testaccountName";

return client.batchAccount.get(resourceGroupName, accountName).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.log('An error occurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects
```
### Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
2 changes: 1 addition & 1 deletion lib/services/batchManagement/lib/batchManagementClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BatchManagementClient extends ServiceClient {

super(credentials, options);

this.apiVersion = '2018-12-01';
this.apiVersion = '2018-02-02';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
Expand Down
52 changes: 20 additions & 32 deletions lib/services/batchManagement/lib/models/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,23 @@

'use strict';

const models = require('./index');

/**
* Contains information about an application in a Batch account.
*
* @extends models['ProxyResource']
*/
class Application extends models['ProxyResource'] {
class Application {
/**
* Create a Application.
* @property {string} [id] A string that uniquely identifies the application
* within the account.
* @property {string} [displayName] The display name for the application.
* @property {array} [packages] The list of packages under this application.
* @property {boolean} [allowUpdates] A value indicating whether packages
* within the application may be overwritten using the same version string.
* @property {string} [defaultVersion] The package to use if a client
* requests the application but does not specify a version. This property can
* only be set to the name of an existing package.
* requests the application but does not specify a version.
*/
constructor() {
super();
}

/**
Expand All @@ -47,53 +45,43 @@ class Application extends models['ProxyResource'] {
modelProperties: {
id: {
required: false,
readOnly: true,
serializedName: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
readOnly: true,
serializedName: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
readOnly: true,
serializedName: 'type',
type: {
name: 'String'
}
},
etag: {
displayName: {
required: false,
readOnly: true,
serializedName: 'etag',
serializedName: 'displayName',
type: {
name: 'String'
}
},
displayName: {
packages: {
required: false,
serializedName: 'properties.displayName',
serializedName: 'packages',
type: {
name: 'String'
name: 'Sequence',
element: {
required: false,
serializedName: 'ApplicationPackageElementType',
type: {
name: 'Composite',
className: 'ApplicationPackage'
}
}
}
},
allowUpdates: {
required: false,
serializedName: 'properties.allowUpdates',
serializedName: 'allowUpdates',
type: {
name: 'Boolean'
}
},
defaultVersion: {
required: false,
serializedName: 'properties.defaultVersion',
serializedName: 'defaultVersion',
type: {
name: 'String'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Parameters for adding an Application.
*
*/
class ApplicationCreateParameters {
/**
* Create a ApplicationCreateParameters.
* @property {boolean} [allowUpdates] A value indicating whether packages
* within the application may be overwritten using the same version string.
* @property {string} [displayName] The display name for the application.
*/
constructor() {
}

/**
* Defines the metadata of ApplicationCreateParameters
*
* @returns {object} metadata of ApplicationCreateParameters
*
*/
mapper() {
return {
required: false,
serializedName: 'ApplicationCreateParameters',
type: {
name: 'Composite',
className: 'ApplicationCreateParameters',
modelProperties: {
allowUpdates: {
required: false,
serializedName: 'allowUpdates',
type: {
name: 'Boolean'
}
},
displayName: {
required: false,
serializedName: 'displayName',
type: {
name: 'String'
}
}
}
}
};
}
}

module.exports = ApplicationCreateParameters;
42 changes: 12 additions & 30 deletions lib/services/batchManagement/lib/models/applicationPackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@

'use strict';

const models = require('./index');

/**
* An application package which represents a particular version of an
* application.
*
* @extends models['ProxyResource']
*/
class ApplicationPackage extends models['ProxyResource'] {
class ApplicationPackage {
/**
* Create a ApplicationPackage.
* @property {string} [id] The ID of the application.
* @property {string} [version] The version of the application package.
* @property {string} [state] The current state of the application package.
* Possible values include: 'Pending', 'Active'
* Possible values include: 'Pending', 'Active', 'Unmapped'
* @property {string} [format] The format of the application package, if the
* package is active.
* @property {string} [storageUrl] The URL for the application package in
Expand All @@ -33,7 +32,6 @@ class ApplicationPackage extends models['ProxyResource'] {
* last activated, if the package is active.
*/
constructor() {
super();
}

/**
Expand All @@ -58,67 +56,51 @@ class ApplicationPackage extends models['ProxyResource'] {
name: 'String'
}
},
name: {
required: false,
readOnly: true,
serializedName: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
readOnly: true,
serializedName: 'type',
type: {
name: 'String'
}
},
etag: {
version: {
required: false,
readOnly: true,
serializedName: 'etag',
serializedName: 'version',
type: {
name: 'String'
}
},
state: {
required: false,
readOnly: true,
serializedName: 'properties.state',
serializedName: 'state',
type: {
name: 'Enum',
allowedValues: [ 'Pending', 'Active' ]
allowedValues: [ 'Pending', 'Active', 'Unmapped' ]
}
},
format: {
required: false,
readOnly: true,
serializedName: 'properties.format',
serializedName: 'format',
type: {
name: 'String'
}
},
storageUrl: {
required: false,
readOnly: true,
serializedName: 'properties.storageUrl',
serializedName: 'storageUrl',
type: {
name: 'String'
}
},
storageUrlExpiry: {
required: false,
readOnly: true,
serializedName: 'properties.storageUrlExpiry',
serializedName: 'storageUrlExpiry',
type: {
name: 'DateTime'
}
},
lastActivationTime: {
required: false,
readOnly: true,
serializedName: 'properties.lastActivationTime',
serializedName: 'lastActivationTime',
type: {
name: 'DateTime'
}
Expand Down
Loading