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
42 changes: 21 additions & 21 deletions packages/@azure/arm-cdn/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.
173 changes: 77 additions & 96 deletions packages/@azure/arm-cdn/README.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,77 @@
## Azure CdnManagementClient SDK for JavaScript

This package contains an isomorphic SDK for CdnManagementClient.

### Currently supported environments

- Node.js version 6.x.x or higher
- Browser JavaScript

### How to Install

```
npm install @azure/arm-cdn
```

### How to use

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

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

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

##### Sample code

```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 { CdnManagementClient, CdnManagementModels, CdnManagementMappers } from "@azure/arm-cdn";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

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

#### browser - Authentication, client creation and list profiles as an example written in JavaScript.

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

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

##### Sample code

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-cdn 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/@azure/arm-cdn/dist/arm-cdn.js"></script>
<script type="text/javascript">
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.ArmCdn.CdnManagementClient(res.creds, subscriptionId);
client.profiles.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 CdnManagementClient SDK for JavaScript
This package contains an isomorphic SDK for CdnManagementClient.

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

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


## How to use

### nodejs - Authentication, client creation and list profiles 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 { CdnManagementClient, CdnManagementModels, CdnManagementMappers } from "@azure/arm-cdn";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

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

### browser - Authentication, client creation and list profiles 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-cdn 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-cdn/dist/arm-cdn.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.ArmCdn.CdnManagementClient(res.creds, subscriptionId);
client.profiles.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)
2 changes: 1 addition & 1 deletion packages/@azure/arm-cdn/lib/cdnManagementClient.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 Parameters from "./models/parameters";
Expand Down
6 changes: 3 additions & 3 deletions packages/@azure/arm-cdn/lib/cdnManagementClientContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*/

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-cdn";
const packageVersion = "0.1.0";
const packageVersion = "0.2.0";

export class CdnManagementClientContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
Expand Down
28 changes: 14 additions & 14 deletions packages/@azure/arm-cdn/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 @@ -201,7 +201,7 @@ export interface Endpoint extends TrackedResource {
originHostHeader?: string;
/**
* @member {string} [originPath] A directory path on the origin that CDN can
* use to retreive content from, e.g. contoso.cloudapp.net/originpath.
* use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
*/
originPath?: string;
/**
Expand Down Expand Up @@ -255,7 +255,7 @@ export interface Endpoint extends TrackedResource {
probePath?: string;
/**
* @member {GeoFilter[]} [geoFilters] List of rules defining the user's geo
* access within a CDN endpoint. Each geo filter defines an acess rule to a
* access within a CDN endpoint. Each geo filter defines an access rule to a
* specified path or content, e.g. block APAC for path /pictures/
*/
geoFilters?: GeoFilter[];
Expand All @@ -267,7 +267,7 @@ export interface Endpoint extends TrackedResource {
deliveryPolicy?: EndpointPropertiesUpdateParametersDeliveryPolicy;
/**
* @member {string} [hostName] The host name of the endpoint structured as
* {endpointName}.{DNSZone}, e.g. consoto.azureedge.net
* {endpointName}.{DNSZone}, e.g. contoso.azureedge.net
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
Expand Down Expand Up @@ -419,7 +419,7 @@ export interface EndpointUpdateParameters extends BaseResource {
originHostHeader?: string;
/**
* @member {string} [originPath] A directory path on the origin that CDN can
* use to retreive content from, e.g. contoso.cloudapp.net/originpath.
* use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
*/
originPath?: string;
/**
Expand Down Expand Up @@ -473,7 +473,7 @@ export interface EndpointUpdateParameters extends BaseResource {
probePath?: string;
/**
* @member {GeoFilter[]} [geoFilters] List of rules defining the user's geo
* access within a CDN endpoint. Each geo filter defines an acess rule to a
* access within a CDN endpoint. Each geo filter defines an access rule to a
* specified path or content, e.g. block APAC for path /pictures/
*/
geoFilters?: GeoFilter[];
Expand Down Expand Up @@ -567,8 +567,8 @@ export interface CacheExpirationActionParameters {
*/
cacheBehavior: CacheBehavior;
/**
* @member {string} [cacheDuration] The duration for which the the content
* needs to be cached. Allowed format is [d.]hh:mm:ss
* @member {string} [cacheDuration] The duration for which the content needs
* to be cached. Allowed format is [d.]hh:mm:ss
*/
cacheDuration?: string;
}
Expand Down Expand Up @@ -699,7 +699,7 @@ export interface ProxyResource extends Resource {
* @interface
* An interface representing CustomDomain.
* Friendly domain name mapping to the endpoint hostname that the customer
* provides for branding purposes, e.g. www.consoto.com.
* provides for branding purposes, e.g. www.contoso.com.
*
* @extends ProxyResource
*/
Expand Down Expand Up @@ -987,7 +987,7 @@ export interface Operation {
*/
export interface CidrIpAddress {
/**
* @member {string} [baseIpAddress] Ip adress itself.
* @member {string} [baseIpAddress] Ip address itself.
*/
baseIpAddress?: string;
/**
Expand Down Expand Up @@ -1037,7 +1037,7 @@ export interface EdgeNode extends ProxyResource {
/**
* @interface
* An interface representing ErrorResponse.
* Error reponse indicates CDN service is not able to process the incoming
* Error response indicates CDN service is not able to process the incoming
* request. The reason is provided in the error message.
*
*/
Expand Down Expand Up @@ -1102,7 +1102,7 @@ export interface CdnManagementClientOptions extends AzureServiceClientOptions {
* @interface
* An interface representing the ProfileListResult.
* Result of the request to list profiles. It contains a list of profile
* objects and a URL link to get the the next set of results.
* objects and a URL link to get the next set of results.
*
* @extends Array<Profile>
*/
Expand Down Expand Up @@ -1133,7 +1133,7 @@ export interface ResourceUsageListResult extends Array<ResourceUsage> {
* @interface
* An interface representing the EndpointListResult.
* Result of the request to list endpoints. It contains a list of endpoint
* objects and a URL link to get the the next set of results.
* objects and a URL link to get the next set of results.
*
* @extends Array<Endpoint>
*/
Expand Down
14 changes: 12 additions & 2 deletions packages/@azure/arm-cdn/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* regenerated.
*/

import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js";
import * as msRest from "@azure/ms-rest-js";
import { CloudErrorMapper, BaseResourceMapper } from "ms-rest-azure-js";
import * as msRest from "ms-rest-js";

export const CloudError = CloudErrorMapper;
export const BaseResource = BaseResourceMapper;
Expand Down Expand Up @@ -461,6 +461,11 @@ export const DeliveryRule: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
polymorphicDiscriminator: {
serializedName: "name",
clientName: "name"
},
uberParent: "DeliveryRuleAction",
className: "DeliveryRuleAction"
}
}
Expand All @@ -473,6 +478,11 @@ export const DeliveryRule: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
polymorphicDiscriminator: {
serializedName: "name",
clientName: "name"
},
uberParent: "DeliveryRuleCondition",
className: "DeliveryRuleCondition"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@azure/arm-cdn/lib/models/parameters.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";

export const acceptLanguage: msRest.OperationParameter = {
parameterPath: "acceptLanguage",
Expand Down
Loading