Skip to content
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
53 changes: 17 additions & 36 deletions packages/@azure/arm-apimanagement/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
## Azure ApiManagementClient SDK for JavaScript

# Azure ApiManagementClient SDK for JavaScript
This package contains an isomorphic SDK for ApiManagementClient.

### Currently supported environments

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

### How to Install

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

### How to use

#### nodejs - Authentication, client creation and listByService policy as an example written in TypeScript.

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

```
npm install @azure/ms-rest-nodeauth
```
## How to use

##### Sample code
### nodejs - Authentication, client creation and listByService policy as an example written in TypeScript.

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

Expand All @@ -46,16 +36,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
});
```

#### browser - Authentication, client creation and listByService policy as an example written in JavaScript.

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

```
npm install @azure/ms-rest-browserauth
```

##### Sample code

### browser - Authentication, client creation and listByService policy 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
Expand All @@ -64,11 +45,11 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
<html lang="en">
<head>
<title>@azure/arm-apimanagement sample</title>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<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-apimanagement/dist/arm-apimanagement.js"></script>
<script type="text/javascript">
<script>
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
Expand All @@ -93,10 +74,10 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
});
</script>
</head>
<body></body>
<body>
</body>
</html>
```

## Related projects

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
4 changes: 3 additions & 1 deletion packages/@azure/arm-apimanagement/lib/apiManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as operations from "./operations";
Expand Down Expand Up @@ -37,6 +37,7 @@ class ApiManagementClient extends ApiManagementClientContext {
backend: operations.Backend;
certificate: operations.Certificate;
apiManagementOperations: operations.ApiManagementOperations;
apiManagementServiceSkus: operations.ApiManagementServiceSkus;
apiManagementService: operations.ApiManagementService;
diagnostic: operations.Diagnostic;
diagnosticLogger: operations.DiagnosticLogger;
Expand Down Expand Up @@ -106,6 +107,7 @@ class ApiManagementClient extends ApiManagementClientContext {
this.backend = new operations.Backend(this);
this.certificate = new operations.Certificate(this);
this.apiManagementOperations = new operations.ApiManagementOperations(this);
this.apiManagementServiceSkus = new operations.ApiManagementServiceSkus(this);
this.apiManagementService = new operations.ApiManagementService(this);
this.diagnostic = new operations.Diagnostic(this);
this.diagnosticLogger = new operations.DiagnosticLogger(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/

import * as Models from "./models";
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";

const packageName = "@azure/arm-apimanagement";
const packageVersion = "0.1.0";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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.
*/

export {
ResourceSkuResults,
ResourceSkuResult,
ResourceSku,
ResourceSkuCapacity,
CloudError
} from "../models/mappers";

154 changes: 146 additions & 8 deletions packages/@azure/arm-apimanagement/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* regenerated.
*/

import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js";
import * as msRest from "@azure/ms-rest-js";
import { BaseResource, CloudError, AzureServiceClientOptions } from "ms-rest-azure-js";
import * as msRest from "ms-rest-js";

export { BaseResource, CloudError };

Expand Down Expand Up @@ -2256,6 +2256,83 @@ export interface CertificateCreateOrUpdateParameters {
password: string;
}

/**
* @interface
* An interface representing ResourceSku.
* Describes an available API Management SKU.
*
*/
export interface ResourceSku {
/**
* @member {SkuType} [name] Name of the Sku. Possible values include:
* 'Developer', 'Standard', 'Premium', 'Basic'
*/
name?: SkuType;
}

/**
* @interface
* An interface representing ResourceSkuCapacity.
* Describes scaling information of a SKU.
*
*/
export interface ResourceSkuCapacity {
/**
* @member {number} [minimum] The minimum capacity.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly minimum?: number;
/**
* @member {number} [maximum] The maximum capacity that can be set.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly maximum?: number;
/**
* @member {number} [default] The default capacity.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly default?: number;
/**
* @member {ResourceSkuCapacityScaleType} [scaleType] The scale type
* applicable to the sku. Possible values include: 'Automatic', 'Manual',
* 'None'
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly scaleType?: ResourceSkuCapacityScaleType;
}

/**
* @interface
* An interface representing ResourceSkuResult.
* Describes an available API Management service SKU.
*
*/
export interface ResourceSkuResult {
/**
* @member {string} [resourceType] The type of resource the SKU applies to.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly resourceType?: string;
/**
* @member {ResourceSku} [sku] Specifies API Management SKU.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly sku?: ResourceSku;
/**
* @member {ResourceSkuCapacity} [capacity] Specifies the number of API
* Management units.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly capacity?: ResourceSkuCapacity;
}

/**
* @interface
* An interface representing CertificateInformation.
Expand Down Expand Up @@ -8498,6 +8575,21 @@ export interface OperationListResult extends Array<Operation> {
nextLink?: string;
}

/**
* @interface
* An interface representing the ResourceSkuResults.
* The API Management service SKUs operation response.
*
* @extends Array<ResourceSkuResult>
*/
export interface ResourceSkuResults extends Array<ResourceSkuResult> {
/**
* @member {string} [nextLink] The uri to fetch the next page of API
* Management service Skus.
*/
nextLink?: string;
}

/**
* @interface
* An interface representing the ApiManagementServiceListResult.
Expand Down Expand Up @@ -8832,20 +8924,28 @@ export type BearerTokenSendingMethod = 'authorizationHeader' | 'query';
export type BackendProtocol = 'http' | 'soap';

/**
* Defines values for HostnameType.
* Possible values include: 'Proxy', 'Portal', 'Management', 'Scm'
* Defines values for SkuType.
* Possible values include: 'Developer', 'Standard', 'Premium', 'Basic'
* @readonly
* @enum {string}
*/
export type HostnameType = 'Proxy' | 'Portal' | 'Management' | 'Scm';
export type SkuType = 'Developer' | 'Standard' | 'Premium' | 'Basic';

/**
* Defines values for SkuType.
* Possible values include: 'Developer', 'Standard', 'Premium', 'Basic'
* Defines values for ResourceSkuCapacityScaleType.
* Possible values include: 'Automatic', 'Manual', 'None'
* @readonly
* @enum {string}
*/
export type SkuType = 'Developer' | 'Standard' | 'Premium' | 'Basic';
export type ResourceSkuCapacityScaleType = 'Automatic' | 'Manual' | 'None';

/**
* Defines values for HostnameType.
* Possible values include: 'Proxy', 'Portal', 'Management', 'Scm'
* @readonly
* @enum {string}
*/
export type HostnameType = 'Proxy' | 'Portal' | 'Management' | 'Scm';

/**
* Defines values for VirtualNetworkType.
Expand Down Expand Up @@ -10543,6 +10643,44 @@ export type ApiManagementOperationsListNextResponse = OperationListResult & {
};
};

/**
* Contains response data for the listAvailableServiceSkus operation.
*/
export type ApiManagementServiceSkusListAvailableServiceSkusResponse = ResourceSkuResults & {
/**
* 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: ResourceSkuResults;
};
};

/**
* Contains response data for the listAvailableServiceSkusNext operation.
*/
export type ApiManagementServiceSkusListAvailableServiceSkusNextResponse = ResourceSkuResults & {
/**
* 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: ResourceSkuResults;
};
};

/**
* Contains response data for the restore operation.
*/
Expand Down
Loading