@@ -39,97 +39,6 @@ def __init__(self, client, config, serializer, deserializer):
39
39
40
40
self .config = config
41
41
42
-
43
- def _import_image_initial (
44
- self , resource_group_name , registry_name , parameters , custom_headers = None , raw = False , ** operation_config ):
45
- # Construct URL
46
- url = self .import_image .metadata ['url' ]
47
- path_format_arguments = {
48
- 'subscriptionId' : self ._serialize .url ("self.config.subscription_id" , self .config .subscription_id , 'str' ),
49
- 'resourceGroupName' : self ._serialize .url ("resource_group_name" , resource_group_name , 'str' ),
50
- 'registryName' : self ._serialize .url ("registry_name" , registry_name , 'str' , max_length = 50 , min_length = 5 , pattern = r'^[a-zA-Z0-9]*$' )
51
- }
52
- url = self ._client .format_url (url , ** path_format_arguments )
53
-
54
- # Construct parameters
55
- query_parameters = {}
56
- query_parameters ['api-version' ] = self ._serialize .query ("self.api_version" , self .api_version , 'str' )
57
-
58
- # Construct headers
59
- header_parameters = {}
60
- header_parameters ['Content-Type' ] = 'application/json; charset=utf-8'
61
- if self .config .generate_client_request_id :
62
- header_parameters ['x-ms-client-request-id' ] = str (uuid .uuid1 ())
63
- if custom_headers :
64
- header_parameters .update (custom_headers )
65
- if self .config .accept_language is not None :
66
- header_parameters ['accept-language' ] = self ._serialize .header ("self.config.accept_language" , self .config .accept_language , 'str' )
67
-
68
- # Construct body
69
- body_content = self ._serialize .body (parameters , 'ImportImageParameters' )
70
-
71
- # Construct and send request
72
- request = self ._client .post (url , query_parameters )
73
- response = self ._client .send (
74
- request , header_parameters , body_content , stream = False , ** operation_config )
75
-
76
- if response .status_code not in [200 , 202 ]:
77
- exp = CloudError (response )
78
- exp .request_id = response .headers .get ('x-ms-request-id' )
79
- raise exp
80
-
81
- if raw :
82
- client_raw_response = ClientRawResponse (None , response )
83
- return client_raw_response
84
-
85
- def import_image (
86
- self , resource_group_name , registry_name , parameters , custom_headers = None , raw = False , polling = True , ** operation_config ):
87
- """Copies an image to this container registry from the specified container
88
- registry.
89
-
90
- :param resource_group_name: The name of the resource group to which
91
- the container registry belongs.
92
- :type resource_group_name: str
93
- :param registry_name: The name of the container registry.
94
- :type registry_name: str
95
- :param parameters: The parameters specifying the image to copy and the
96
- source container registry.
97
- :type parameters:
98
- ~azure.mgmt.containerregistry.v2017_10_01.models.ImportImageParameters
99
- :param dict custom_headers: headers that will be added to the request
100
- :param bool raw: The poller return type is ClientRawResponse, the
101
- direct response alongside the deserialized response
102
- :param polling: True for ARMPolling, False for no polling, or a
103
- polling object for personal polling strategy
104
- :return: An instance of LROPoller that returns None or
105
- ClientRawResponse<None> if raw==True
106
- :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
107
- ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
108
- :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
109
- """
110
- raw_result = self ._import_image_initial (
111
- resource_group_name = resource_group_name ,
112
- registry_name = registry_name ,
113
- parameters = parameters ,
114
- custom_headers = custom_headers ,
115
- raw = True ,
116
- ** operation_config
117
- )
118
-
119
- def get_long_running_output (response ):
120
- if raw :
121
- client_raw_response = ClientRawResponse (None , response )
122
- return client_raw_response
123
-
124
- lro_delay = operation_config .get (
125
- 'long_running_operation_timeout' ,
126
- self .config .long_running_operation_timeout )
127
- if polling is True : polling_method = ARMPolling (lro_delay , ** operation_config )
128
- elif polling is False : polling_method = NoPolling ()
129
- else : polling_method = polling
130
- return LROPoller (self ._client , raw_result , get_long_running_output , polling_method )
131
- import_image .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage' }
132
-
133
42
def check_name_availability (
134
43
self , name , custom_headers = None , raw = False , ** operation_config ):
135
44
"""Checks whether the container registry name is available for use. The
0 commit comments