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-containerregistry/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
## Azure ContainerRegistryManagementClient SDK for JavaScript

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

### 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-containerregistry
```

### How to use

#### nodejs - Authentication, client creation and get registries 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 get registries 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 { ContainerRegistryManagementClient, ContainerRegistryManagementModels, ContainerRegistryManagementMappers } from "@azure/arm-containerregistry";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

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

#### browser - Authentication, client creation and get registries as an example written in JavaScript.

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

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

##### Sample code

### browser - Authentication, client creation and get registries 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 @@ -63,11 +44,11 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
<html lang="en">
<head>
<title>@azure/arm-containerregistry 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-containerregistry/dist/arm-containerregistry.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 @@ -91,10 +72,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)
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
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-containerregistry";
const packageVersion = "0.1.0";
Expand Down
68 changes: 60 additions & 8 deletions packages/@azure/arm-containerregistry/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 @@ -296,6 +296,40 @@ export interface StorageAccountProperties {
id: string;
}

/**
* @interface
* An interface representing VirtualNetworkRule.
* The virtual network rule for a container registry.
*
*/
export interface VirtualNetworkRule {
/**
* @member {string} id Resource ID of a subnet, for example:
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
*/
id: string;
}

/**
* @interface
* An interface representing NetworkRuleSet.
* The network rule set for a container registry.
*
*/
export interface NetworkRuleSet {
/**
* @member {DefaultAction} defaultAction The default action of allow or deny
* when no other rules match. Possible values include: 'Allow', 'Deny'.
* Default value: 'Allow' .
*/
defaultAction: DefaultAction;
/**
* @member {VirtualNetworkRule[]} [virtualNetworkRules] The virtual network
* rules.
*/
virtualNetworkRules?: VirtualNetworkRule[];
}

/**
* @interface
* An interface representing Resource.
Expand Down Expand Up @@ -387,6 +421,11 @@ export interface Registry extends Resource {
* SKU.
*/
storageAccount?: StorageAccountProperties;
/**
* @member {NetworkRuleSet} [networkRuleSet] The network rule set for a
* container registry.
*/
networkRuleSet?: NetworkRuleSet;
}

/**
Expand Down Expand Up @@ -417,6 +456,11 @@ export interface RegistryUpdateParameters {
* location as the container registry.
*/
storageAccount?: StorageAccountProperties;
/**
* @member {NetworkRuleSet} [networkRuleSet] The network rule set for a
* container registry.
*/
networkRuleSet?: NetworkRuleSet;
}

/**
Expand Down Expand Up @@ -1451,7 +1495,7 @@ export interface SourceProperties {
*/
sourceControlType: SourceControlType;
/**
* @member {string} repositoryUrl The full URL to the source code respository
* @member {string} repositoryUrl The full URL to the source code repository
*/
repositoryUrl: string;
/**
Expand Down Expand Up @@ -1541,7 +1585,7 @@ export interface TriggerProperties {
* @interface
* An interface representing Task.
* The task that has the ARM resource and task properties.
* The task will have all information to schedule a run against it.
* The task will have all information to schedule a run against it.
*
* @extends Resource
*/
Expand Down Expand Up @@ -1688,7 +1732,7 @@ export interface SourceUpdateParameters {
sourceControlType?: SourceControlType;
/**
* @member {string} [repositoryUrl] The full URL to the source code
* respository
* repository
*/
repositoryUrl?: string;
/**
Expand Down Expand Up @@ -1898,7 +1942,7 @@ export interface DockerBuildRequest {
agentConfiguration?: AgentProperties;
/**
* @member {string} [sourceLocation] The URL(absolute or relative) of the
* source context. It can be an URL to a tar or git repoistory.
* source context. It can be an URL to a tar or git repository.
* If it is relative URL, the relative path should be obtained from calling
* listBuildSourceUploadUrl API.
*/
Expand Down Expand Up @@ -1974,7 +2018,7 @@ export interface FileTaskRunRequest {
agentConfiguration?: AgentProperties;
/**
* @member {string} [sourceLocation] The URL(absolute or relative) of the
* source context. It can be an URL to a tar or git repoistory.
* source context. It can be an URL to a tar or git repository.
* If it is relative URL, the relative path should be obtained from calling
* listBuildSourceUploadUrl API.
*/
Expand Down Expand Up @@ -2056,7 +2100,7 @@ export interface EncodedTaskRunRequest {
agentConfiguration?: AgentProperties;
/**
* @member {string} [sourceLocation] The URL(absolute or relative) of the
* source context. It can be an URL to a tar or git repoistory.
* source context. It can be an URL to a tar or git repository.
* If it is relative URL, the relative path should be obtained from calling
* listBuildSourceUploadUrl API.
*/
Expand Down Expand Up @@ -2504,6 +2548,14 @@ export type SkuTier = 'Classic' | 'Basic' | 'Standard' | 'Premium';
*/
export type ProvisioningState = 'Creating' | 'Updating' | 'Deleting' | 'Succeeded' | 'Failed' | 'Canceled';

/**
* Defines values for DefaultAction.
* Possible values include: 'Allow', 'Deny'
* @readonly
* @enum {string}
*/
export type DefaultAction = 'Allow' | 'Deny';

/**
* Defines values for PasswordName.
* Possible values include: 'password', 'password2'
Expand Down
75 changes: 73 additions & 2 deletions packages/@azure/arm-containerregistry/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 @@ -389,6 +389,53 @@ export const StorageAccountProperties: msRest.CompositeMapper = {
}
};

export const VirtualNetworkRule: msRest.CompositeMapper = {
serializedName: "VirtualNetworkRule",
type: {
name: "Composite",
className: "VirtualNetworkRule",
modelProperties: {
id: {
required: true,
serializedName: "id",
type: {
name: "String"
}
}
}
}
};

export const NetworkRuleSet: msRest.CompositeMapper = {
serializedName: "NetworkRuleSet",
type: {
name: "Composite",
className: "NetworkRuleSet",
modelProperties: {
defaultAction: {
required: true,
serializedName: "defaultAction",
defaultValue: 'Allow',
type: {
name: "String"
}
},
virtualNetworkRules: {
serializedName: "virtualNetworkRules",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "VirtualNetworkRule"
}
}
}
}
}
}
};

export const Resource: msRest.CompositeMapper = {
serializedName: "Resource",
type: {
Expand Down Expand Up @@ -495,6 +542,13 @@ export const Registry: msRest.CompositeMapper = {
name: "Composite",
className: "StorageAccountProperties"
}
},
networkRuleSet: {
serializedName: "properties.networkRuleSet",
type: {
name: "Composite",
className: "NetworkRuleSet"
}
}
}
}
Expand Down Expand Up @@ -536,6 +590,13 @@ export const RegistryUpdateParameters: msRest.CompositeMapper = {
name: "Composite",
className: "StorageAccountProperties"
}
},
networkRuleSet: {
serializedName: "properties.networkRuleSet",
type: {
name: "Composite",
className: "NetworkRuleSet"
}
}
}
}
Expand Down Expand Up @@ -2075,6 +2136,11 @@ export const Task: msRest.CompositeMapper = {
serializedName: "properties.step",
type: {
name: "Composite",
polymorphicDiscriminator: {
serializedName: "type",
clientName: "type"
},
uberParent: "TaskStepProperties",
className: "TaskStepProperties"
}
},
Expand Down Expand Up @@ -2361,6 +2427,11 @@ export const TaskUpdateParameters: msRest.CompositeMapper = {
serializedName: "properties.step",
type: {
name: "Composite",
polymorphicDiscriminator: {
serializedName: "type",
clientName: "type"
},
uberParent: "TaskStepUpdateParameters",
className: "TaskStepUpdateParameters"
}
},
Expand Down
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 Expand Up @@ -102,6 +102,9 @@ export const resourceGroupName: msRest.OperationURLParameter = {
mapper: {
required: true,
serializedName: "resourceGroupName",
constraints: {
MinLength: 1
},
type: {
name: "String"
}
Expand Down
Loading