azure_mgmt_container_registry 0.18.2 → 0.18.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/2016-06-27-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
- data/lib/2016-06-27-preview/generated/azure_mgmt_container_registry/registries.rb +22 -0
- 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/operations.rb +4 -0
- data/lib/2017-03-01/generated/azure_mgmt_container_registry/registries.rb +22 -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/operations.rb +4 -0
- data/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/registries.rb +24 -0
- data/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/replications.rb +12 -0
- data/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/webhooks.rb +20 -0
- 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/operations.rb +4 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb +30 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/replications.rb +12 -0
- data/lib/2017-10-01/generated/azure_mgmt_container_registry/webhooks.rb +20 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_steps.rb +16 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_tasks.rb +14 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb +12 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/registries.rb +4 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_trigger.rb +2 -1
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/base_image_trigger_update_parameters.rb +2 -1
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger.rb +2 -1
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/models/source_trigger_update_parameters.rb +2 -1
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/registries.rb +4 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/runs.rb +12 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_registry/tasks.rb +14 -0
- data/lib/2019-04-01/generated/azure_mgmt_container_registry.rb +7 -6
- data/lib/2019-04-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +1 -1
- data/lib/2019-04-01/generated/azure_mgmt_container_registry/models/run.rb +12 -0
- data/lib/2019-04-01/generated/azure_mgmt_container_registry/models/timer_trigger_descriptor.rb +58 -0
- data/lib/2019-04-01/generated/azure_mgmt_container_registry/registries.rb +4 -0
- data/lib/2019-04-01/generated/azure_mgmt_container_registry/runs.rb +12 -0
- data/lib/2019-04-01/generated/azure_mgmt_container_registry/tasks.rb +14 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry.rb +46 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +139 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/generate_credentials_parameters.rb +75 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/generate_credentials_result.rb +67 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/provisioning_state.rb +20 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/proxy_resource.rb +72 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/scope_map.rb +133 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/scope_map_list_result.rb +101 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/scope_map_update_parameters.rb +68 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/status.rb +16 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token.rb +137 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_certificate.rb +81 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_certificate_name.rb +16 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_credentials_properties.rb +76 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_list_result.rb +101 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_password.rb +82 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_password_name.rb +16 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/models/token_update_parameters.rb +72 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/module_definition.rb +9 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/registries.rb +188 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/scope_maps.rb +850 -0
- data/lib/2019-05-01-preview/generated/azure_mgmt_container_registry/tokens.rb +844 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry.rb +90 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/container_registry_management_client.rb +143 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/action.rb +15 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/actor.rb +48 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/callback_config.rb +66 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/default_action.rb +16 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/event.rb +69 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/event_content.rb +120 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/event_info.rb +46 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/event_list_result.rb +101 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/event_request_message.rb +101 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/event_response_message.rb +99 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/import_image_parameters.rb +104 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/import_mode.rb +16 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/import_source.rb +89 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/import_source_credentials.rb +59 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/iprule.rb +60 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/network_rule_set.rb +89 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/operation_definition.rb +84 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/operation_display_definition.rb +80 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/operation_list_result.rb +101 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/operation_metric_specification_definition.rb +101 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/operation_service_specification_definition.rb +56 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/password_name.rb +16 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/policies.rb +74 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/policy_status.rb +16 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/provisioning_state.rb +20 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/quarantine_policy.rb +47 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/regenerate_credential_parameters.rb +49 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry.rb +202 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry_list_credentials_result.rb +67 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry_list_result.rb +101 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry_name_check_request.rb +66 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry_name_status.rb +71 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry_password.rb +59 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry_update_parameters.rb +102 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry_usage.rb +80 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry_usage_list_result.rb +56 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/registry_usage_unit.rb +16 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/replication.rb +114 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/replication_list_result.rb +101 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/replication_update_parameters.rb +54 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/request.rb +93 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/resource.rb +111 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/retention_policy.rb +71 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/sku.rb +61 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/sku_name.rb +18 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/sku_tier.rb +18 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/source.rb +61 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/status.rb +73 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/storage_account_properties.rb +47 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/target.rb +137 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/trust_policy.rb +59 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/trust_policy_type.rb +15 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/virtual_network_rule.rb +60 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/webhook.rb +146 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/webhook_action.rb +19 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/webhook_create_parameters.rb +143 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/webhook_list_result.rb +101 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/webhook_status.rb +16 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/models/webhook_update_parameters.rb +131 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/module_definition.rb +9 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/operations.rb +219 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/registries.rb +1580 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/replications.rb +845 -0
- data/lib/2019-05-01/generated/azure_mgmt_container_registry/webhooks.rb +1287 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry.rb +100 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/container_registry_management_client.rb +139 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/agent_properties.rb +47 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/architecture.rb +19 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/argument.rb +70 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/auth_info.rb +92 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/auth_info_update_parameters.rb +92 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_dependency.rb +91 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_dependency_type.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_trigger.rb +94 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_trigger_type.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/base_image_trigger_update_parameters.rb +94 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/credentials.rb +74 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/custom_registry_credentials.rb +82 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/docker_build_request.rb +218 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/docker_build_step.rb +175 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/docker_build_step_update_parameters.rb +154 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/encoded_task_run_request.rb +172 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/encoded_task_step.rb +129 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/encoded_task_step_update_parameters.rb +111 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/file_task_run_request.rb +172 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/file_task_step.rb +129 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/file_task_step_update_parameters.rb +111 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/identity_properties.rb +95 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/image_descriptor.rb +79 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/image_update_trigger.rb +78 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/os.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/override_task_step_properties.rb +125 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/platform_properties.rb +71 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/platform_update_parameters.rb +71 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/provisioning_state.rb +20 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/proxy_resource.rb +72 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/resource.rb +111 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/resource_identity_type.rb +18 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run.rb +320 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_filter.rb +129 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_get_log_result.rb +47 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_list_result.rb +99 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_request.rb +62 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_status.rb +22 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_type.rb +18 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/run_update_parameters.rb +47 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/secret_object.rb +63 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/secret_object_type.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/set_value.rb +71 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_control_type.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_properties.rb +83 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_registry_credentials.rb +52 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_registry_login_mode.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_trigger.rb +92 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_trigger_descriptor.rb +112 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_trigger_event.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_trigger_update_parameters.rb +92 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_update_parameters.rb +83 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/source_upload_definition.rb +58 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task.rb +218 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_list_result.rb +99 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_run_request.rb +84 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_status.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_step_properties.rb +94 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_step_update_parameters.rb +72 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/task_update_parameters.rb +155 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/timer_trigger.rb +70 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/timer_trigger_descriptor.rb +58 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/timer_trigger_update_parameters.rb +70 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/token_type.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/trigger_properties.rb +89 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/trigger_status.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/trigger_update_parameters.rb +90 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/update_trigger_payload_type.rb +16 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/user_identity_properties.rb +58 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/models/variant.rb +17 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/module_definition.rb +9 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/registries.rb +293 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/runs.rb +778 -0
- data/lib/2019-06-01-preview/generated/azure_mgmt_container_registry/tasks.rb +952 -0
- data/lib/azure_mgmt_container_registry.rb +3 -0
- data/lib/profiles/latest/modules/containerregistry_profile_module.rb +321 -305
- data/lib/version.rb +1 -1
- metadata +170 -5
@@ -0,0 +1,1287 @@
|
|
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::V2019_05_01
|
7
|
+
#
|
8
|
+
# Webhooks
|
9
|
+
#
|
10
|
+
class Webhooks
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Webhooks 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
|
+
# Gets the properties of the specified webhook.
|
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 webhook_name [String] The name of the webhook.
|
31
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
32
|
+
# will be added to the HTTP request.
|
33
|
+
#
|
34
|
+
# @return [Webhook] operation results.
|
35
|
+
#
|
36
|
+
def get(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
37
|
+
response = get_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
38
|
+
response.body unless response.nil?
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# Gets the properties of the specified webhook.
|
43
|
+
#
|
44
|
+
# @param resource_group_name [String] The name of the resource group to which
|
45
|
+
# the container registry belongs.
|
46
|
+
# @param registry_name [String] The name of the container registry.
|
47
|
+
# @param webhook_name [String] The name of the webhook.
|
48
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
49
|
+
# will be added to the HTTP request.
|
50
|
+
#
|
51
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
52
|
+
#
|
53
|
+
def get_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
54
|
+
get_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# Gets the properties of the specified webhook.
|
59
|
+
#
|
60
|
+
# @param resource_group_name [String] The name of the resource group to which
|
61
|
+
# the container registry belongs.
|
62
|
+
# @param registry_name [String] The name of the container registry.
|
63
|
+
# @param webhook_name [String] The name of the webhook.
|
64
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
65
|
+
# to the HTTP request.
|
66
|
+
#
|
67
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
68
|
+
#
|
69
|
+
def get_async(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
70
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
71
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
72
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
73
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
74
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
75
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
76
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
77
|
+
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?
|
78
|
+
fail ArgumentError, 'webhook_name is nil' if webhook_name.nil?
|
79
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MaxLength': '50'" if !webhook_name.nil? && webhook_name.length > 50
|
80
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MinLength': '5'" if !webhook_name.nil? && webhook_name.length < 5
|
81
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !webhook_name.nil? && webhook_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
82
|
+
|
83
|
+
|
84
|
+
request_headers = {}
|
85
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
86
|
+
|
87
|
+
# Set Headers
|
88
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
89
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
90
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'
|
91
|
+
|
92
|
+
request_url = @base_url || @client.base_url
|
93
|
+
|
94
|
+
options = {
|
95
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
96
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name},
|
97
|
+
query_params: {'api-version' => @client.api_version},
|
98
|
+
headers: request_headers.merge(custom_headers || {}),
|
99
|
+
base_url: request_url
|
100
|
+
}
|
101
|
+
promise = @client.make_request_async(:get, path_template, options)
|
102
|
+
|
103
|
+
promise = promise.then do |result|
|
104
|
+
http_response = result.response
|
105
|
+
status_code = http_response.status
|
106
|
+
response_content = http_response.body
|
107
|
+
unless status_code == 200
|
108
|
+
error_model = JSON.load(response_content)
|
109
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
110
|
+
end
|
111
|
+
|
112
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
113
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
114
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
115
|
+
# Deserialize Response
|
116
|
+
if status_code == 200
|
117
|
+
begin
|
118
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
119
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::Webhook.mapper()
|
120
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
121
|
+
rescue Exception => e
|
122
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
result
|
127
|
+
end
|
128
|
+
|
129
|
+
promise.execute
|
130
|
+
end
|
131
|
+
|
132
|
+
#
|
133
|
+
# Creates a webhook for a container registry with the specified parameters.
|
134
|
+
#
|
135
|
+
# @param resource_group_name [String] The name of the resource group to which
|
136
|
+
# the container registry belongs.
|
137
|
+
# @param registry_name [String] The name of the container registry.
|
138
|
+
# @param webhook_name [String] The name of the webhook.
|
139
|
+
# @param webhook_create_parameters [WebhookCreateParameters] The parameters for
|
140
|
+
# creating a webhook.
|
141
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
142
|
+
# will be added to the HTTP request.
|
143
|
+
#
|
144
|
+
# @return [Webhook] operation results.
|
145
|
+
#
|
146
|
+
def create(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers:nil)
|
147
|
+
response = create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers:custom_headers).value!
|
148
|
+
response.body unless response.nil?
|
149
|
+
end
|
150
|
+
|
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 webhook_name [String] The name of the webhook.
|
156
|
+
# @param webhook_create_parameters [WebhookCreateParameters] The parameters for
|
157
|
+
# creating a webhook.
|
158
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
159
|
+
# will be added to the HTTP request.
|
160
|
+
#
|
161
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
162
|
+
# response.
|
163
|
+
#
|
164
|
+
def create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers:nil)
|
165
|
+
# Send request
|
166
|
+
promise = begin_create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers:custom_headers)
|
167
|
+
|
168
|
+
promise = promise.then do |response|
|
169
|
+
# Defining deserialization method.
|
170
|
+
deserialize_method = lambda do |parsed_response|
|
171
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::Webhook.mapper()
|
172
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
173
|
+
end
|
174
|
+
|
175
|
+
# Waiting for response.
|
176
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
177
|
+
end
|
178
|
+
|
179
|
+
promise
|
180
|
+
end
|
181
|
+
|
182
|
+
#
|
183
|
+
# Deletes a webhook from a container registry.
|
184
|
+
#
|
185
|
+
# @param resource_group_name [String] The name of the resource group to which
|
186
|
+
# the container registry belongs.
|
187
|
+
# @param registry_name [String] The name of the container registry.
|
188
|
+
# @param webhook_name [String] The name of the webhook.
|
189
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
190
|
+
# will be added to the HTTP request.
|
191
|
+
#
|
192
|
+
def delete(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
193
|
+
response = delete_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
194
|
+
nil
|
195
|
+
end
|
196
|
+
|
197
|
+
#
|
198
|
+
# @param resource_group_name [String] The name of the resource group to which
|
199
|
+
# the container registry belongs.
|
200
|
+
# @param registry_name [String] The name of the container registry.
|
201
|
+
# @param webhook_name [String] The name of the webhook.
|
202
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
203
|
+
# will be added to the HTTP request.
|
204
|
+
#
|
205
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
206
|
+
# response.
|
207
|
+
#
|
208
|
+
def delete_async(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
209
|
+
# Send request
|
210
|
+
promise = begin_delete_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers)
|
211
|
+
|
212
|
+
promise = promise.then do |response|
|
213
|
+
# Defining deserialization method.
|
214
|
+
deserialize_method = lambda do |parsed_response|
|
215
|
+
end
|
216
|
+
|
217
|
+
# Waiting for response.
|
218
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
219
|
+
end
|
220
|
+
|
221
|
+
promise
|
222
|
+
end
|
223
|
+
|
224
|
+
#
|
225
|
+
# Updates a webhook with the specified parameters.
|
226
|
+
#
|
227
|
+
# @param resource_group_name [String] The name of the resource group to which
|
228
|
+
# the container registry belongs.
|
229
|
+
# @param registry_name [String] The name of the container registry.
|
230
|
+
# @param webhook_name [String] The name of the webhook.
|
231
|
+
# @param webhook_update_parameters [WebhookUpdateParameters] The parameters for
|
232
|
+
# updating a webhook.
|
233
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
234
|
+
# will be added to the HTTP request.
|
235
|
+
#
|
236
|
+
# @return [Webhook] operation results.
|
237
|
+
#
|
238
|
+
def update(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:nil)
|
239
|
+
response = update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:custom_headers).value!
|
240
|
+
response.body unless response.nil?
|
241
|
+
end
|
242
|
+
|
243
|
+
#
|
244
|
+
# @param resource_group_name [String] The name of the resource group to which
|
245
|
+
# the container registry belongs.
|
246
|
+
# @param registry_name [String] The name of the container registry.
|
247
|
+
# @param webhook_name [String] The name of the webhook.
|
248
|
+
# @param webhook_update_parameters [WebhookUpdateParameters] The parameters for
|
249
|
+
# updating a webhook.
|
250
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
251
|
+
# will be added to the HTTP request.
|
252
|
+
#
|
253
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
254
|
+
# response.
|
255
|
+
#
|
256
|
+
def update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:nil)
|
257
|
+
# Send request
|
258
|
+
promise = begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:custom_headers)
|
259
|
+
|
260
|
+
promise = promise.then do |response|
|
261
|
+
# Defining deserialization method.
|
262
|
+
deserialize_method = lambda do |parsed_response|
|
263
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::Webhook.mapper()
|
264
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
265
|
+
end
|
266
|
+
|
267
|
+
# Waiting for response.
|
268
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
269
|
+
end
|
270
|
+
|
271
|
+
promise
|
272
|
+
end
|
273
|
+
|
274
|
+
#
|
275
|
+
# Lists all the webhooks for the specified container registry.
|
276
|
+
#
|
277
|
+
# @param resource_group_name [String] The name of the resource group to which
|
278
|
+
# the container registry belongs.
|
279
|
+
# @param registry_name [String] The name of the container registry.
|
280
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
281
|
+
# will be added to the HTTP request.
|
282
|
+
#
|
283
|
+
# @return [Array<Webhook>] operation results.
|
284
|
+
#
|
285
|
+
def list(resource_group_name, registry_name, custom_headers:nil)
|
286
|
+
first_page = list_as_lazy(resource_group_name, registry_name, custom_headers:custom_headers)
|
287
|
+
first_page.get_all_items
|
288
|
+
end
|
289
|
+
|
290
|
+
#
|
291
|
+
# Lists all the webhooks for the specified container registry.
|
292
|
+
#
|
293
|
+
# @param resource_group_name [String] The name of the resource group to which
|
294
|
+
# the container registry belongs.
|
295
|
+
# @param registry_name [String] The name of the container registry.
|
296
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
297
|
+
# will be added to the HTTP request.
|
298
|
+
#
|
299
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
300
|
+
#
|
301
|
+
def list_with_http_info(resource_group_name, registry_name, custom_headers:nil)
|
302
|
+
list_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
|
303
|
+
end
|
304
|
+
|
305
|
+
#
|
306
|
+
# Lists all the webhooks for the specified container registry.
|
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 [Hash{String => String}] A hash of custom headers that will be added
|
312
|
+
# to the HTTP request.
|
313
|
+
#
|
314
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
315
|
+
#
|
316
|
+
def list_async(resource_group_name, registry_name, custom_headers:nil)
|
317
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
318
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
319
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
320
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
321
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
322
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
323
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
324
|
+
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?
|
325
|
+
|
326
|
+
|
327
|
+
request_headers = {}
|
328
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
329
|
+
|
330
|
+
# Set Headers
|
331
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
332
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
333
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks'
|
334
|
+
|
335
|
+
request_url = @base_url || @client.base_url
|
336
|
+
|
337
|
+
options = {
|
338
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
339
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name},
|
340
|
+
query_params: {'api-version' => @client.api_version},
|
341
|
+
headers: request_headers.merge(custom_headers || {}),
|
342
|
+
base_url: request_url
|
343
|
+
}
|
344
|
+
promise = @client.make_request_async(:get, path_template, options)
|
345
|
+
|
346
|
+
promise = promise.then do |result|
|
347
|
+
http_response = result.response
|
348
|
+
status_code = http_response.status
|
349
|
+
response_content = http_response.body
|
350
|
+
unless status_code == 200
|
351
|
+
error_model = JSON.load(response_content)
|
352
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
353
|
+
end
|
354
|
+
|
355
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
356
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
357
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
358
|
+
# Deserialize Response
|
359
|
+
if status_code == 200
|
360
|
+
begin
|
361
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
362
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::WebhookListResult.mapper()
|
363
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
364
|
+
rescue Exception => e
|
365
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
result
|
370
|
+
end
|
371
|
+
|
372
|
+
promise.execute
|
373
|
+
end
|
374
|
+
|
375
|
+
#
|
376
|
+
# Triggers a ping event to be sent to the webhook.
|
377
|
+
#
|
378
|
+
# @param resource_group_name [String] The name of the resource group to which
|
379
|
+
# the container registry belongs.
|
380
|
+
# @param registry_name [String] The name of the container registry.
|
381
|
+
# @param webhook_name [String] The name of the webhook.
|
382
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
383
|
+
# will be added to the HTTP request.
|
384
|
+
#
|
385
|
+
# @return [EventInfo] operation results.
|
386
|
+
#
|
387
|
+
def ping(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
388
|
+
response = ping_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
389
|
+
response.body unless response.nil?
|
390
|
+
end
|
391
|
+
|
392
|
+
#
|
393
|
+
# Triggers a ping event to be sent to the webhook.
|
394
|
+
#
|
395
|
+
# @param resource_group_name [String] The name of the resource group to which
|
396
|
+
# the container registry belongs.
|
397
|
+
# @param registry_name [String] The name of the container registry.
|
398
|
+
# @param webhook_name [String] The name of the webhook.
|
399
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
400
|
+
# will be added to the HTTP request.
|
401
|
+
#
|
402
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
403
|
+
#
|
404
|
+
def ping_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
405
|
+
ping_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
406
|
+
end
|
407
|
+
|
408
|
+
#
|
409
|
+
# Triggers a ping event to be sent to the webhook.
|
410
|
+
#
|
411
|
+
# @param resource_group_name [String] The name of the resource group to which
|
412
|
+
# the container registry belongs.
|
413
|
+
# @param registry_name [String] The name of the container registry.
|
414
|
+
# @param webhook_name [String] The name of the webhook.
|
415
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
416
|
+
# to the HTTP request.
|
417
|
+
#
|
418
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
419
|
+
#
|
420
|
+
def ping_async(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
421
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
422
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
423
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
424
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
425
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
426
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
427
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
428
|
+
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?
|
429
|
+
fail ArgumentError, 'webhook_name is nil' if webhook_name.nil?
|
430
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MaxLength': '50'" if !webhook_name.nil? && webhook_name.length > 50
|
431
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MinLength': '5'" if !webhook_name.nil? && webhook_name.length < 5
|
432
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !webhook_name.nil? && webhook_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
433
|
+
|
434
|
+
|
435
|
+
request_headers = {}
|
436
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
437
|
+
|
438
|
+
# Set Headers
|
439
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
440
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
441
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping'
|
442
|
+
|
443
|
+
request_url = @base_url || @client.base_url
|
444
|
+
|
445
|
+
options = {
|
446
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
447
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name},
|
448
|
+
query_params: {'api-version' => @client.api_version},
|
449
|
+
headers: request_headers.merge(custom_headers || {}),
|
450
|
+
base_url: request_url
|
451
|
+
}
|
452
|
+
promise = @client.make_request_async(:post, path_template, options)
|
453
|
+
|
454
|
+
promise = promise.then do |result|
|
455
|
+
http_response = result.response
|
456
|
+
status_code = http_response.status
|
457
|
+
response_content = http_response.body
|
458
|
+
unless status_code == 200
|
459
|
+
error_model = JSON.load(response_content)
|
460
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
461
|
+
end
|
462
|
+
|
463
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
464
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
465
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
466
|
+
# Deserialize Response
|
467
|
+
if status_code == 200
|
468
|
+
begin
|
469
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
470
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::EventInfo.mapper()
|
471
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
472
|
+
rescue Exception => e
|
473
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
result
|
478
|
+
end
|
479
|
+
|
480
|
+
promise.execute
|
481
|
+
end
|
482
|
+
|
483
|
+
#
|
484
|
+
# Gets the configuration of service URI and custom headers for the webhook.
|
485
|
+
#
|
486
|
+
# @param resource_group_name [String] The name of the resource group to which
|
487
|
+
# the container registry belongs.
|
488
|
+
# @param registry_name [String] The name of the container registry.
|
489
|
+
# @param webhook_name [String] The name of the webhook.
|
490
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
491
|
+
# will be added to the HTTP request.
|
492
|
+
#
|
493
|
+
# @return [CallbackConfig] operation results.
|
494
|
+
#
|
495
|
+
def get_callback_config(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
496
|
+
response = get_callback_config_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
497
|
+
response.body unless response.nil?
|
498
|
+
end
|
499
|
+
|
500
|
+
#
|
501
|
+
# Gets the configuration of service URI and custom headers for the webhook.
|
502
|
+
#
|
503
|
+
# @param resource_group_name [String] The name of the resource group to which
|
504
|
+
# the container registry belongs.
|
505
|
+
# @param registry_name [String] The name of the container registry.
|
506
|
+
# @param webhook_name [String] The name of the webhook.
|
507
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
508
|
+
# will be added to the HTTP request.
|
509
|
+
#
|
510
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
511
|
+
#
|
512
|
+
def get_callback_config_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
513
|
+
get_callback_config_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
514
|
+
end
|
515
|
+
|
516
|
+
#
|
517
|
+
# Gets the configuration of service URI and custom headers for the webhook.
|
518
|
+
#
|
519
|
+
# @param resource_group_name [String] The name of the resource group to which
|
520
|
+
# the container registry belongs.
|
521
|
+
# @param registry_name [String] The name of the container registry.
|
522
|
+
# @param webhook_name [String] The name of the webhook.
|
523
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
524
|
+
# to the HTTP request.
|
525
|
+
#
|
526
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
527
|
+
#
|
528
|
+
def get_callback_config_async(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
529
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
530
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
531
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
532
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
533
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
534
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
535
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
536
|
+
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?
|
537
|
+
fail ArgumentError, 'webhook_name is nil' if webhook_name.nil?
|
538
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MaxLength': '50'" if !webhook_name.nil? && webhook_name.length > 50
|
539
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MinLength': '5'" if !webhook_name.nil? && webhook_name.length < 5
|
540
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !webhook_name.nil? && webhook_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
541
|
+
|
542
|
+
|
543
|
+
request_headers = {}
|
544
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
545
|
+
|
546
|
+
# Set Headers
|
547
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
548
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
549
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig'
|
550
|
+
|
551
|
+
request_url = @base_url || @client.base_url
|
552
|
+
|
553
|
+
options = {
|
554
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
555
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name},
|
556
|
+
query_params: {'api-version' => @client.api_version},
|
557
|
+
headers: request_headers.merge(custom_headers || {}),
|
558
|
+
base_url: request_url
|
559
|
+
}
|
560
|
+
promise = @client.make_request_async(:post, path_template, options)
|
561
|
+
|
562
|
+
promise = promise.then do |result|
|
563
|
+
http_response = result.response
|
564
|
+
status_code = http_response.status
|
565
|
+
response_content = http_response.body
|
566
|
+
unless status_code == 200
|
567
|
+
error_model = JSON.load(response_content)
|
568
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
569
|
+
end
|
570
|
+
|
571
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
572
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
573
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
574
|
+
# Deserialize Response
|
575
|
+
if status_code == 200
|
576
|
+
begin
|
577
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
578
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::CallbackConfig.mapper()
|
579
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
580
|
+
rescue Exception => e
|
581
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
582
|
+
end
|
583
|
+
end
|
584
|
+
|
585
|
+
result
|
586
|
+
end
|
587
|
+
|
588
|
+
promise.execute
|
589
|
+
end
|
590
|
+
|
591
|
+
#
|
592
|
+
# Lists recent events for the specified webhook.
|
593
|
+
#
|
594
|
+
# @param resource_group_name [String] The name of the resource group to which
|
595
|
+
# the container registry belongs.
|
596
|
+
# @param registry_name [String] The name of the container registry.
|
597
|
+
# @param webhook_name [String] The name of the webhook.
|
598
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
599
|
+
# will be added to the HTTP request.
|
600
|
+
#
|
601
|
+
# @return [Array<Event>] operation results.
|
602
|
+
#
|
603
|
+
def list_events(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
604
|
+
first_page = list_events_as_lazy(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers)
|
605
|
+
first_page.get_all_items
|
606
|
+
end
|
607
|
+
|
608
|
+
#
|
609
|
+
# Lists recent events for the specified webhook.
|
610
|
+
#
|
611
|
+
# @param resource_group_name [String] The name of the resource group to which
|
612
|
+
# the container registry belongs.
|
613
|
+
# @param registry_name [String] The name of the container registry.
|
614
|
+
# @param webhook_name [String] The name of the webhook.
|
615
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
616
|
+
# will be added to the HTTP request.
|
617
|
+
#
|
618
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
619
|
+
#
|
620
|
+
def list_events_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
621
|
+
list_events_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
622
|
+
end
|
623
|
+
|
624
|
+
#
|
625
|
+
# Lists recent events for the specified webhook.
|
626
|
+
#
|
627
|
+
# @param resource_group_name [String] The name of the resource group to which
|
628
|
+
# the container registry belongs.
|
629
|
+
# @param registry_name [String] The name of the container registry.
|
630
|
+
# @param webhook_name [String] The name of the webhook.
|
631
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
632
|
+
# to the HTTP request.
|
633
|
+
#
|
634
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
635
|
+
#
|
636
|
+
def list_events_async(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
637
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
638
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
639
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
640
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
641
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
642
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
643
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
644
|
+
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?
|
645
|
+
fail ArgumentError, 'webhook_name is nil' if webhook_name.nil?
|
646
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MaxLength': '50'" if !webhook_name.nil? && webhook_name.length > 50
|
647
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MinLength': '5'" if !webhook_name.nil? && webhook_name.length < 5
|
648
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !webhook_name.nil? && webhook_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
649
|
+
|
650
|
+
|
651
|
+
request_headers = {}
|
652
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
653
|
+
|
654
|
+
# Set Headers
|
655
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
656
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
657
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents'
|
658
|
+
|
659
|
+
request_url = @base_url || @client.base_url
|
660
|
+
|
661
|
+
options = {
|
662
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
663
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name},
|
664
|
+
query_params: {'api-version' => @client.api_version},
|
665
|
+
headers: request_headers.merge(custom_headers || {}),
|
666
|
+
base_url: request_url
|
667
|
+
}
|
668
|
+
promise = @client.make_request_async(:post, path_template, options)
|
669
|
+
|
670
|
+
promise = promise.then do |result|
|
671
|
+
http_response = result.response
|
672
|
+
status_code = http_response.status
|
673
|
+
response_content = http_response.body
|
674
|
+
unless status_code == 200
|
675
|
+
error_model = JSON.load(response_content)
|
676
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
677
|
+
end
|
678
|
+
|
679
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
680
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
681
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
682
|
+
# Deserialize Response
|
683
|
+
if status_code == 200
|
684
|
+
begin
|
685
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
686
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::EventListResult.mapper()
|
687
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
688
|
+
rescue Exception => e
|
689
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
690
|
+
end
|
691
|
+
end
|
692
|
+
|
693
|
+
result
|
694
|
+
end
|
695
|
+
|
696
|
+
promise.execute
|
697
|
+
end
|
698
|
+
|
699
|
+
#
|
700
|
+
# Creates a webhook for a container registry with the specified parameters.
|
701
|
+
#
|
702
|
+
# @param resource_group_name [String] The name of the resource group to which
|
703
|
+
# the container registry belongs.
|
704
|
+
# @param registry_name [String] The name of the container registry.
|
705
|
+
# @param webhook_name [String] The name of the webhook.
|
706
|
+
# @param webhook_create_parameters [WebhookCreateParameters] The parameters for
|
707
|
+
# creating a webhook.
|
708
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
709
|
+
# will be added to the HTTP request.
|
710
|
+
#
|
711
|
+
# @return [Webhook] operation results.
|
712
|
+
#
|
713
|
+
def begin_create(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers:nil)
|
714
|
+
response = begin_create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers:custom_headers).value!
|
715
|
+
response.body unless response.nil?
|
716
|
+
end
|
717
|
+
|
718
|
+
#
|
719
|
+
# Creates a webhook for a container registry with the specified parameters.
|
720
|
+
#
|
721
|
+
# @param resource_group_name [String] The name of the resource group to which
|
722
|
+
# the container registry belongs.
|
723
|
+
# @param registry_name [String] The name of the container registry.
|
724
|
+
# @param webhook_name [String] The name of the webhook.
|
725
|
+
# @param webhook_create_parameters [WebhookCreateParameters] The parameters for
|
726
|
+
# creating a webhook.
|
727
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
728
|
+
# will be added to the HTTP request.
|
729
|
+
#
|
730
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
731
|
+
#
|
732
|
+
def begin_create_with_http_info(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers:nil)
|
733
|
+
begin_create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers:custom_headers).value!
|
734
|
+
end
|
735
|
+
|
736
|
+
#
|
737
|
+
# Creates a webhook for a container registry with the specified parameters.
|
738
|
+
#
|
739
|
+
# @param resource_group_name [String] The name of the resource group to which
|
740
|
+
# the container registry belongs.
|
741
|
+
# @param registry_name [String] The name of the container registry.
|
742
|
+
# @param webhook_name [String] The name of the webhook.
|
743
|
+
# @param webhook_create_parameters [WebhookCreateParameters] The parameters for
|
744
|
+
# creating a webhook.
|
745
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
746
|
+
# to the HTTP request.
|
747
|
+
#
|
748
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
749
|
+
#
|
750
|
+
def begin_create_async(resource_group_name, registry_name, webhook_name, webhook_create_parameters, custom_headers:nil)
|
751
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
752
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
753
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
754
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
755
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
756
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
757
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
758
|
+
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?
|
759
|
+
fail ArgumentError, 'webhook_name is nil' if webhook_name.nil?
|
760
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MaxLength': '50'" if !webhook_name.nil? && webhook_name.length > 50
|
761
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MinLength': '5'" if !webhook_name.nil? && webhook_name.length < 5
|
762
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !webhook_name.nil? && webhook_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
763
|
+
fail ArgumentError, 'webhook_create_parameters is nil' if webhook_create_parameters.nil?
|
764
|
+
|
765
|
+
|
766
|
+
request_headers = {}
|
767
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
768
|
+
|
769
|
+
# Set Headers
|
770
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
771
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
772
|
+
|
773
|
+
# Serialize Request
|
774
|
+
request_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::WebhookCreateParameters.mapper()
|
775
|
+
request_content = @client.serialize(request_mapper, webhook_create_parameters)
|
776
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
777
|
+
|
778
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'
|
779
|
+
|
780
|
+
request_url = @base_url || @client.base_url
|
781
|
+
|
782
|
+
options = {
|
783
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
784
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name},
|
785
|
+
query_params: {'api-version' => @client.api_version},
|
786
|
+
body: request_content,
|
787
|
+
headers: request_headers.merge(custom_headers || {}),
|
788
|
+
base_url: request_url
|
789
|
+
}
|
790
|
+
promise = @client.make_request_async(:put, path_template, options)
|
791
|
+
|
792
|
+
promise = promise.then do |result|
|
793
|
+
http_response = result.response
|
794
|
+
status_code = http_response.status
|
795
|
+
response_content = http_response.body
|
796
|
+
unless status_code == 200 || status_code == 201
|
797
|
+
error_model = JSON.load(response_content)
|
798
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
799
|
+
end
|
800
|
+
|
801
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
802
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
803
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
804
|
+
# Deserialize Response
|
805
|
+
if status_code == 200
|
806
|
+
begin
|
807
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
808
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::Webhook.mapper()
|
809
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
810
|
+
rescue Exception => e
|
811
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
812
|
+
end
|
813
|
+
end
|
814
|
+
# Deserialize Response
|
815
|
+
if status_code == 201
|
816
|
+
begin
|
817
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
818
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::Webhook.mapper()
|
819
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
820
|
+
rescue Exception => e
|
821
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
822
|
+
end
|
823
|
+
end
|
824
|
+
|
825
|
+
result
|
826
|
+
end
|
827
|
+
|
828
|
+
promise.execute
|
829
|
+
end
|
830
|
+
|
831
|
+
#
|
832
|
+
# Deletes a webhook from a container registry.
|
833
|
+
#
|
834
|
+
# @param resource_group_name [String] The name of the resource group to which
|
835
|
+
# the container registry belongs.
|
836
|
+
# @param registry_name [String] The name of the container registry.
|
837
|
+
# @param webhook_name [String] The name of the webhook.
|
838
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
839
|
+
# will be added to the HTTP request.
|
840
|
+
#
|
841
|
+
#
|
842
|
+
def begin_delete(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
843
|
+
response = begin_delete_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
844
|
+
nil
|
845
|
+
end
|
846
|
+
|
847
|
+
#
|
848
|
+
# Deletes a webhook from a container registry.
|
849
|
+
#
|
850
|
+
# @param resource_group_name [String] The name of the resource group to which
|
851
|
+
# the container registry belongs.
|
852
|
+
# @param registry_name [String] The name of the container registry.
|
853
|
+
# @param webhook_name [String] The name of the webhook.
|
854
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
855
|
+
# will be added to the HTTP request.
|
856
|
+
#
|
857
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
858
|
+
#
|
859
|
+
def begin_delete_with_http_info(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
860
|
+
begin_delete_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
861
|
+
end
|
862
|
+
|
863
|
+
#
|
864
|
+
# Deletes a webhook from a container registry.
|
865
|
+
#
|
866
|
+
# @param resource_group_name [String] The name of the resource group to which
|
867
|
+
# the container registry belongs.
|
868
|
+
# @param registry_name [String] The name of the container registry.
|
869
|
+
# @param webhook_name [String] The name of the webhook.
|
870
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
871
|
+
# to the HTTP request.
|
872
|
+
#
|
873
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
874
|
+
#
|
875
|
+
def begin_delete_async(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
876
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
877
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
878
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
879
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
880
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
881
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
882
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
883
|
+
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?
|
884
|
+
fail ArgumentError, 'webhook_name is nil' if webhook_name.nil?
|
885
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MaxLength': '50'" if !webhook_name.nil? && webhook_name.length > 50
|
886
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MinLength': '5'" if !webhook_name.nil? && webhook_name.length < 5
|
887
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !webhook_name.nil? && webhook_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
888
|
+
|
889
|
+
|
890
|
+
request_headers = {}
|
891
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
892
|
+
|
893
|
+
# Set Headers
|
894
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
895
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
896
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'
|
897
|
+
|
898
|
+
request_url = @base_url || @client.base_url
|
899
|
+
|
900
|
+
options = {
|
901
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
902
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name},
|
903
|
+
query_params: {'api-version' => @client.api_version},
|
904
|
+
headers: request_headers.merge(custom_headers || {}),
|
905
|
+
base_url: request_url
|
906
|
+
}
|
907
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
908
|
+
|
909
|
+
promise = promise.then do |result|
|
910
|
+
http_response = result.response
|
911
|
+
status_code = http_response.status
|
912
|
+
response_content = http_response.body
|
913
|
+
unless status_code == 200 || status_code == 202 || status_code == 204
|
914
|
+
error_model = JSON.load(response_content)
|
915
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
916
|
+
end
|
917
|
+
|
918
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
919
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
920
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
921
|
+
|
922
|
+
result
|
923
|
+
end
|
924
|
+
|
925
|
+
promise.execute
|
926
|
+
end
|
927
|
+
|
928
|
+
#
|
929
|
+
# Updates a webhook with the specified parameters.
|
930
|
+
#
|
931
|
+
# @param resource_group_name [String] The name of the resource group to which
|
932
|
+
# the container registry belongs.
|
933
|
+
# @param registry_name [String] The name of the container registry.
|
934
|
+
# @param webhook_name [String] The name of the webhook.
|
935
|
+
# @param webhook_update_parameters [WebhookUpdateParameters] The parameters for
|
936
|
+
# updating a webhook.
|
937
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
938
|
+
# will be added to the HTTP request.
|
939
|
+
#
|
940
|
+
# @return [Webhook] operation results.
|
941
|
+
#
|
942
|
+
def begin_update(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:nil)
|
943
|
+
response = begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:custom_headers).value!
|
944
|
+
response.body unless response.nil?
|
945
|
+
end
|
946
|
+
|
947
|
+
#
|
948
|
+
# Updates a webhook with the specified parameters.
|
949
|
+
#
|
950
|
+
# @param resource_group_name [String] The name of the resource group to which
|
951
|
+
# the container registry belongs.
|
952
|
+
# @param registry_name [String] The name of the container registry.
|
953
|
+
# @param webhook_name [String] The name of the webhook.
|
954
|
+
# @param webhook_update_parameters [WebhookUpdateParameters] The parameters for
|
955
|
+
# updating a webhook.
|
956
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
957
|
+
# will be added to the HTTP request.
|
958
|
+
#
|
959
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
960
|
+
#
|
961
|
+
def begin_update_with_http_info(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:nil)
|
962
|
+
begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:custom_headers).value!
|
963
|
+
end
|
964
|
+
|
965
|
+
#
|
966
|
+
# Updates a webhook with the specified parameters.
|
967
|
+
#
|
968
|
+
# @param resource_group_name [String] The name of the resource group to which
|
969
|
+
# the container registry belongs.
|
970
|
+
# @param registry_name [String] The name of the container registry.
|
971
|
+
# @param webhook_name [String] The name of the webhook.
|
972
|
+
# @param webhook_update_parameters [WebhookUpdateParameters] The parameters for
|
973
|
+
# updating a webhook.
|
974
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
975
|
+
# to the HTTP request.
|
976
|
+
#
|
977
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
978
|
+
#
|
979
|
+
def begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:nil)
|
980
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
981
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
982
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
983
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
984
|
+
fail ArgumentError, 'registry_name is nil' if registry_name.nil?
|
985
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MaxLength': '50'" if !registry_name.nil? && registry_name.length > 50
|
986
|
+
fail ArgumentError, "'registry_name' should satisfy the constraint - 'MinLength': '5'" if !registry_name.nil? && registry_name.length < 5
|
987
|
+
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?
|
988
|
+
fail ArgumentError, 'webhook_name is nil' if webhook_name.nil?
|
989
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MaxLength': '50'" if !webhook_name.nil? && webhook_name.length > 50
|
990
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'MinLength': '5'" if !webhook_name.nil? && webhook_name.length < 5
|
991
|
+
fail ArgumentError, "'webhook_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9]*$'" if !webhook_name.nil? && webhook_name.match(Regexp.new('^^[a-zA-Z0-9]*$$')).nil?
|
992
|
+
fail ArgumentError, 'webhook_update_parameters is nil' if webhook_update_parameters.nil?
|
993
|
+
|
994
|
+
|
995
|
+
request_headers = {}
|
996
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
997
|
+
|
998
|
+
# Set Headers
|
999
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1000
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1001
|
+
|
1002
|
+
# Serialize Request
|
1003
|
+
request_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::WebhookUpdateParameters.mapper()
|
1004
|
+
request_content = @client.serialize(request_mapper, webhook_update_parameters)
|
1005
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1006
|
+
|
1007
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}'
|
1008
|
+
|
1009
|
+
request_url = @base_url || @client.base_url
|
1010
|
+
|
1011
|
+
options = {
|
1012
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1013
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'registryName' => registry_name,'webhookName' => webhook_name},
|
1014
|
+
query_params: {'api-version' => @client.api_version},
|
1015
|
+
body: request_content,
|
1016
|
+
headers: request_headers.merge(custom_headers || {}),
|
1017
|
+
base_url: request_url
|
1018
|
+
}
|
1019
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
1020
|
+
|
1021
|
+
promise = promise.then do |result|
|
1022
|
+
http_response = result.response
|
1023
|
+
status_code = http_response.status
|
1024
|
+
response_content = http_response.body
|
1025
|
+
unless status_code == 200 || status_code == 201
|
1026
|
+
error_model = JSON.load(response_content)
|
1027
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1028
|
+
end
|
1029
|
+
|
1030
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1031
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1032
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1033
|
+
# Deserialize Response
|
1034
|
+
if status_code == 200
|
1035
|
+
begin
|
1036
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1037
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::Webhook.mapper()
|
1038
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1039
|
+
rescue Exception => e
|
1040
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1041
|
+
end
|
1042
|
+
end
|
1043
|
+
# Deserialize Response
|
1044
|
+
if status_code == 201
|
1045
|
+
begin
|
1046
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1047
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::Webhook.mapper()
|
1048
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1049
|
+
rescue Exception => e
|
1050
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1051
|
+
end
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
result
|
1055
|
+
end
|
1056
|
+
|
1057
|
+
promise.execute
|
1058
|
+
end
|
1059
|
+
|
1060
|
+
#
|
1061
|
+
# Lists all the webhooks for the specified container registry.
|
1062
|
+
#
|
1063
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1064
|
+
# to List operation.
|
1065
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1066
|
+
# will be added to the HTTP request.
|
1067
|
+
#
|
1068
|
+
# @return [WebhookListResult] operation results.
|
1069
|
+
#
|
1070
|
+
def list_next(next_page_link, custom_headers:nil)
|
1071
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
1072
|
+
response.body unless response.nil?
|
1073
|
+
end
|
1074
|
+
|
1075
|
+
#
|
1076
|
+
# Lists all the webhooks for the specified container registry.
|
1077
|
+
#
|
1078
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1079
|
+
# to List operation.
|
1080
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1081
|
+
# will be added to the HTTP request.
|
1082
|
+
#
|
1083
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1084
|
+
#
|
1085
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
1086
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
1087
|
+
end
|
1088
|
+
|
1089
|
+
#
|
1090
|
+
# Lists all the webhooks for the specified container registry.
|
1091
|
+
#
|
1092
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1093
|
+
# to List operation.
|
1094
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1095
|
+
# to the HTTP request.
|
1096
|
+
#
|
1097
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1098
|
+
#
|
1099
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
1100
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1101
|
+
|
1102
|
+
|
1103
|
+
request_headers = {}
|
1104
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1105
|
+
|
1106
|
+
# Set Headers
|
1107
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1108
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1109
|
+
path_template = '{nextLink}'
|
1110
|
+
|
1111
|
+
request_url = @base_url || @client.base_url
|
1112
|
+
|
1113
|
+
options = {
|
1114
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1115
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
1116
|
+
headers: request_headers.merge(custom_headers || {}),
|
1117
|
+
base_url: request_url
|
1118
|
+
}
|
1119
|
+
promise = @client.make_request_async(:get, path_template, options)
|
1120
|
+
|
1121
|
+
promise = promise.then do |result|
|
1122
|
+
http_response = result.response
|
1123
|
+
status_code = http_response.status
|
1124
|
+
response_content = http_response.body
|
1125
|
+
unless status_code == 200
|
1126
|
+
error_model = JSON.load(response_content)
|
1127
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1128
|
+
end
|
1129
|
+
|
1130
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1131
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1132
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1133
|
+
# Deserialize Response
|
1134
|
+
if status_code == 200
|
1135
|
+
begin
|
1136
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1137
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::WebhookListResult.mapper()
|
1138
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1139
|
+
rescue Exception => e
|
1140
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1141
|
+
end
|
1142
|
+
end
|
1143
|
+
|
1144
|
+
result
|
1145
|
+
end
|
1146
|
+
|
1147
|
+
promise.execute
|
1148
|
+
end
|
1149
|
+
|
1150
|
+
#
|
1151
|
+
# Lists recent events for the specified webhook.
|
1152
|
+
#
|
1153
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1154
|
+
# to List operation.
|
1155
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1156
|
+
# will be added to the HTTP request.
|
1157
|
+
#
|
1158
|
+
# @return [EventListResult] operation results.
|
1159
|
+
#
|
1160
|
+
def list_events_next(next_page_link, custom_headers:nil)
|
1161
|
+
response = list_events_next_async(next_page_link, custom_headers:custom_headers).value!
|
1162
|
+
response.body unless response.nil?
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
#
|
1166
|
+
# Lists recent events for the specified webhook.
|
1167
|
+
#
|
1168
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1169
|
+
# to List operation.
|
1170
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1171
|
+
# will be added to the HTTP request.
|
1172
|
+
#
|
1173
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1174
|
+
#
|
1175
|
+
def list_events_next_with_http_info(next_page_link, custom_headers:nil)
|
1176
|
+
list_events_next_async(next_page_link, custom_headers:custom_headers).value!
|
1177
|
+
end
|
1178
|
+
|
1179
|
+
#
|
1180
|
+
# Lists recent events for the specified webhook.
|
1181
|
+
#
|
1182
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1183
|
+
# to List operation.
|
1184
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1185
|
+
# to the HTTP request.
|
1186
|
+
#
|
1187
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1188
|
+
#
|
1189
|
+
def list_events_next_async(next_page_link, custom_headers:nil)
|
1190
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1191
|
+
|
1192
|
+
|
1193
|
+
request_headers = {}
|
1194
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1195
|
+
|
1196
|
+
# Set Headers
|
1197
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1198
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1199
|
+
path_template = '{nextLink}'
|
1200
|
+
|
1201
|
+
request_url = @base_url || @client.base_url
|
1202
|
+
|
1203
|
+
options = {
|
1204
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1205
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
1206
|
+
headers: request_headers.merge(custom_headers || {}),
|
1207
|
+
base_url: request_url
|
1208
|
+
}
|
1209
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1210
|
+
|
1211
|
+
promise = promise.then do |result|
|
1212
|
+
http_response = result.response
|
1213
|
+
status_code = http_response.status
|
1214
|
+
response_content = http_response.body
|
1215
|
+
unless status_code == 200
|
1216
|
+
error_model = JSON.load(response_content)
|
1217
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1218
|
+
end
|
1219
|
+
|
1220
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1221
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1222
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1223
|
+
# Deserialize Response
|
1224
|
+
if status_code == 200
|
1225
|
+
begin
|
1226
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1227
|
+
result_mapper = Azure::ContainerRegistry::Mgmt::V2019_05_01::Models::EventListResult.mapper()
|
1228
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1229
|
+
rescue Exception => e
|
1230
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1231
|
+
end
|
1232
|
+
end
|
1233
|
+
|
1234
|
+
result
|
1235
|
+
end
|
1236
|
+
|
1237
|
+
promise.execute
|
1238
|
+
end
|
1239
|
+
|
1240
|
+
#
|
1241
|
+
# Lists all the webhooks for the specified container registry.
|
1242
|
+
#
|
1243
|
+
# @param resource_group_name [String] The name of the resource group to which
|
1244
|
+
# the container registry belongs.
|
1245
|
+
# @param registry_name [String] The name of the container registry.
|
1246
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1247
|
+
# will be added to the HTTP request.
|
1248
|
+
#
|
1249
|
+
# @return [WebhookListResult] which provide lazy access to pages of the
|
1250
|
+
# response.
|
1251
|
+
#
|
1252
|
+
def list_as_lazy(resource_group_name, registry_name, custom_headers:nil)
|
1253
|
+
response = list_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
|
1254
|
+
unless response.nil?
|
1255
|
+
page = response.body
|
1256
|
+
page.next_method = Proc.new do |next_page_link|
|
1257
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
1258
|
+
end
|
1259
|
+
page
|
1260
|
+
end
|
1261
|
+
end
|
1262
|
+
|
1263
|
+
#
|
1264
|
+
# Lists recent events for the specified webhook.
|
1265
|
+
#
|
1266
|
+
# @param resource_group_name [String] The name of the resource group to which
|
1267
|
+
# the container registry belongs.
|
1268
|
+
# @param registry_name [String] The name of the container registry.
|
1269
|
+
# @param webhook_name [String] The name of the webhook.
|
1270
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1271
|
+
# will be added to the HTTP request.
|
1272
|
+
#
|
1273
|
+
# @return [EventListResult] which provide lazy access to pages of the response.
|
1274
|
+
#
|
1275
|
+
def list_events_as_lazy(resource_group_name, registry_name, webhook_name, custom_headers:nil)
|
1276
|
+
response = list_events_async(resource_group_name, registry_name, webhook_name, custom_headers:custom_headers).value!
|
1277
|
+
unless response.nil?
|
1278
|
+
page = response.body
|
1279
|
+
page.next_method = Proc.new do |next_page_link|
|
1280
|
+
list_events_next_async(next_page_link, custom_headers:custom_headers)
|
1281
|
+
end
|
1282
|
+
page
|
1283
|
+
end
|
1284
|
+
end
|
1285
|
+
|
1286
|
+
end
|
1287
|
+
end
|