diff --git a/sdk/containerregistry/arm-containerregistry/src/models/index.ts b/sdk/containerregistry/arm-containerregistry/src/models/index.ts index 5484f2ed92b8..f529e3c24f13 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/index.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/index.ts @@ -284,6 +284,69 @@ export interface NetworkRuleSet { ipRules?: IPRule[]; } +/** + * The quarantine policy for a container registry. + */ +export interface QuarantinePolicy { + /** + * The value that indicates whether the policy is enabled or not. Possible values include: + * 'enabled', 'disabled' + */ + status?: PolicyStatus; +} + +/** + * The content trust policy for a container registry. + */ +export interface TrustPolicy { + /** + * The type of trust policy. Possible values include: 'Notary' + */ + type?: TrustPolicyType; + /** + * The value that indicates whether the policy is enabled or not. Possible values include: + * 'enabled', 'disabled' + */ + status?: PolicyStatus; +} + +/** + * The retention policy for a container registry. + */ +export interface RetentionPolicy { + /** + * The number of days to retain manifest before it expires. + */ + days?: number; + /** + * The timestamp when the the policy was last updated. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastUpdatedTime?: Date; + /** + * The value that indicates whether the policy is enabled or not. + */ + status?: string; +} + +/** + * The policies for a container registry. + */ +export interface Policies { + /** + * The quarantine policy for a container registry. + */ + quarantinePolicy?: QuarantinePolicy; + /** + * The content trust policy for a container registry. + */ + trustPolicy?: TrustPolicy; + /** + * The retention policy for a container registry. + */ + retentionPolicy?: RetentionPolicy; +} + /** * An Azure resource. */ @@ -355,6 +418,10 @@ export interface Registry extends Resource { * The network rule set for a container registry. */ networkRuleSet?: NetworkRuleSet; + /** + * The policies for a container registry. + */ + policies?: Policies; } /** @@ -373,16 +440,14 @@ export interface RegistryUpdateParameters { * The value that indicates whether the admin user is enabled. */ adminUserEnabled?: boolean; - /** - * The parameters of a storage account for the container registry. Only applicable to Classic - * SKU. If specified, the storage account must be in the same physical location as the container - * registry. - */ - storageAccount?: StorageAccountProperties; /** * The network rule set for a container registry. */ networkRuleSet?: NetworkRuleSet; + /** + * The policies for a container registry. + */ + policies?: Policies; } /** @@ -456,46 +521,6 @@ export interface RegistryUsageListResult { value?: RegistryUsage[]; } -/** - * An object that represents quarantine policy for a container registry. - */ -export interface QuarantinePolicy { - /** - * The value that indicates whether the policy is enabled or not. Possible values include: - * 'enabled', 'disabled' - */ - status?: PolicyStatus; -} - -/** - * An object that represents content trust policy for a container registry. - */ -export interface TrustPolicy { - /** - * The type of trust policy. Possible values include: 'Notary' - */ - type?: TrustPolicyType; - /** - * The value that indicates whether the policy is enabled or not. Possible values include: - * 'enabled', 'disabled' - */ - status?: PolicyStatus; -} - -/** - * An object that represents policies for a container registry. - */ -export interface RegistryPolicies { - /** - * An object that represents quarantine policy for a container registry. - */ - quarantinePolicy?: QuarantinePolicy; - /** - * An object that represents content trust policy for a container registry. - */ - trustPolicy?: TrustPolicy; -} - /** * An object that represents a replication for a container registry. */ @@ -2311,36 +2336,36 @@ export type DefaultAction = 'Allow' | 'Deny'; export type Action = 'Allow'; /** - * Defines values for PasswordName. - * Possible values include: 'password', 'password2' + * Defines values for PolicyStatus. + * Possible values include: 'enabled', 'disabled' * @readonly * @enum {string} */ -export type PasswordName = 'password' | 'password2'; +export type PolicyStatus = 'enabled' | 'disabled'; /** - * Defines values for RegistryUsageUnit. - * Possible values include: 'Count', 'Bytes' + * Defines values for TrustPolicyType. + * Possible values include: 'Notary' * @readonly * @enum {string} */ -export type RegistryUsageUnit = 'Count' | 'Bytes'; +export type TrustPolicyType = 'Notary'; /** - * Defines values for PolicyStatus. - * Possible values include: 'enabled', 'disabled' + * Defines values for PasswordName. + * Possible values include: 'password', 'password2' * @readonly * @enum {string} */ -export type PolicyStatus = 'enabled' | 'disabled'; +export type PasswordName = 'password' | 'password2'; /** - * Defines values for TrustPolicyType. - * Possible values include: 'Notary' + * Defines values for RegistryUsageUnit. + * Possible values include: 'Count', 'Bytes' * @readonly * @enum {string} */ -export type TrustPolicyType = 'Notary'; +export type RegistryUsageUnit = 'Count' | 'Bytes'; /** * Defines values for WebhookStatus. @@ -2660,46 +2685,6 @@ export type RegistriesListUsagesResponse = RegistryUsageListResult & { }; }; -/** - * Contains response data for the listPolicies operation. - */ -export type RegistriesListPoliciesResponse = RegistryPolicies & { - /** - * 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: RegistryPolicies; - }; -}; - -/** - * Contains response data for the updatePolicies operation. - */ -export type RegistriesUpdatePoliciesResponse = RegistryPolicies & { - /** - * 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: RegistryPolicies; - }; -}; - /** * Contains response data for the scheduleRun operation. */ @@ -2780,26 +2765,6 @@ export type RegistriesBeginUpdateResponse = Registry & { }; }; -/** - * Contains response data for the beginUpdatePolicies operation. - */ -export type RegistriesBeginUpdatePoliciesResponse = RegistryPolicies & { - /** - * 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: RegistryPolicies; - }; -}; - /** * Contains response data for the beginScheduleRun operation. */ diff --git a/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts index c6ae62b70209..e1d42db3b5b5 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts @@ -477,6 +477,104 @@ export const NetworkRuleSet: msRest.CompositeMapper = { } }; +export const QuarantinePolicy: msRest.CompositeMapper = { + serializedName: "QuarantinePolicy", + type: { + name: "Composite", + className: "QuarantinePolicy", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const TrustPolicy: msRest.CompositeMapper = { + serializedName: "TrustPolicy", + type: { + name: "Composite", + className: "TrustPolicy", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const RetentionPolicy: msRest.CompositeMapper = { + serializedName: "RetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy", + modelProperties: { + days: { + serializedName: "days", + type: { + name: "Number" + } + }, + lastUpdatedTime: { + readOnly: true, + serializedName: "lastUpdatedTime", + type: { + name: "DateTime" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const Policies: msRest.CompositeMapper = { + serializedName: "Policies", + type: { + name: "Composite", + className: "Policies", + modelProperties: { + quarantinePolicy: { + serializedName: "quarantinePolicy", + type: { + name: "Composite", + className: "QuarantinePolicy" + } + }, + trustPolicy: { + serializedName: "trustPolicy", + type: { + name: "Composite", + className: "TrustPolicy" + } + }, + retentionPolicy: { + serializedName: "retentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" + } + } + } + } +}; + export const Resource: msRest.CompositeMapper = { serializedName: "Resource", type: { @@ -590,6 +688,13 @@ export const Registry: msRest.CompositeMapper = { name: "Composite", className: "NetworkRuleSet" } + }, + policies: { + serializedName: "properties.policies", + type: { + name: "Composite", + className: "Policies" + } } } } @@ -625,18 +730,18 @@ export const RegistryUpdateParameters: msRest.CompositeMapper = { name: "Boolean" } }, - storageAccount: { - serializedName: "properties.storageAccount", + networkRuleSet: { + serializedName: "properties.networkRuleSet", type: { name: "Composite", - className: "StorageAccountProperties" + className: "NetworkRuleSet" } }, - networkRuleSet: { - serializedName: "properties.networkRuleSet", + policies: { + serializedName: "properties.policies", type: { name: "Composite", - className: "NetworkRuleSet" + className: "Policies" } } } @@ -774,68 +879,6 @@ export const RegistryUsageListResult: msRest.CompositeMapper = { } }; -export const QuarantinePolicy: msRest.CompositeMapper = { - serializedName: "QuarantinePolicy", - type: { - name: "Composite", - className: "QuarantinePolicy", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String" - } - } - } - } -}; - -export const TrustPolicy: msRest.CompositeMapper = { - serializedName: "TrustPolicy", - type: { - name: "Composite", - className: "TrustPolicy", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String" - } - }, - status: { - serializedName: "status", - type: { - name: "String" - } - } - } - } -}; - -export const RegistryPolicies: msRest.CompositeMapper = { - serializedName: "RegistryPolicies", - type: { - name: "Composite", - className: "RegistryPolicies", - modelProperties: { - quarantinePolicy: { - serializedName: "quarantinePolicy", - type: { - name: "Composite", - className: "QuarantinePolicy" - } - }, - trustPolicy: { - serializedName: "trustPolicy", - type: { - name: "Composite", - className: "TrustPolicy" - } - } - } - } -}; - export const Replication: msRest.CompositeMapper = { serializedName: "Replication", type: { diff --git a/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts b/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts index 1774992faa36..4b40eb314cf5 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts @@ -26,7 +26,7 @@ export const apiVersion0: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: '2017-10-01', + defaultValue: '2019-05-01', type: { name: "String" } diff --git a/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts index f22b1a37f9d1..42d9960bca6f 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts @@ -32,6 +32,7 @@ export { IPRule, NetworkRuleSet, PlatformProperties, + Policies, ProxyResource, QuarantinePolicy, RegenerateCredentialParameters, @@ -41,12 +42,12 @@ export { RegistryNameCheckRequest, RegistryNameStatus, RegistryPassword, - RegistryPolicies, RegistryUpdateParameters, RegistryUsage, RegistryUsageListResult, Replication, Resource, + RetentionPolicy, Run, RunRequest, SecretObject, diff --git a/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts index 648f983bfd46..5f9855cbbe0b 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts @@ -26,12 +26,15 @@ export { IPRule, NetworkRuleSet, PlatformProperties, + Policies, ProxyResource, + QuarantinePolicy, Registry, Replication, ReplicationListResult, ReplicationUpdateParameters, Resource, + RetentionPolicy, Run, SecretObject, SetValue, @@ -46,6 +49,7 @@ export { TaskStepProperties, TimerTrigger, TriggerProperties, + TrustPolicy, UserIdentityProperties, VirtualNetworkRule, Webhook diff --git a/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts index b43e88ad70db..c972ce637f8c 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts @@ -26,10 +26,13 @@ export { IPRule, NetworkRuleSet, PlatformProperties, + Policies, ProxyResource, + QuarantinePolicy, Registry, Replication, Resource, + RetentionPolicy, Run, RunGetLogResult, RunListResult, @@ -47,6 +50,7 @@ export { TaskStepProperties, TimerTrigger, TriggerProperties, + TrustPolicy, UserIdentityProperties, VirtualNetworkRule, Webhook diff --git a/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts index 4706b4b43f44..c7b498e98d5d 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts @@ -32,10 +32,13 @@ export { NetworkRuleSet, PlatformProperties, PlatformUpdateParameters, + Policies, ProxyResource, + QuarantinePolicy, Registry, Replication, Resource, + RetentionPolicy, Run, SecretObject, SetValue, @@ -57,6 +60,7 @@ export { TimerTriggerUpdateParameters, TriggerProperties, TriggerUpdateParameters, + TrustPolicy, UserIdentityProperties, VirtualNetworkRule, Webhook diff --git a/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts index 38344b3cd1c0..a94f6fe5263b 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts @@ -34,11 +34,14 @@ export { IPRule, NetworkRuleSet, PlatformProperties, + Policies, ProxyResource, + QuarantinePolicy, Registry, Replication, Request, Resource, + RetentionPolicy, Run, SecretObject, SetValue, @@ -55,6 +58,7 @@ export { TaskStepProperties, TimerTrigger, TriggerProperties, + TrustPolicy, UserIdentityProperties, VirtualNetworkRule, Webhook, diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts b/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts index 23020287122a..2b8802dcb948 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts @@ -294,52 +294,6 @@ export class Registries { callback) as Promise; } - /** - * Lists the policies for the specified container registry. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param [options] The optional parameters - * @returns Promise - */ - listPolicies(resourceGroupName: string, registryName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param callback The callback - */ - listPolicies(resourceGroupName: string, registryName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param options The optional parameters - * @param callback The callback - */ - listPolicies(resourceGroupName: string, registryName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listPolicies(resourceGroupName: string, registryName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - registryName, - options - }, - listPoliciesOperationSpec, - callback) as Promise; - } - - /** - * Updates the policies for the specified container registry. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryPoliciesUpdateParameters The parameters for updating policies of a container - * registry. - * @param [options] The optional parameters - * @returns Promise - */ - updatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: Models.RegistryPolicies, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdatePolicies(resourceGroupName,registryName,registryPoliciesUpdateParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } - /** * Schedules a new run based on the request parameters and add it to the run queue. * @param resourceGroupName The name of the resource group to which the container registry belongs. @@ -463,27 +417,6 @@ export class Registries { options); } - /** - * Updates the policies for the specified container registry. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param registryPoliciesUpdateParameters The parameters for updating policies of a container - * registry. - * @param [options] The optional parameters - * @returns Promise - */ - beginUpdatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: Models.RegistryPolicies, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - registryName, - registryPoliciesUpdateParameters, - options - }, - beginUpdatePoliciesOperationSpec, - options); - } - /** * Schedules a new run based on the request parameters and add it to the run queue. * @param resourceGroupName The name of the resource group to which the container registry belongs. @@ -747,31 +680,6 @@ const listUsagesOperationSpec: msRest.OperationSpec = { serializer }; -const listPoliciesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.registryName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.RegistryPolicies - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - const getBuildSourceUploadUrlOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl", @@ -923,39 +831,6 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { serializer }; -const beginUpdatePoliciesOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.registryName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "registryPoliciesUpdateParameters", - mapper: { - ...Mappers.RegistryPolicies, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.RegistryPolicies - }, - 202: {}, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - const beginScheduleRunOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun",