Skip to content

Commit

Permalink
[AutoPR] containerregistry/resource-manager (#4052)
Browse files Browse the repository at this point in the history
* [AutoPR containerregistry/resource-manager] [ACR] Add IP rules (#4049)

* Generated from c18a435d9031fb6130127831b39bbdb15c2b626e

Remove chart actions

* Generated from 7dae521fce44544031c25d3fcde7938dce5109c8

Add x-ms-client-name

* Generated from a29e5ac2c16d843355e84adcd2b9c5f60dd4cbed (#4066)

update ACR webhook with Helm actions

* 2.6.0

* Fix date
  • Loading branch information
AutorestCI authored and lmazuel committed Jan 3, 2019
1 parent 1717e8c commit 2c5ff40
Show file tree
Hide file tree
Showing 40 changed files with 422 additions and 57 deletions.
11 changes: 11 additions & 0 deletions azure-mgmt-containerregistry/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
Release History
===============

2.6.0 (2019-01-02)
++++++++++++++++++

**Features**

- Add IP rules

**Bugfixes**

- Rename incorrect "id" to "virtual_network_resource_id"

2.5.0 (2018-12-10)
++++++++++++++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .status_py3 import Status
from .storage_account_properties_py3 import StorageAccountProperties
from .virtual_network_rule_py3 import VirtualNetworkRule
from .ip_rule_py3 import IPRule
from .network_rule_set_py3 import NetworkRuleSet
from .registry_py3 import Registry
from .registry_update_parameters_py3 import RegistryUpdateParameters
Expand Down Expand Up @@ -64,6 +65,7 @@
from .status import Status
from .storage_account_properties import StorageAccountProperties
from .virtual_network_rule import VirtualNetworkRule
from .ip_rule import IPRule
from .network_rule_set import NetworkRuleSet
from .registry import Registry
from .registry_update_parameters import RegistryUpdateParameters
Expand Down Expand Up @@ -102,6 +104,7 @@
SkuTier,
ProvisioningState,
DefaultAction,
Action,
PasswordName,
RegistryUsageUnit,
PolicyStatus,
Expand All @@ -124,6 +127,7 @@
'Status',
'StorageAccountProperties',
'VirtualNetworkRule',
'IPRule',
'NetworkRuleSet',
'Registry',
'RegistryUpdateParameters',
Expand Down Expand Up @@ -161,6 +165,7 @@
'SkuTier',
'ProvisioningState',
'DefaultAction',
'Action',
'PasswordName',
'RegistryUsageUnit',
'PolicyStatus',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class DefaultAction(str, Enum):
deny = "Deny"


class Action(str, Enum):

allow = "Allow"


class PasswordName(str, Enum):

password = "password"
Expand Down Expand Up @@ -84,3 +89,5 @@ class WebhookAction(str, Enum):
push = "push"
delete = "delete"
quarantine = "quarantine"
chart_push = "chart_push"
chart_delete = "chart_delete"
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class IPRule(Model):
"""IP rule with specific IP or IP range in CIDR format.
All required parameters must be populated in order to send to Azure.
:param action: The action of IP ACL rule. Possible values include:
'Allow'. Default value: "Allow" .
:type action: str or
~azure.mgmt.containerregistry.v2017_10_01.models.Action
:param ip_address_or_range: Required. Specifies the IP or IP range in CIDR
format. Only IPV4 address is allowed.
:type ip_address_or_range: str
"""

_validation = {
'ip_address_or_range': {'required': True},
}

_attribute_map = {
'action': {'key': 'action', 'type': 'str'},
'ip_address_or_range': {'key': 'value', 'type': 'str'},
}

def __init__(self, **kwargs):
super(IPRule, self).__init__(**kwargs)
self.action = kwargs.get('action', "Allow")
self.ip_address_or_range = kwargs.get('ip_address_or_range', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class IPRule(Model):
"""IP rule with specific IP or IP range in CIDR format.
All required parameters must be populated in order to send to Azure.
:param action: The action of IP ACL rule. Possible values include:
'Allow'. Default value: "Allow" .
:type action: str or
~azure.mgmt.containerregistry.v2017_10_01.models.Action
:param ip_address_or_range: Required. Specifies the IP or IP range in CIDR
format. Only IPV4 address is allowed.
:type ip_address_or_range: str
"""

_validation = {
'ip_address_or_range': {'required': True},
}

_attribute_map = {
'action': {'key': 'action', 'type': 'str'},
'ip_address_or_range': {'key': 'value', 'type': 'str'},
}

def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None:
super(IPRule, self).__init__(**kwargs)
self.action = action
self.ip_address_or_range = ip_address_or_range
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class NetworkRuleSet(Model):
:param virtual_network_rules: The virtual network rules.
:type virtual_network_rules:
list[~azure.mgmt.containerregistry.v2017_10_01.models.VirtualNetworkRule]
:param ip_rules: The IP ACL rules.
:type ip_rules:
list[~azure.mgmt.containerregistry.v2017_10_01.models.IPRule]
"""

_validation = {
Expand All @@ -34,9 +37,11 @@ class NetworkRuleSet(Model):
_attribute_map = {
'default_action': {'key': 'defaultAction', 'type': 'str'},
'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'},
}

def __init__(self, **kwargs):
super(NetworkRuleSet, self).__init__(**kwargs)
self.default_action = kwargs.get('default_action', "Allow")
self.virtual_network_rules = kwargs.get('virtual_network_rules', None)
self.ip_rules = kwargs.get('ip_rules', None)
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class NetworkRuleSet(Model):
:param virtual_network_rules: The virtual network rules.
:type virtual_network_rules:
list[~azure.mgmt.containerregistry.v2017_10_01.models.VirtualNetworkRule]
:param ip_rules: The IP ACL rules.
:type ip_rules:
list[~azure.mgmt.containerregistry.v2017_10_01.models.IPRule]
"""

_validation = {
Expand All @@ -34,9 +37,11 @@ class NetworkRuleSet(Model):
_attribute_map = {
'default_action': {'key': 'defaultAction', 'type': 'str'},
'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'},
}

def __init__(self, *, default_action="Allow", virtual_network_rules=None, **kwargs) -> None:
def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None:
super(NetworkRuleSet, self).__init__(**kwargs)
self.default_action = default_action
self.virtual_network_rules = virtual_network_rules
self.ip_rules = ip_rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,30 @@


class VirtualNetworkRule(Model):
"""The virtual network rule for a container registry.
"""Virtual network rule.
All required parameters must be populated in order to send to Azure.
:param id: Required. Resource ID of a subnet, for example:
:param action: The action of virtual network rule. Possible values
include: 'Allow'. Default value: "Allow" .
:type action: str or
~azure.mgmt.containerregistry.v2017_10_01.models.Action
:param virtual_network_resource_id: Required. Resource ID of a subnet, for
example:
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
:type id: str
:type virtual_network_resource_id: str
"""

_validation = {
'id': {'required': True},
'virtual_network_resource_id': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'action': {'key': 'action', 'type': 'str'},
'virtual_network_resource_id': {'key': 'id', 'type': 'str'},
}

def __init__(self, **kwargs):
super(VirtualNetworkRule, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.action = kwargs.get('action', "Allow")
self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None)
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,30 @@


class VirtualNetworkRule(Model):
"""The virtual network rule for a container registry.
"""Virtual network rule.
All required parameters must be populated in order to send to Azure.
:param id: Required. Resource ID of a subnet, for example:
:param action: The action of virtual network rule. Possible values
include: 'Allow'. Default value: "Allow" .
:type action: str or
~azure.mgmt.containerregistry.v2017_10_01.models.Action
:param virtual_network_resource_id: Required. Resource ID of a subnet, for
example:
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
:type id: str
:type virtual_network_resource_id: str
"""

_validation = {
'id': {'required': True},
'virtual_network_resource_id': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'action': {'key': 'action', 'type': 'str'},
'virtual_network_resource_id': {'key': 'id', 'type': 'str'},
}

def __init__(self, *, id: str, **kwargs) -> None:
def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None:
super(VirtualNetworkRule, self).__init__(**kwargs)
self.id = id
self.action = action
self.virtual_network_resource_id = virtual_network_resource_id
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .status_py3 import Status
from .storage_account_properties_py3 import StorageAccountProperties
from .virtual_network_rule_py3 import VirtualNetworkRule
from .ip_rule_py3 import IPRule
from .network_rule_set_py3 import NetworkRuleSet
from .registry_py3 import Registry
from .registry_update_parameters_py3 import RegistryUpdateParameters
Expand Down Expand Up @@ -91,6 +92,7 @@
from .status import Status
from .storage_account_properties import StorageAccountProperties
from .virtual_network_rule import VirtualNetworkRule
from .ip_rule import IPRule
from .network_rule_set import NetworkRuleSet
from .registry import Registry
from .registry_update_parameters import RegistryUpdateParameters
Expand Down Expand Up @@ -160,6 +162,7 @@
SkuTier,
ProvisioningState,
DefaultAction,
Action,
PasswordName,
RegistryUsageUnit,
PolicyStatus,
Expand Down Expand Up @@ -190,6 +193,7 @@
'Status',
'StorageAccountProperties',
'VirtualNetworkRule',
'IPRule',
'NetworkRuleSet',
'Registry',
'RegistryUpdateParameters',
Expand Down Expand Up @@ -258,6 +262,7 @@
'SkuTier',
'ProvisioningState',
'DefaultAction',
'Action',
'PasswordName',
'RegistryUsageUnit',
'PolicyStatus',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class DefaultAction(str, Enum):
deny = "Deny"


class Action(str, Enum):

allow = "Allow"


class PasswordName(str, Enum):

password = "password"
Expand Down Expand Up @@ -84,6 +89,8 @@ class WebhookAction(str, Enum):
push = "push"
delete = "delete"
quarantine = "quarantine"
chart_push = "chart_push"
chart_delete = "chart_delete"


class BuildStatus(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class IPRule(Model):
"""IP rule with specific IP or IP range in CIDR format.
All required parameters must be populated in order to send to Azure.
:param action: The action of IP ACL rule. Possible values include:
'Allow'. Default value: "Allow" .
:type action: str or
~azure.mgmt.containerregistry.v2018_02_01_preview.models.Action
:param ip_address_or_range: Required. Specifies the IP or IP range in CIDR
format. Only IPV4 address is allowed.
:type ip_address_or_range: str
"""

_validation = {
'ip_address_or_range': {'required': True},
}

_attribute_map = {
'action': {'key': 'action', 'type': 'str'},
'ip_address_or_range': {'key': 'value', 'type': 'str'},
}

def __init__(self, **kwargs):
super(IPRule, self).__init__(**kwargs)
self.action = kwargs.get('action', "Allow")
self.ip_address_or_range = kwargs.get('ip_address_or_range', None)
Loading

0 comments on commit 2c5ff40

Please sign in to comment.