azure_mgmt_container_registry 0.17.1 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/2016-06-27-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
- data/lib/2017-03-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
- data/lib/2017-03-01/generated/azure_mgmt_container_registry/registries.rb +7 -0
- data/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
- data/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/models/target.rb +1 -1
- data/lib/2017-10-01/generated/azure_mgmt_container_registry.rb +15 -11
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/default_action.rb +16 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/import_source.rb +27 -2
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/import_source_credentials.rb +59 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/network_rule_set.rb +69 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/registry.rb +12 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/registry_update_parameters.rb +12 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/models/virtual_network_rule.rb +47 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb +11 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/replications.rb +5 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/webhooks.rb +8 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry.rb +72 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_steps.rb +1147 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_tasks.rb +971 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb +766 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +143 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/base_image_dependency.rb +91 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/base_image_dependency_type.rb +16 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/base_image_trigger_type.rb +17 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build.rb +239 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_argument.rb +84 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_argument_list.rb +99 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_filter.rb +129 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_get_log_result.rb +46 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_list_result.rb +99 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_status.rb +22 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step.rb +76 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step_list.rb +99 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step_properties.rb +60 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step_properties_update_parameters.rb +46 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_step_update_parameters.rb +69 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task.rb +178 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_build_request.rb +62 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_filter.rb +46 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_list_result.rb +99 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_status.rb +16 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_task_update_parameters.rb +118 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_type.rb +16 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/build_update_parameters.rb +47 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/docker_build_step.rb +197 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/docker_build_step_update_parameters.rb +163 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/git_commit_trigger.rb +90 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/image_descriptor.rb +79 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/image_update_trigger.rb +78 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/os_type.rb +16 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/platform_properties.rb +59 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/provisioning_state.rb +20 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/proxy_resource.rb +72 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/queue_build_request.rb +47 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/quick_build_request.rb +173 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/resource.rb +111 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_control_auth_info.rb +92 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_control_type.rb +16 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_repository_properties.rb +84 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_repository_update_parameters.rb +60 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/source_upload_definition.rb +58 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/models/token_type.rb +16 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/module_definition.rb +9 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/registries.rb +287 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry.rb +86 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +139 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/agent_properties.rb +47 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/architecture.rb +17 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/argument.rb +70 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/auth_info.rb +92 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/auth_info_update_parameters.rb +92 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_dependency.rb +91 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_dependency_type.rb +16 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_trigger.rb +70 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_trigger_type.rb +16 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_trigger_update_parameters.rb +70 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/docker_build_request.rb +193 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/docker_build_step.rb +163 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/docker_build_step_update_parameters.rb +142 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/encoded_task_run_request.rb +159 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/encoded_task_step.rb +129 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/encoded_task_step_update_parameters.rb +111 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/file_task_run_request.rb +159 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/file_task_step.rb +129 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/file_task_step_update_parameters.rb +111 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/image_descriptor.rb +79 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/image_update_trigger.rb +78 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/os.rb +16 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/platform_properties.rb +71 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/platform_update_parameters.rb +71 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/provisioning_state.rb +20 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/proxy_resource.rb +72 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/resource.rb +111 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run.rb +252 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_filter.rb +129 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_get_log_result.rb +47 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_list_result.rb +99 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_request.rb +62 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_status.rb +22 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_type.rb +18 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/run_update_parameters.rb +47 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/set_value.rb +71 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_control_type.rb +16 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_properties.rb +83 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger.rb +91 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger_descriptor.rb +112 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger_event.rb +16 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger_update_parameters.rb +91 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_update_parameters.rb +83 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_upload_definition.rb +58 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task.rb +193 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_list_result.rb +99 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_run_request.rb +91 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_status.rb +16 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_step_properties.rb +94 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_step_update_parameters.rb +72 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/task_update_parameters.rb +130 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/token_type.rb +16 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/trigger_properties.rb +69 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/trigger_status.rb +16 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/trigger_update_parameters.rb +69 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/variant.rb +17 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/module_definition.rb +9 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/registries.rb +289 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/runs.rb +766 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/tasks.rb +938 -0
- data/lib/azure_mgmt_container_registry.rb +2 -0
- data/lib/profiles/latest/modules/containerregistry_profile_module.rb +288 -44
- data/lib/version.rb +1 -1
- metadata +116 -2
@@ -0,0 +1,971 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ContainerRegistry::Mgmt::V2018_02_01_preview
|
7
|
+
#
|
8
|
+
# BuildTasks
|
9
|
+
#
|
10
|
+
class BuildTasks
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the BuildTasks class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [ContainerRegistryManagementClient] reference to the ContainerRegistryManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Lists all the build tasks for a specified container registry.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] The name of the resource group to which
|
28
|
+
# the container registry belongs.
|
29
|
+
# @param registry_name [String] The name of the container registry.
|
30
|
+
# @param filter [String] The build task filter to apply on the operation.
|
31
|
+
# @param skip_token [String] $skipToken is supported on get list of build
|
32
|
+
# tasks, which provides the next page in the list of tasks.
|
33
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
34
|
+
# will be added to the HTTP request.
|
35
|
+
#
|
36
|
+
# @return [Array<BuildTask>] operation results.
|
37
|
+
#
|
38
|
+
def list(resource_group_name, registry_name, filter:nil, skip_token:nil, custom_headers:nil)
|
39
|
+
first_page = list_as_lazy(resource_group_name, registry_name, filter:filter, skip_token:skip_token, custom_headers:custom_headers)
|
40
|
+
first_page.get_all_items
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# Lists all the build tasks for a specified container registry.
|
45
|
+
#
|
46
|
+
# @param resource_group_name [String] The name of the resource group to which
|
47
|
+
# the container registry belongs.
|
48
|
+
# @param registry_name [String] The name of the container registry.
|
49
|
+
# @param filter [String] The build task filter to apply on the operation.
|
50
|
+
# @param skip_token [String] $skipToken is supported on get list of build
|
51
|
+
# tasks, which provides the next page in the list of tasks.
|
52
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
53
|
+
# will be added to the HTTP request.
|
54
|
+
#
|
55
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
56
|
+
#
|
57
|
+
def list_with_http_info(resource_group_name, registry_name, filter:nil, skip_token:nil, custom_headers:nil)
|
58
|
+
list_async(resource_group_name, registry_name, filter:filter, skip_token:skip_token, custom_headers:custom_headers).value!
|
59
|
+
end
|
60
|
+
|
61
|
+
#
|
62
|
+
# Lists all the build tasks for a specified container registry.
|
63
|
+
#
|
64
|
+
# @param resource_group_name [String] The name of the resource group to which
|
65
|
+
# the container registry belongs.
|
66
|
+
# @param registry_name [String] The name of the container registry.
|
67
|
+
# @param filter [String] The build task filter to apply on the operation.
|
68
|
+
# @param skip_token [String] $skipToken is supported on get list of build
|
69
|
+
# tasks, which provides the next page in the list of tasks.
|
70
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
71
|
+
# to the HTTP request.
|
72
|
+
#
|
73
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
74
|
+
#
|
75
|
+
def list_async(resource_group_name, registry_name, filter:nil, skip_token:nil, custom_headers:nil)
|
76
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
77
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
78
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
79
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
80
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
81
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
82
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
83
|
+
|
84
|
+
|
85
|
+
request_headers = {}
|
86
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
87
|
+
|
88
|
+
# Set Headers
|
89
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
90
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
91
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks'
|
92
|
+
|
93
|
+
request_url = @base_url || @client.base_url
|
94
|
+
|
95
|
+
options = {
|
96
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
97
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
|
98
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$skipToken' => skip_token},
|
99
|
+
headers: request_headers.merge(custom_headers || {}),
|
100
|
+
base_url: request_url
|
101
|
+
}
|
102
|
+
promise = @client.make_request_async(:get, path_template, options)
|
103
|
+
|
104
|
+
promise = promise.then do |result|
|
105
|
+
http_response = result.response
|
106
|
+
status_code = http_response.status
|
107
|
+
response_content = http_response.body
|
108
|
+
unless status_code == 200
|
109
|
+
error_model = JSON.load(response_content)
|
110
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
111
|
+
end
|
112
|
+
|
113
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
114
|
+
# Deserialize Response
|
115
|
+
if status_code == 200
|
116
|
+
begin
|
117
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
118
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTaskListResult.mapper()
|
119
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
120
|
+
rescue Exception => e
|
121
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
result
|
126
|
+
end
|
127
|
+
|
128
|
+
promise.execute
|
129
|
+
end
|
130
|
+
|
131
|
+
#
|
132
|
+
# Get the properties of a specified build task.
|
133
|
+
#
|
134
|
+
# @param resource_group_name [String] The name of the resource group to which
|
135
|
+
# the container registry belongs.
|
136
|
+
# @param registry_name [String] The name of the container registry.
|
137
|
+
# @param build_task_name [String] The name of the container registry build
|
138
|
+
# task.
|
139
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
140
|
+
# will be added to the HTTP request.
|
141
|
+
#
|
142
|
+
# @return [BuildTask] operation results.
|
143
|
+
#
|
144
|
+
def get(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
145
|
+
response = get_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers).value!
|
146
|
+
response.body unless response.nil?
|
147
|
+
end
|
148
|
+
|
149
|
+
#
|
150
|
+
# Get the properties of a specified build task.
|
151
|
+
#
|
152
|
+
# @param resource_group_name [String] The name of the resource group to which
|
153
|
+
# the container registry belongs.
|
154
|
+
# @param registry_name [String] The name of the container registry.
|
155
|
+
# @param build_task_name [String] The name of the container registry build
|
156
|
+
# task.
|
157
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
158
|
+
# will be added to the HTTP request.
|
159
|
+
#
|
160
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
161
|
+
#
|
162
|
+
def get_with_http_info(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
163
|
+
get_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers).value!
|
164
|
+
end
|
165
|
+
|
166
|
+
#
|
167
|
+
# Get the properties of a specified build task.
|
168
|
+
#
|
169
|
+
# @param resource_group_name [String] The name of the resource group to which
|
170
|
+
# the container registry belongs.
|
171
|
+
# @param registry_name [String] The name of the container registry.
|
172
|
+
# @param build_task_name [String] The name of the container registry build
|
173
|
+
# task.
|
174
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
175
|
+
# to the HTTP request.
|
176
|
+
#
|
177
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
178
|
+
#
|
179
|
+
def get_async(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
180
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
181
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
182
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
183
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
184
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
185
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
186
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
187
|
+
fail ArgumentError, 'build_task_name is nil' if build_task_name.nil?
|
188
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MaxLength': '50'" if !build_task_name.nil? && build_task_name.length > 50
|
189
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MinLength': '5'" if !build_task_name.nil? && build_task_name.length < 5
|
190
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !build_task_name.nil? && build_task_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
191
|
+
|
192
|
+
|
193
|
+
request_headers = {}
|
194
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
195
|
+
|
196
|
+
# Set Headers
|
197
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
198
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
199
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}'
|
200
|
+
|
201
|
+
request_url = @base_url || @client.base_url
|
202
|
+
|
203
|
+
options = {
|
204
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
205
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'buildTaskName' => build_task_name},
|
206
|
+
query_params: {'api-version' => @client.api_version},
|
207
|
+
headers: request_headers.merge(custom_headers || {}),
|
208
|
+
base_url: request_url
|
209
|
+
}
|
210
|
+
promise = @client.make_request_async(:get, path_template, options)
|
211
|
+
|
212
|
+
promise = promise.then do |result|
|
213
|
+
http_response = result.response
|
214
|
+
status_code = http_response.status
|
215
|
+
response_content = http_response.body
|
216
|
+
unless status_code == 200
|
217
|
+
error_model = JSON.load(response_content)
|
218
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
219
|
+
end
|
220
|
+
|
221
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
222
|
+
# Deserialize Response
|
223
|
+
if status_code == 200
|
224
|
+
begin
|
225
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
226
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTask.mapper()
|
227
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
228
|
+
rescue Exception => e
|
229
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
result
|
234
|
+
end
|
235
|
+
|
236
|
+
promise.execute
|
237
|
+
end
|
238
|
+
|
239
|
+
#
|
240
|
+
# Creates a build task for a container registry with the specified parameters.
|
241
|
+
#
|
242
|
+
# @param resource_group_name [String] The name of the resource group to which
|
243
|
+
# the container registry belongs.
|
244
|
+
# @param registry_name [String] The name of the container registry.
|
245
|
+
# @param build_task_name [String] The name of the container registry build
|
246
|
+
# task.
|
247
|
+
# @param build_task_create_parameters [BuildTask] The parameters for creating a
|
248
|
+
# build task.
|
249
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
250
|
+
# will be added to the HTTP request.
|
251
|
+
#
|
252
|
+
# @return [BuildTask] operation results.
|
253
|
+
#
|
254
|
+
def create(resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers:nil)
|
255
|
+
response = create_async(resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers:custom_headers).value!
|
256
|
+
response.body unless response.nil?
|
257
|
+
end
|
258
|
+
|
259
|
+
#
|
260
|
+
# @param resource_group_name [String] The name of the resource group to which
|
261
|
+
# the container registry belongs.
|
262
|
+
# @param registry_name [String] The name of the container registry.
|
263
|
+
# @param build_task_name [String] The name of the container registry build
|
264
|
+
# task.
|
265
|
+
# @param build_task_create_parameters [BuildTask] The parameters for creating a
|
266
|
+
# build task.
|
267
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
268
|
+
# will be added to the HTTP request.
|
269
|
+
#
|
270
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
271
|
+
# response.
|
272
|
+
#
|
273
|
+
def create_async(resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers:nil)
|
274
|
+
# Send request
|
275
|
+
promise = begin_create_async(resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers:custom_headers)
|
276
|
+
|
277
|
+
promise = promise.then do |response|
|
278
|
+
# Defining deserialization method.
|
279
|
+
deserialize_method = lambda do |parsed_response|
|
280
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTask.mapper()
|
281
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
282
|
+
end
|
283
|
+
|
284
|
+
# Waiting for response.
|
285
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
286
|
+
end
|
287
|
+
|
288
|
+
promise
|
289
|
+
end
|
290
|
+
|
291
|
+
#
|
292
|
+
# Deletes a specified build task.
|
293
|
+
#
|
294
|
+
# @param resource_group_name [String] The name of the resource group to which
|
295
|
+
# the container registry belongs.
|
296
|
+
# @param registry_name [String] The name of the container registry.
|
297
|
+
# @param build_task_name [String] The name of the container registry build
|
298
|
+
# task.
|
299
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
300
|
+
# will be added to the HTTP request.
|
301
|
+
#
|
302
|
+
def delete(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
303
|
+
response = delete_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers).value!
|
304
|
+
nil
|
305
|
+
end
|
306
|
+
|
307
|
+
#
|
308
|
+
# @param resource_group_name [String] The name of the resource group to which
|
309
|
+
# the container registry belongs.
|
310
|
+
# @param registry_name [String] The name of the container registry.
|
311
|
+
# @param build_task_name [String] The name of the container registry build
|
312
|
+
# task.
|
313
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
314
|
+
# will be added to the HTTP request.
|
315
|
+
#
|
316
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
317
|
+
# response.
|
318
|
+
#
|
319
|
+
def delete_async(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
320
|
+
# Send request
|
321
|
+
promise = begin_delete_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers)
|
322
|
+
|
323
|
+
promise = promise.then do |response|
|
324
|
+
# Defining deserialization method.
|
325
|
+
deserialize_method = lambda do |parsed_response|
|
326
|
+
end
|
327
|
+
|
328
|
+
# Waiting for response.
|
329
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
330
|
+
end
|
331
|
+
|
332
|
+
promise
|
333
|
+
end
|
334
|
+
|
335
|
+
#
|
336
|
+
# Updates a build task with the specified parameters.
|
337
|
+
#
|
338
|
+
# @param resource_group_name [String] The name of the resource group to which
|
339
|
+
# the container registry belongs.
|
340
|
+
# @param registry_name [String] The name of the container registry.
|
341
|
+
# @param build_task_name [String] The name of the container registry build
|
342
|
+
# task.
|
343
|
+
# @param build_task_update_parameters [BuildTaskUpdateParameters] The
|
344
|
+
# parameters for updating a build task.
|
345
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
346
|
+
# will be added to the HTTP request.
|
347
|
+
#
|
348
|
+
# @return [BuildTask] operation results.
|
349
|
+
#
|
350
|
+
def update(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:nil)
|
351
|
+
response = update_async(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:custom_headers).value!
|
352
|
+
response.body unless response.nil?
|
353
|
+
end
|
354
|
+
|
355
|
+
#
|
356
|
+
# @param resource_group_name [String] The name of the resource group to which
|
357
|
+
# the container registry belongs.
|
358
|
+
# @param registry_name [String] The name of the container registry.
|
359
|
+
# @param build_task_name [String] The name of the container registry build
|
360
|
+
# task.
|
361
|
+
# @param build_task_update_parameters [BuildTaskUpdateParameters] The
|
362
|
+
# parameters for updating a build task.
|
363
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
364
|
+
# will be added to the HTTP request.
|
365
|
+
#
|
366
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
367
|
+
# response.
|
368
|
+
#
|
369
|
+
def update_async(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:nil)
|
370
|
+
# Send request
|
371
|
+
promise = begin_update_async(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:custom_headers)
|
372
|
+
|
373
|
+
promise = promise.then do |response|
|
374
|
+
# Defining deserialization method.
|
375
|
+
deserialize_method = lambda do |parsed_response|
|
376
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTask.mapper()
|
377
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
378
|
+
end
|
379
|
+
|
380
|
+
# Waiting for response.
|
381
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
382
|
+
end
|
383
|
+
|
384
|
+
promise
|
385
|
+
end
|
386
|
+
|
387
|
+
#
|
388
|
+
# Get the source control properties for a build task.
|
389
|
+
#
|
390
|
+
# @param resource_group_name [String] The name of the resource group to which
|
391
|
+
# the container registry belongs.
|
392
|
+
# @param registry_name [String] The name of the container registry.
|
393
|
+
# @param build_task_name [String] The name of the container registry build
|
394
|
+
# task.
|
395
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
396
|
+
# will be added to the HTTP request.
|
397
|
+
#
|
398
|
+
# @return [SourceRepositoryProperties] operation results.
|
399
|
+
#
|
400
|
+
def list_source_repository_properties(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
401
|
+
response = list_source_repository_properties_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers).value!
|
402
|
+
response.body unless response.nil?
|
403
|
+
end
|
404
|
+
|
405
|
+
#
|
406
|
+
# Get the source control properties for a build task.
|
407
|
+
#
|
408
|
+
# @param resource_group_name [String] The name of the resource group to which
|
409
|
+
# the container registry belongs.
|
410
|
+
# @param registry_name [String] The name of the container registry.
|
411
|
+
# @param build_task_name [String] The name of the container registry build
|
412
|
+
# task.
|
413
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
414
|
+
# will be added to the HTTP request.
|
415
|
+
#
|
416
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
417
|
+
#
|
418
|
+
def list_source_repository_properties_with_http_info(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
419
|
+
list_source_repository_properties_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers).value!
|
420
|
+
end
|
421
|
+
|
422
|
+
#
|
423
|
+
# Get the source control properties for a build task.
|
424
|
+
#
|
425
|
+
# @param resource_group_name [String] The name of the resource group to which
|
426
|
+
# the container registry belongs.
|
427
|
+
# @param registry_name [String] The name of the container registry.
|
428
|
+
# @param build_task_name [String] The name of the container registry build
|
429
|
+
# task.
|
430
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
431
|
+
# to the HTTP request.
|
432
|
+
#
|
433
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
434
|
+
#
|
435
|
+
def list_source_repository_properties_async(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
436
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
437
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
438
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
439
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
440
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
441
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
442
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
443
|
+
fail ArgumentError, 'build_task_name is nil' if build_task_name.nil?
|
444
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MaxLength': '50'" if !build_task_name.nil? && build_task_name.length > 50
|
445
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MinLength': '5'" if !build_task_name.nil? && build_task_name.length < 5
|
446
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !build_task_name.nil? && build_task_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
447
|
+
|
448
|
+
|
449
|
+
request_headers = {}
|
450
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
451
|
+
|
452
|
+
# Set Headers
|
453
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
454
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
455
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/listSourceRepositoryProperties'
|
456
|
+
|
457
|
+
request_url = @base_url || @client.base_url
|
458
|
+
|
459
|
+
options = {
|
460
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
461
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'buildTaskName' => build_task_name},
|
462
|
+
query_params: {'api-version' => @client.api_version},
|
463
|
+
headers: request_headers.merge(custom_headers || {}),
|
464
|
+
base_url: request_url
|
465
|
+
}
|
466
|
+
promise = @client.make_request_async(:post, path_template, options)
|
467
|
+
|
468
|
+
promise = promise.then do |result|
|
469
|
+
http_response = result.response
|
470
|
+
status_code = http_response.status
|
471
|
+
response_content = http_response.body
|
472
|
+
unless status_code == 200
|
473
|
+
error_model = JSON.load(response_content)
|
474
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
475
|
+
end
|
476
|
+
|
477
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
478
|
+
# Deserialize Response
|
479
|
+
if status_code == 200
|
480
|
+
begin
|
481
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
482
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::SourceRepositoryProperties.mapper()
|
483
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
484
|
+
rescue Exception => e
|
485
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
486
|
+
end
|
487
|
+
end
|
488
|
+
|
489
|
+
result
|
490
|
+
end
|
491
|
+
|
492
|
+
promise.execute
|
493
|
+
end
|
494
|
+
|
495
|
+
#
|
496
|
+
# Creates a build task for a container registry with the specified parameters.
|
497
|
+
#
|
498
|
+
# @param resource_group_name [String] The name of the resource group to which
|
499
|
+
# the container registry belongs.
|
500
|
+
# @param registry_name [String] The name of the container registry.
|
501
|
+
# @param build_task_name [String] The name of the container registry build
|
502
|
+
# task.
|
503
|
+
# @param build_task_create_parameters [BuildTask] The parameters for creating a
|
504
|
+
# build task.
|
505
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
506
|
+
# will be added to the HTTP request.
|
507
|
+
#
|
508
|
+
# @return [BuildTask] operation results.
|
509
|
+
#
|
510
|
+
def begin_create(resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers:nil)
|
511
|
+
response = begin_create_async(resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers:custom_headers).value!
|
512
|
+
response.body unless response.nil?
|
513
|
+
end
|
514
|
+
|
515
|
+
#
|
516
|
+
# Creates a build task for a container registry with the specified parameters.
|
517
|
+
#
|
518
|
+
# @param resource_group_name [String] The name of the resource group to which
|
519
|
+
# the container registry belongs.
|
520
|
+
# @param registry_name [String] The name of the container registry.
|
521
|
+
# @param build_task_name [String] The name of the container registry build
|
522
|
+
# task.
|
523
|
+
# @param build_task_create_parameters [BuildTask] The parameters for creating a
|
524
|
+
# build task.
|
525
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
526
|
+
# will be added to the HTTP request.
|
527
|
+
#
|
528
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
529
|
+
#
|
530
|
+
def begin_create_with_http_info(resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers:nil)
|
531
|
+
begin_create_async(resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers:custom_headers).value!
|
532
|
+
end
|
533
|
+
|
534
|
+
#
|
535
|
+
# Creates a build task for a container registry with the specified parameters.
|
536
|
+
#
|
537
|
+
# @param resource_group_name [String] The name of the resource group to which
|
538
|
+
# the container registry belongs.
|
539
|
+
# @param registry_name [String] The name of the container registry.
|
540
|
+
# @param build_task_name [String] The name of the container registry build
|
541
|
+
# task.
|
542
|
+
# @param build_task_create_parameters [BuildTask] The parameters for creating a
|
543
|
+
# build task.
|
544
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
545
|
+
# to the HTTP request.
|
546
|
+
#
|
547
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
548
|
+
#
|
549
|
+
def begin_create_async(resource_group_name, registry_name, build_task_name, build_task_create_parameters, custom_headers:nil)
|
550
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
551
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
552
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
553
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
554
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
555
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
556
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
557
|
+
fail ArgumentError, 'build_task_name is nil' if build_task_name.nil?
|
558
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MaxLength': '50'" if !build_task_name.nil? && build_task_name.length > 50
|
559
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MinLength': '5'" if !build_task_name.nil? && build_task_name.length < 5
|
560
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !build_task_name.nil? && build_task_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
561
|
+
fail ArgumentError, 'build_task_create_parameters is nil' if build_task_create_parameters.nil?
|
562
|
+
|
563
|
+
|
564
|
+
request_headers = {}
|
565
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
566
|
+
|
567
|
+
# Set Headers
|
568
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
569
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
570
|
+
|
571
|
+
# Serialize Request
|
572
|
+
request_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTask.mapper()
|
573
|
+
request_content = @client.serialize(request_mapper, build_task_create_parameters)
|
574
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
575
|
+
|
576
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}'
|
577
|
+
|
578
|
+
request_url = @base_url || @client.base_url
|
579
|
+
|
580
|
+
options = {
|
581
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
582
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'buildTaskName' => build_task_name},
|
583
|
+
query_params: {'api-version' => @client.api_version},
|
584
|
+
body: request_content,
|
585
|
+
headers: request_headers.merge(custom_headers || {}),
|
586
|
+
base_url: request_url
|
587
|
+
}
|
588
|
+
promise = @client.make_request_async(:put, path_template, options)
|
589
|
+
|
590
|
+
promise = promise.then do |result|
|
591
|
+
http_response = result.response
|
592
|
+
status_code = http_response.status
|
593
|
+
response_content = http_response.body
|
594
|
+
unless status_code == 200 || status_code == 201
|
595
|
+
error_model = JSON.load(response_content)
|
596
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
597
|
+
end
|
598
|
+
|
599
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
600
|
+
# Deserialize Response
|
601
|
+
if status_code == 200
|
602
|
+
begin
|
603
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
604
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTask.mapper()
|
605
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
606
|
+
rescue Exception => e
|
607
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
608
|
+
end
|
609
|
+
end
|
610
|
+
# Deserialize Response
|
611
|
+
if status_code == 201
|
612
|
+
begin
|
613
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
614
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTask.mapper()
|
615
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
616
|
+
rescue Exception => e
|
617
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
618
|
+
end
|
619
|
+
end
|
620
|
+
|
621
|
+
result
|
622
|
+
end
|
623
|
+
|
624
|
+
promise.execute
|
625
|
+
end
|
626
|
+
|
627
|
+
#
|
628
|
+
# Deletes a specified build task.
|
629
|
+
#
|
630
|
+
# @param resource_group_name [String] The name of the resource group to which
|
631
|
+
# the container registry belongs.
|
632
|
+
# @param registry_name [String] The name of the container registry.
|
633
|
+
# @param build_task_name [String] The name of the container registry build
|
634
|
+
# task.
|
635
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
636
|
+
# will be added to the HTTP request.
|
637
|
+
#
|
638
|
+
#
|
639
|
+
def begin_delete(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
640
|
+
response = begin_delete_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers).value!
|
641
|
+
nil
|
642
|
+
end
|
643
|
+
|
644
|
+
#
|
645
|
+
# Deletes a specified build task.
|
646
|
+
#
|
647
|
+
# @param resource_group_name [String] The name of the resource group to which
|
648
|
+
# the container registry belongs.
|
649
|
+
# @param registry_name [String] The name of the container registry.
|
650
|
+
# @param build_task_name [String] The name of the container registry build
|
651
|
+
# task.
|
652
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
653
|
+
# will be added to the HTTP request.
|
654
|
+
#
|
655
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
656
|
+
#
|
657
|
+
def begin_delete_with_http_info(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
658
|
+
begin_delete_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers).value!
|
659
|
+
end
|
660
|
+
|
661
|
+
#
|
662
|
+
# Deletes a specified build task.
|
663
|
+
#
|
664
|
+
# @param resource_group_name [String] The name of the resource group to which
|
665
|
+
# the container registry belongs.
|
666
|
+
# @param registry_name [String] The name of the container registry.
|
667
|
+
# @param build_task_name [String] The name of the container registry build
|
668
|
+
# task.
|
669
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
670
|
+
# to the HTTP request.
|
671
|
+
#
|
672
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
673
|
+
#
|
674
|
+
def begin_delete_async(resource_group_name, registry_name, build_task_name, custom_headers:nil)
|
675
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
676
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
677
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
678
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
679
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
680
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
681
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
682
|
+
fail ArgumentError, 'build_task_name is nil' if build_task_name.nil?
|
683
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MaxLength': '50'" if !build_task_name.nil? && build_task_name.length > 50
|
684
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MinLength': '5'" if !build_task_name.nil? && build_task_name.length < 5
|
685
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !build_task_name.nil? && build_task_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
686
|
+
|
687
|
+
|
688
|
+
request_headers = {}
|
689
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
690
|
+
|
691
|
+
# Set Headers
|
692
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
693
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
694
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}'
|
695
|
+
|
696
|
+
request_url = @base_url || @client.base_url
|
697
|
+
|
698
|
+
options = {
|
699
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
700
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'buildTaskName' => build_task_name},
|
701
|
+
query_params: {'api-version' => @client.api_version},
|
702
|
+
headers: request_headers.merge(custom_headers || {}),
|
703
|
+
base_url: request_url
|
704
|
+
}
|
705
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
706
|
+
|
707
|
+
promise = promise.then do |result|
|
708
|
+
http_response = result.response
|
709
|
+
status_code = http_response.status
|
710
|
+
response_content = http_response.body
|
711
|
+
unless status_code == 200 || status_code == 202 || status_code == 204
|
712
|
+
error_model = JSON.load(response_content)
|
713
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
714
|
+
end
|
715
|
+
|
716
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
717
|
+
|
718
|
+
result
|
719
|
+
end
|
720
|
+
|
721
|
+
promise.execute
|
722
|
+
end
|
723
|
+
|
724
|
+
#
|
725
|
+
# Updates a build task with the specified parameters.
|
726
|
+
#
|
727
|
+
# @param resource_group_name [String] The name of the resource group to which
|
728
|
+
# the container registry belongs.
|
729
|
+
# @param registry_name [String] The name of the container registry.
|
730
|
+
# @param build_task_name [String] The name of the container registry build
|
731
|
+
# task.
|
732
|
+
# @param build_task_update_parameters [BuildTaskUpdateParameters] The
|
733
|
+
# parameters for updating a build task.
|
734
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
735
|
+
# will be added to the HTTP request.
|
736
|
+
#
|
737
|
+
# @return [BuildTask] operation results.
|
738
|
+
#
|
739
|
+
def begin_update(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:nil)
|
740
|
+
response = begin_update_async(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:custom_headers).value!
|
741
|
+
response.body unless response.nil?
|
742
|
+
end
|
743
|
+
|
744
|
+
#
|
745
|
+
# Updates a build task with the specified parameters.
|
746
|
+
#
|
747
|
+
# @param resource_group_name [String] The name of the resource group to which
|
748
|
+
# the container registry belongs.
|
749
|
+
# @param registry_name [String] The name of the container registry.
|
750
|
+
# @param build_task_name [String] The name of the container registry build
|
751
|
+
# task.
|
752
|
+
# @param build_task_update_parameters [BuildTaskUpdateParameters] The
|
753
|
+
# parameters for updating a build task.
|
754
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
755
|
+
# will be added to the HTTP request.
|
756
|
+
#
|
757
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
758
|
+
#
|
759
|
+
def begin_update_with_http_info(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:nil)
|
760
|
+
begin_update_async(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:custom_headers).value!
|
761
|
+
end
|
762
|
+
|
763
|
+
#
|
764
|
+
# Updates a build task with the specified parameters.
|
765
|
+
#
|
766
|
+
# @param resource_group_name [String] The name of the resource group to which
|
767
|
+
# the container registry belongs.
|
768
|
+
# @param registry_name [String] The name of the container registry.
|
769
|
+
# @param build_task_name [String] The name of the container registry build
|
770
|
+
# task.
|
771
|
+
# @param build_task_update_parameters [BuildTaskUpdateParameters] The
|
772
|
+
# parameters for updating a build task.
|
773
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
774
|
+
# to the HTTP request.
|
775
|
+
#
|
776
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
777
|
+
#
|
778
|
+
def begin_update_async(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:nil)
|
779
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
780
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
781
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
782
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
783
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
784
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !registry_name.nil? && registry_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
785
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
786
|
+
fail ArgumentError, 'build_task_name is nil' if build_task_name.nil?
|
787
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MaxLength': '50'" if !build_task_name.nil? && build_task_name.length > 50
|
788
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'MinLength': '5'" if !build_task_name.nil? && build_task_name.length < 5
|
789
|
+
fail ArgumentError, "'build_task_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !build_task_name.nil? && build_task_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
790
|
+
fail ArgumentError, 'build_task_update_parameters is nil' if build_task_update_parameters.nil?
|
791
|
+
|
792
|
+
|
793
|
+
request_headers = {}
|
794
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
795
|
+
|
796
|
+
# Set Headers
|
797
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
798
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
799
|
+
|
800
|
+
# Serialize Request
|
801
|
+
request_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTaskUpdateParameters.mapper()
|
802
|
+
request_content = @client.serialize(request_mapper, build_task_update_parameters)
|
803
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
804
|
+
|
805
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}'
|
806
|
+
|
807
|
+
request_url = @base_url || @client.base_url
|
808
|
+
|
809
|
+
options = {
|
810
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
811
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'buildTaskName' => build_task_name},
|
812
|
+
query_params: {'api-version' => @client.api_version},
|
813
|
+
body: request_content,
|
814
|
+
headers: request_headers.merge(custom_headers || {}),
|
815
|
+
base_url: request_url
|
816
|
+
}
|
817
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
818
|
+
|
819
|
+
promise = promise.then do |result|
|
820
|
+
http_response = result.response
|
821
|
+
status_code = http_response.status
|
822
|
+
response_content = http_response.body
|
823
|
+
unless status_code == 200 || status_code == 201
|
824
|
+
error_model = JSON.load(response_content)
|
825
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
826
|
+
end
|
827
|
+
|
828
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
829
|
+
# Deserialize Response
|
830
|
+
if status_code == 200
|
831
|
+
begin
|
832
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
833
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTask.mapper()
|
834
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
835
|
+
rescue Exception => e
|
836
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
837
|
+
end
|
838
|
+
end
|
839
|
+
# Deserialize Response
|
840
|
+
if status_code == 201
|
841
|
+
begin
|
842
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
843
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTask.mapper()
|
844
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
845
|
+
rescue Exception => e
|
846
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
847
|
+
end
|
848
|
+
end
|
849
|
+
|
850
|
+
result
|
851
|
+
end
|
852
|
+
|
853
|
+
promise.execute
|
854
|
+
end
|
855
|
+
|
856
|
+
#
|
857
|
+
# Lists all the build tasks for a specified container registry.
|
858
|
+
#
|
859
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
860
|
+
# to List operation.
|
861
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
862
|
+
# will be added to the HTTP request.
|
863
|
+
#
|
864
|
+
# @return [BuildTaskListResult] operation results.
|
865
|
+
#
|
866
|
+
def list_next(next_page_link, custom_headers:nil)
|
867
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
868
|
+
response.body unless response.nil?
|
869
|
+
end
|
870
|
+
|
871
|
+
#
|
872
|
+
# Lists all the build tasks for a specified container registry.
|
873
|
+
#
|
874
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
875
|
+
# to List operation.
|
876
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
877
|
+
# will be added to the HTTP request.
|
878
|
+
#
|
879
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
880
|
+
#
|
881
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
882
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
883
|
+
end
|
884
|
+
|
885
|
+
#
|
886
|
+
# Lists all the build tasks for a specified container registry.
|
887
|
+
#
|
888
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
889
|
+
# to List operation.
|
890
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
891
|
+
# to the HTTP request.
|
892
|
+
#
|
893
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
894
|
+
#
|
895
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
896
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
897
|
+
|
898
|
+
|
899
|
+
request_headers = {}
|
900
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
901
|
+
|
902
|
+
# Set Headers
|
903
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
904
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
905
|
+
path_template = '{nextLink}'
|
906
|
+
|
907
|
+
request_url = @base_url || @client.base_url
|
908
|
+
|
909
|
+
options = {
|
910
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
911
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
912
|
+
headers: request_headers.merge(custom_headers || {}),
|
913
|
+
base_url: request_url
|
914
|
+
}
|
915
|
+
promise = @client.make_request_async(:get, path_template, options)
|
916
|
+
|
917
|
+
promise = promise.then do |result|
|
918
|
+
http_response = result.response
|
919
|
+
status_code = http_response.status
|
920
|
+
response_content = http_response.body
|
921
|
+
unless status_code == 200
|
922
|
+
error_model = JSON.load(response_content)
|
923
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
924
|
+
end
|
925
|
+
|
926
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
927
|
+
# Deserialize Response
|
928
|
+
if status_code == 200
|
929
|
+
begin
|
930
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
931
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2018_02_01_preview::Models::BuildTaskListResult.mapper()
|
932
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
933
|
+
rescue Exception => e
|
934
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
935
|
+
end
|
936
|
+
end
|
937
|
+
|
938
|
+
result
|
939
|
+
end
|
940
|
+
|
941
|
+
promise.execute
|
942
|
+
end
|
943
|
+
|
944
|
+
#
|
945
|
+
# Lists all the build tasks for a specified container registry.
|
946
|
+
#
|
947
|
+
# @param resource_group_name [String] The name of the resource group to which
|
948
|
+
# the container registry belongs.
|
949
|
+
# @param registry_name [String] The name of the container registry.
|
950
|
+
# @param filter [String] The build task filter to apply on the operation.
|
951
|
+
# @param skip_token [String] $skipToken is supported on get list of build
|
952
|
+
# tasks, which provides the next page in the list of tasks.
|
953
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
954
|
+
# will be added to the HTTP request.
|
955
|
+
#
|
956
|
+
# @return [BuildTaskListResult] which provide lazy access to pages of the
|
957
|
+
# response.
|
958
|
+
#
|
959
|
+
def list_as_lazy(resource_group_name, registry_name, filter:nil, skip_token:nil, custom_headers:nil)
|
960
|
+
response = list_async(resource_group_name, registry_name, filter:filter, skip_token:skip_token, custom_headers:custom_headers).value!
|
961
|
+
unless response.nil?
|
962
|
+
page = response.body
|
963
|
+
page.next_method = Proc.new do |next_page_link|
|
964
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
965
|
+
end
|
966
|
+
page
|
967
|
+
end
|
968
|
+
end
|
969
|
+
|
970
|
+
end
|
971
|
+
end
|