diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance.rb new file mode 100644 index 0000000000..4bb564e53f --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance.rb @@ -0,0 +1,67 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2018-04-01/generated/azure_mgmt_container_instance/module_definition' +require 'ms_rest_azure' + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + autoload :ContainerGroups, '2018-04-01/generated/azure_mgmt_container_instance/container_groups.rb' + autoload :Operations, '2018-04-01/generated/azure_mgmt_container_instance/operations.rb' + autoload :ContainerGroupUsage, '2018-04-01/generated/azure_mgmt_container_instance/container_group_usage.rb' + autoload :ContainerLogs, '2018-04-01/generated/azure_mgmt_container_instance/container_logs.rb' + autoload :StartContainer, '2018-04-01/generated/azure_mgmt_container_instance/start_container.rb' + autoload :ContainerInstanceManagementClient, '2018-04-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb' + + module Models + autoload :IpAddress, '2018-04-01/generated/azure_mgmt_container_instance/models/ip_address.rb' + autoload :ContainerPort, '2018-04-01/generated/azure_mgmt_container_instance/models/container_port.rb' + autoload :ContainerGroupPropertiesInstanceView, '2018-04-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb' + autoload :ContainerState, '2018-04-01/generated/azure_mgmt_container_instance/models/container_state.rb' + autoload :Event, '2018-04-01/generated/azure_mgmt_container_instance/models/event.rb' + autoload :ResourceRequests, '2018-04-01/generated/azure_mgmt_container_instance/models/resource_requests.rb' + autoload :OperationDisplay, '2018-04-01/generated/azure_mgmt_container_instance/models/operation_display.rb' + autoload :ResourceRequirements, '2018-04-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb' + autoload :Operation, '2018-04-01/generated/azure_mgmt_container_instance/models/operation.rb' + autoload :Container, '2018-04-01/generated/azure_mgmt_container_instance/models/container.rb' + autoload :OperationListResult, '2018-04-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb' + autoload :GitRepoVolume, '2018-04-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb' + autoload :UsageName, '2018-04-01/generated/azure_mgmt_container_instance/models/usage_name.rb' + autoload :ImageRegistryCredential, '2018-04-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb' + autoload :Usage, '2018-04-01/generated/azure_mgmt_container_instance/models/usage.rb' + autoload :EnvironmentVariable, '2018-04-01/generated/azure_mgmt_container_instance/models/environment_variable.rb' + autoload :UsageListResult, '2018-04-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb' + autoload :ResourceLimits, '2018-04-01/generated/azure_mgmt_container_instance/models/resource_limits.rb' + autoload :ContainerGroupListResult, '2018-04-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb' + autoload :AzureFileVolume, '2018-04-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb' + autoload :Logs, '2018-04-01/generated/azure_mgmt_container_instance/models/logs.rb' + autoload :Port, '2018-04-01/generated/azure_mgmt_container_instance/models/port.rb' + autoload :ContainerExecRequestTerminalSize, '2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb' + autoload :VolumeMount, '2018-04-01/generated/azure_mgmt_container_instance/models/volume_mount.rb' + autoload :ContainerExecRequest, '2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb' + autoload :ContainerPropertiesInstanceView, '2018-04-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb' + autoload :ContainerExecResponse, '2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb' + autoload :Volume, '2018-04-01/generated/azure_mgmt_container_instance/models/volume.rb' + autoload :Resource, '2018-04-01/generated/azure_mgmt_container_instance/models/resource.rb' + autoload :ContainerGroup, '2018-04-01/generated/azure_mgmt_container_instance/models/container_group.rb' + autoload :ContainerNetworkProtocol, '2018-04-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb' + autoload :ContainerGroupRestartPolicy, '2018-04-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb' + autoload :ContainerGroupNetworkProtocol, '2018-04-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb' + autoload :OperatingSystemTypes, '2018-04-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb' + autoload :ContainerInstanceOperationsOrigin, '2018-04-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb' + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_group_usage.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_group_usage.rb new file mode 100644 index 0000000000..8fc45c23c4 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_group_usage.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # ContainerGroupUsage + # + class ContainerGroupUsage + include MsRestAzure + + # + # Creates and initializes a new instance of the ContainerGroupUsage class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Get the usage for a subscription + # + # @param location [String] The identifier for the physical azure location. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsageListResult] operation results. + # + def list(location, custom_headers = nil) + response = list_async(location, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the usage for a subscription + # + # @param location [String] The identifier for the physical azure location. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(location, custom_headers = nil) + list_async(location, custom_headers).value! + end + + # + # Get the usage for a subscription + # + # @param location [String] The identifier for the physical azure location. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(location, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'location' => location}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::UsageListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_groups.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_groups.rb new file mode 100644 index 0000000000..daf4b48b8a --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_groups.rb @@ -0,0 +1,980 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # ContainerGroups + # + class ContainerGroups + include MsRestAzure + + # + # Creates and initializes a new instance of the ContainerGroups class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) + first_page.get_all_items + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, custom_headers = nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers) + first_page.get_all_items + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil) + list_by_resource_group_async(resource_group_name, custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get the properties of the specified container group. + # + # Gets the properties of the specified container group in the specified + # subscription and resource group. The operation returns the properties of each + # container group including containers, image registry credentials, restart + # policy, IP address type, OS type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def get(resource_group_name, container_group_name, custom_headers = nil) + response = get_async(resource_group_name, container_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the properties of the specified container group. + # + # Gets the properties of the specified container group in the specified + # subscription and resource group. The operation returns the properties of each + # container group including containers, image registry credentials, restart + # policy, IP address type, OS type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + get_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Get the properties of the specified container group. + # + # Gets the properties of the specified container group in the specified + # subscription and resource group. The operation returns the properties of each + # container group including containers, image registry credentials, restart + # policy, IP address type, OS type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def create_or_update(resource_group_name, container_group_name, container_group, custom_headers = nil) + response = create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers = nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Update container groups. + # + # Updates container group tags with specified values. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param resource [Resource] The container group resource with just the tags to + # be updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def update(resource_group_name, container_group_name, resource, custom_headers = nil) + response = update_async(resource_group_name, container_group_name, resource, custom_headers).value! + response.body unless response.nil? + end + + # + # Update container groups. + # + # Updates container group tags with specified values. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param resource [Resource] The container group resource with just the tags to + # be updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def update_with_http_info(resource_group_name, container_group_name, resource, custom_headers = nil) + update_async(resource_group_name, container_group_name, resource, custom_headers).value! + end + + # + # Update container groups. + # + # Updates container group tags with specified values. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param resource [Resource] The container group resource with just the tags to + # be updated. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def update_async(resource_group_name, container_group_name, resource, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'resource is nil' if resource.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::Resource.mapper() + request_content = @client.serialize(request_mapper, resource) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete the specified container group. + # + # Delete the specified container group in the specified subscription and + # resource group. The operation does not delete other resources provided by the + # user, such as volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def delete(resource_group_name, container_group_name, custom_headers = nil) + response = delete_async(resource_group_name, container_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Delete the specified container group. + # + # Delete the specified container group in the specified subscription and + # resource group. The operation does not delete other resources provided by the + # user, such as volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + delete_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Delete the specified container group. + # + # Delete the specified container group in the specified subscription and + # resource group. The operation does not delete other resources provided by the + # user, such as volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def begin_create_or_update(resource_group_name, container_group_name, container_group, custom_headers = nil) + response = begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, container_group_name, container_group, custom_headers = nil) + begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers).value! + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'container_group is nil' if container_group.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + request_content = @client.serialize(request_mapper, container_group) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil) + list_by_resource_group_next_async(next_page_link, custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers = nil) + response = list_async(custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] which provide lazy access to pages of the + # response. + # + def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil) + response = list_by_resource_group_async(resource_group_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb new file mode 100644 index 0000000000..f53a3b691d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb @@ -0,0 +1,147 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # A service client - single point of access to the REST API. + # + class ContainerInstanceManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] Subscription credentials which uniquely identify + # Microsoft Azure subscription. The subscription ID forms part of the URI + # for every service call. + attr_accessor :subscription_id + + # @return [String] Client API version + attr_reader :api_version + + # @return [String] Gets or sets the preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] Gets or sets the retry timeout in seconds for Long + # Running Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] When set to true a unique x-ms-client-request-id value + # is generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [ContainerGroups] container_groups + attr_reader :container_groups + + # @return [Operations] operations + attr_reader :operations + + # @return [ContainerGroupUsage] container_group_usage + attr_reader :container_group_usage + + # @return [ContainerLogs] container_logs + attr_reader :container_logs + + # @return [StartContainer] start_container + attr_reader :start_container + + # + # Creates initializes a new instance of the ContainerInstanceManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @container_groups = ContainerGroups.new(self) + @operations = Operations.new(self) + @container_group_usage = ContainerGroupUsage.new(self) + @container_logs = ContainerLogs.new(self) + @start_container = StartContainer.new(self) + @api_version = '2018-04-01' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_container_instance' + if defined? Azure::ContainerInstance::Mgmt::V2018_02_01_preview::VERSION + sdk_information = "#{sdk_information}/#{Azure::ContainerInstance::Mgmt::V2018_02_01_preview::VERSION}" + end + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_logs.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_logs.rb new file mode 100644 index 0000000000..7e8a7723f9 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/container_logs.rb @@ -0,0 +1,138 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # ContainerLogs + # + class ContainerLogs + include MsRestAzure + + # + # Creates and initializes a new instance of the ContainerLogs class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Get the logs for a specified container instance. + # + # Get the logs for a specified container instance in a specified resource group + # and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param tail [Integer] The number of lines to show from the tail of the + # container instance log. If not provided, all available logs are shown up to + # 4mb. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Logs] operation results. + # + def list(resource_group_name, container_group_name, container_name, tail = nil, custom_headers = nil) + response = list_async(resource_group_name, container_group_name, container_name, tail, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the logs for a specified container instance. + # + # Get the logs for a specified container instance in a specified resource group + # and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param tail [Integer] The number of lines to show from the tail of the + # container instance log. If not provided, all available logs are shown up to + # 4mb. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(resource_group_name, container_group_name, container_name, tail = nil, custom_headers = nil) + list_async(resource_group_name, container_group_name, container_name, tail, custom_headers).value! + end + + # + # Get the logs for a specified container instance. + # + # Get the logs for a specified container instance in a specified resource group + # and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param tail [Integer] The number of lines to show from the tail of the + # container instance log. If not provided, all available logs are shown up to + # 4mb. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(resource_group_name, container_group_name, container_name, tail = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version,'tail' => tail}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::Logs.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb new file mode 100644 index 0000000000..ca1fcc2318 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The properties of the Azure File volume. Azure File shares are mounted as + # volumes. + # + class AzureFileVolume + + include MsRestAzure + + # @return [String] The name of the Azure File share to be mounted as a + # volume. + attr_accessor :share_name + + # @return [Boolean] The flag indicating whether the Azure File shared + # mounted as a volume is read-only. + attr_accessor :read_only + + # @return [String] The name of the storage account that contains the + # Azure File share. + attr_accessor :storage_account_name + + # @return [String] The storage account access key used to access the + # Azure File share. + attr_accessor :storage_account_key + + + # + # Mapper for AzureFileVolume class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AzureFileVolume', + type: { + name: 'Composite', + class_name: 'AzureFileVolume', + model_properties: { + share_name: { + required: true, + serialized_name: 'shareName', + type: { + name: 'String' + } + }, + read_only: { + required: false, + serialized_name: 'readOnly', + type: { + name: 'Boolean' + } + }, + storage_account_name: { + required: true, + serialized_name: 'storageAccountName', + type: { + name: 'String' + } + }, + storage_account_key: { + required: false, + serialized_name: 'storageAccountKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container.rb new file mode 100644 index 0000000000..5d78e7ceb2 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container.rb @@ -0,0 +1,155 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A container instance. + # + class Container + + include MsRestAzure + + # @return [String] The user-provided name of the container instance. + attr_accessor :name + + # @return [String] The name of the image used to create the container + # instance. + attr_accessor :image + + # @return [Array] The commands to execute within the container + # instance in exec form. + attr_accessor :command + + # @return [Array] The exposed ports on the container + # instance. + attr_accessor :ports + + # @return [Array] The environment variables to set + # in the container instance. + attr_accessor :environment_variables + + # @return [ContainerPropertiesInstanceView] The instance view of the + # container instance. Only valid in response. + attr_accessor :instance_view + + # @return [ResourceRequirements] The resource requirements of the + # container instance. + attr_accessor :resources + + # @return [Array] The volume mounts available to the + # container instance. + attr_accessor :volume_mounts + + + # + # Mapper for Container class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Container', + type: { + name: 'Composite', + class_name: 'Container', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + image: { + required: true, + serialized_name: 'properties.image', + type: { + name: 'String' + } + }, + command: { + required: false, + serialized_name: 'properties.command', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + ports: { + required: false, + serialized_name: 'properties.ports', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ContainerPortElementType', + type: { + name: 'Composite', + class_name: 'ContainerPort' + } + } + } + }, + environment_variables: { + required: false, + serialized_name: 'properties.environmentVariables', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EnvironmentVariableElementType', + type: { + name: 'Composite', + class_name: 'EnvironmentVariable' + } + } + } + }, + instance_view: { + required: false, + read_only: true, + serialized_name: 'properties.instanceView', + type: { + name: 'Composite', + class_name: 'ContainerPropertiesInstanceView' + } + }, + resources: { + required: true, + serialized_name: 'properties.resources', + type: { + name: 'Composite', + class_name: 'ResourceRequirements' + } + }, + volume_mounts: { + required: false, + serialized_name: 'properties.volumeMounts', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'VolumeMountElementType', + type: { + name: 'Composite', + class_name: 'VolumeMount' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb new file mode 100644 index 0000000000..e78c55b51e --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The start container exec request. + # + class ContainerExecRequest + + include MsRestAzure + + # @return [String] The command to be executed. + attr_accessor :command + + # @return [ContainerExecRequestTerminalSize] The size of the terminal. + attr_accessor :terminal_size + + + # + # Mapper for ContainerExecRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExecRequest', + type: { + name: 'Composite', + class_name: 'ContainerExecRequest', + model_properties: { + command: { + required: false, + serialized_name: 'command', + type: { + name: 'String' + } + }, + terminal_size: { + required: false, + serialized_name: 'terminalSize', + type: { + name: 'Composite', + class_name: 'ContainerExecRequestTerminalSize' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb new file mode 100644 index 0000000000..8a2d8a7fd8 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The size of the terminal. + # + class ContainerExecRequestTerminalSize + + include MsRestAzure + + # @return [Integer] The row size of the terminal + attr_accessor :row + + # @return [Integer] The column size of the terminal + attr_accessor :column + + + # + # Mapper for ContainerExecRequestTerminalSize class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExecRequest_terminalSize', + type: { + name: 'Composite', + class_name: 'ContainerExecRequestTerminalSize', + model_properties: { + row: { + required: false, + serialized_name: 'row', + type: { + name: 'Number' + } + }, + column: { + required: false, + serialized_name: 'column', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb new file mode 100644 index 0000000000..9944f82820 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The information for the container exec command. + # + class ContainerExecResponse + + include MsRestAzure + + # @return [String] The uri for the exec websocket. + attr_accessor :web_socket_uri + + # @return [String] The password to start the exec command. + attr_accessor :password + + + # + # Mapper for ContainerExecResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExecResponse', + type: { + name: 'Composite', + class_name: 'ContainerExecResponse', + model_properties: { + web_socket_uri: { + required: false, + read_only: true, + serialized_name: 'webSocketUri', + type: { + name: 'String' + } + }, + password: { + required: false, + read_only: true, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group.rb new file mode 100644 index 0000000000..759a9c1a5b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group.rb @@ -0,0 +1,198 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A container group. + # + class ContainerGroup < Resource + + include MsRestAzure + + # @return [String] The provisioning state of the container group. This + # only appears in the response. + attr_accessor :provisioning_state + + # @return [Array] The containers within the container group. + attr_accessor :containers + + # @return [Array] The image registry credentials + # by which the container group is created from. + attr_accessor :image_registry_credentials + + # @return [ContainerGroupRestartPolicy] Restart policy for all containers + # within the container group. + # - `Always` Always restart + # - `OnFailure` Restart on failure + # - `Never` Never restart + # . Possible values include: 'Always', 'OnFailure', 'Never' + attr_accessor :restart_policy + + # @return [IpAddress] The IP address type of the container group. + attr_accessor :ip_address + + # @return [OperatingSystemTypes] The operating system type required by + # the containers in the container group. Possible values include: + # 'Windows', 'Linux' + attr_accessor :os_type + + # @return [Array] The list of volumes that can be mounted by + # containers in this container group. + attr_accessor :volumes + + # @return [ContainerGroupPropertiesInstanceView] The instance view of the + # container group. Only valid in response. + attr_accessor :instance_view + + + # + # Mapper for ContainerGroup class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroup', + type: { + name: 'Composite', + class_name: 'ContainerGroup', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + containers: { + required: false, + serialized_name: 'properties.containers', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ContainerElementType', + type: { + name: 'Composite', + class_name: 'Container' + } + } + } + }, + image_registry_credentials: { + required: false, + serialized_name: 'properties.imageRegistryCredentials', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ImageRegistryCredentialElementType', + type: { + name: 'Composite', + class_name: 'ImageRegistryCredential' + } + } + } + }, + restart_policy: { + required: false, + serialized_name: 'properties.restartPolicy', + type: { + name: 'String' + } + }, + ip_address: { + required: false, + serialized_name: 'properties.ipAddress', + type: { + name: 'Composite', + class_name: 'IpAddress' + } + }, + os_type: { + required: false, + serialized_name: 'properties.osType', + type: { + name: 'String' + } + }, + volumes: { + required: false, + serialized_name: 'properties.volumes', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'VolumeElementType', + type: { + name: 'Composite', + class_name: 'Volume' + } + } + } + }, + instance_view: { + required: false, + read_only: true, + serialized_name: 'properties.instanceView', + type: { + name: 'Composite', + class_name: 'ContainerGroupPropertiesInstanceView' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb new file mode 100644 index 0000000000..8b6e25e433 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container group list response that contains the container group + # properties. + # + class ContainerGroupListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] The list of container groups. + attr_accessor :value + + # @return [String] The URI to fetch the next page of container groups. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ContainerGroupListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ContainerGroupListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroupListResult', + type: { + name: 'Composite', + class_name: 'ContainerGroupListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ContainerGroupElementType', + type: { + name: 'Composite', + class_name: 'ContainerGroup' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb new file mode 100644 index 0000000000..dab05d0f54 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerGroupNetworkProtocol + # + module ContainerGroupNetworkProtocol + TCP = "TCP" + UDP = "UDP" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb new file mode 100644 index 0000000000..744fce441b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The instance view of the container group. Only valid in response. + # + class ContainerGroupPropertiesInstanceView + + include MsRestAzure + + # @return [Array] The events of this container group. + attr_accessor :events + + # @return [String] The state of the container group. Only valid in + # response. + attr_accessor :state + + + # + # Mapper for ContainerGroupPropertiesInstanceView class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroup_properties_instanceView', + type: { + name: 'Composite', + class_name: 'ContainerGroupPropertiesInstanceView', + model_properties: { + events: { + required: false, + read_only: true, + serialized_name: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EventElementType', + type: { + name: 'Composite', + class_name: 'Event' + } + } + } + }, + state: { + required: false, + read_only: true, + serialized_name: 'state', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb new file mode 100644 index 0000000000..7906ba0862 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerGroupRestartPolicy + # + module ContainerGroupRestartPolicy + Always = "Always" + OnFailure = "OnFailure" + Never = "Never" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb new file mode 100644 index 0000000000..30fbc87af0 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerInstanceOperationsOrigin + # + module ContainerInstanceOperationsOrigin + User = "User" + System = "System" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb new file mode 100644 index 0000000000..4aae6a06ed --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerNetworkProtocol + # + module ContainerNetworkProtocol + TCP = "TCP" + UDP = "UDP" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_port.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_port.rb new file mode 100644 index 0000000000..77f5d53b1d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_port.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The port exposed on the container instance. + # + class ContainerPort + + include MsRestAzure + + # @return [ContainerNetworkProtocol] The protocol associated with the + # port. Possible values include: 'TCP', 'UDP' + attr_accessor :protocol + + # @return [Integer] The port number exposed within the container group. + attr_accessor :port + + + # + # Mapper for ContainerPort class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerPort', + type: { + name: 'Composite', + class_name: 'ContainerPort', + model_properties: { + protocol: { + required: false, + serialized_name: 'protocol', + type: { + name: 'String' + } + }, + port: { + required: true, + serialized_name: 'port', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb new file mode 100644 index 0000000000..a66d37f60b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb @@ -0,0 +1,89 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The instance view of the container instance. Only valid in response. + # + class ContainerPropertiesInstanceView + + include MsRestAzure + + # @return [Integer] The number of times that the container instance has + # been restarted. + attr_accessor :restart_count + + # @return [ContainerState] Current container instance state. + attr_accessor :current_state + + # @return [ContainerState] Previous container instance state. + attr_accessor :previous_state + + # @return [Array] The events of the container instance. + attr_accessor :events + + + # + # Mapper for ContainerPropertiesInstanceView class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerProperties_instanceView', + type: { + name: 'Composite', + class_name: 'ContainerPropertiesInstanceView', + model_properties: { + restart_count: { + required: false, + read_only: true, + serialized_name: 'restartCount', + type: { + name: 'Number' + } + }, + current_state: { + required: false, + read_only: true, + serialized_name: 'currentState', + type: { + name: 'Composite', + class_name: 'ContainerState' + } + }, + previous_state: { + required: false, + read_only: true, + serialized_name: 'previousState', + type: { + name: 'Composite', + class_name: 'ContainerState' + } + }, + events: { + required: false, + read_only: true, + serialized_name: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EventElementType', + type: { + name: 'Composite', + class_name: 'Event' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_state.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_state.rb new file mode 100644 index 0000000000..ce2e493df8 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_state.rb @@ -0,0 +1,93 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container instance state. + # + class ContainerState + + include MsRestAzure + + # @return [String] The state of the container instance. + attr_accessor :state + + # @return [DateTime] The date-time when the container instance state + # started. + attr_accessor :start_time + + # @return [Integer] The container instance exit codes correspond to those + # from the `docker run` command. + attr_accessor :exit_code + + # @return [DateTime] The date-time when the container instance state + # finished. + attr_accessor :finish_time + + # @return [String] The human-readable status of the container instance + # state. + attr_accessor :detail_status + + + # + # Mapper for ContainerState class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerState', + type: { + name: 'Composite', + class_name: 'ContainerState', + model_properties: { + state: { + required: false, + read_only: true, + serialized_name: 'state', + type: { + name: 'String' + } + }, + start_time: { + required: false, + read_only: true, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + exit_code: { + required: false, + read_only: true, + serialized_name: 'exitCode', + type: { + name: 'Number' + } + }, + finish_time: { + required: false, + read_only: true, + serialized_name: 'finishTime', + type: { + name: 'DateTime' + } + }, + detail_status: { + required: false, + read_only: true, + serialized_name: 'detailStatus', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/environment_variable.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/environment_variable.rb new file mode 100644 index 0000000000..e3dc96b94e --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/environment_variable.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The environment variable to set within the container instance. + # + class EnvironmentVariable + + include MsRestAzure + + # @return [String] The name of the environment variable. + attr_accessor :name + + # @return [String] The value of the environment variable. + attr_accessor :value + + + # + # Mapper for EnvironmentVariable class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EnvironmentVariable', + type: { + name: 'Composite', + class_name: 'EnvironmentVariable', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + value: { + required: true, + serialized_name: 'value', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/event.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/event.rb new file mode 100644 index 0000000000..9bc560303d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/event.rb @@ -0,0 +1,100 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A container group or container instance event. + # + class Event + + include MsRestAzure + + # @return [Integer] The count of the event. + attr_accessor :count + + # @return [DateTime] The date-time of the earliest logged event. + attr_accessor :first_timestamp + + # @return [DateTime] The date-time of the latest logged event. + attr_accessor :last_timestamp + + # @return [String] The event name. + attr_accessor :name + + # @return [String] The event message. + attr_accessor :message + + # @return [String] The event type. + attr_accessor :type + + + # + # Mapper for Event class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Event', + type: { + name: 'Composite', + class_name: 'Event', + model_properties: { + count: { + required: false, + read_only: true, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + first_timestamp: { + required: false, + read_only: true, + serialized_name: 'firstTimestamp', + type: { + name: 'DateTime' + } + }, + last_timestamp: { + required: false, + read_only: true, + serialized_name: 'lastTimestamp', + type: { + name: 'DateTime' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + message: { + required: false, + read_only: true, + serialized_name: 'message', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb new file mode 100644 index 0000000000..f4833422c1 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Represents a volume that is populated with the contents of a git + # repository + # + class GitRepoVolume + + include MsRestAzure + + # @return [String] Target directory name. Must not contain or start with + # '..'. If '.' is supplied, the volume directory will be the git + # repository. Otherwise, if specified, the volume will contain the git + # repository in the subdirectory with the given name. + attr_accessor :directory + + # @return [String] Repository URL + attr_accessor :repository + + # @return [String] Commit hash for the specified revision. + attr_accessor :revision + + + # + # Mapper for GitRepoVolume class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'GitRepoVolume', + type: { + name: 'Composite', + class_name: 'GitRepoVolume', + model_properties: { + directory: { + required: false, + serialized_name: 'directory', + type: { + name: 'String' + } + }, + repository: { + required: true, + serialized_name: 'repository', + type: { + name: 'String' + } + }, + revision: { + required: false, + serialized_name: 'revision', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb new file mode 100644 index 0000000000..e63da722d2 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Image registry credential. + # + class ImageRegistryCredential + + include MsRestAzure + + # @return [String] The Docker image registry server without a protocol + # such as "http" and "https". + attr_accessor :server + + # @return [String] The username for the private registry. + attr_accessor :username + + # @return [String] The password for the private registry. + attr_accessor :password + + + # + # Mapper for ImageRegistryCredential class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ImageRegistryCredential', + type: { + name: 'Composite', + class_name: 'ImageRegistryCredential', + model_properties: { + server: { + required: true, + serialized_name: 'server', + type: { + name: 'String' + } + }, + username: { + required: true, + serialized_name: 'username', + type: { + name: 'String' + } + }, + password: { + required: false, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/ip_address.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/ip_address.rb new file mode 100644 index 0000000000..38e1f51e49 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/ip_address.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # IP address for the container group. + # + class IpAddress + + include MsRestAzure + + # @return [Array] The list of ports exposed on the container group. + attr_accessor :ports + + # @return [String] Specifies if the IP is exposed to the public internet. + # Default value: 'Public' . + attr_accessor :type + + # @return [String] The IP exposed to the public internet. + attr_accessor :ip + + # @return [String] The Dns name label for the IP. + attr_accessor :dns_name_label + + # @return [String] The FQDN for the IP. + attr_accessor :fqdn + + + # + # Mapper for IpAddress class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IpAddress', + type: { + name: 'Composite', + class_name: 'IpAddress', + model_properties: { + ports: { + required: true, + serialized_name: 'ports', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'PortElementType', + type: { + name: 'Composite', + class_name: 'Port' + } + } + } + }, + type: { + required: true, + is_constant: true, + serialized_name: 'type', + default_value: 'Public', + type: { + name: 'String' + } + }, + ip: { + required: false, + serialized_name: 'ip', + type: { + name: 'String' + } + }, + dns_name_label: { + required: false, + serialized_name: 'dnsNameLabel', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + read_only: true, + serialized_name: 'fqdn', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/logs.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/logs.rb new file mode 100644 index 0000000000..bf4c357a86 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/logs.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The logs. + # + class Logs + + include MsRestAzure + + # @return [String] The content of the log. + attr_accessor :content + + + # + # Mapper for Logs class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Logs', + type: { + name: 'Composite', + class_name: 'Logs', + model_properties: { + content: { + required: false, + read_only: true, + serialized_name: 'content', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb new file mode 100644 index 0000000000..3b18ec683c --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for OperatingSystemTypes + # + module OperatingSystemTypes + Windows = "Windows" + Linux = "Linux" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operation.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operation.rb new file mode 100644 index 0000000000..2d4d07f896 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operation.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # An operation for Azure Container Instance service. + # + class Operation + + include MsRestAzure + + # @return [String] The name of the operation. + attr_accessor :name + + # @return [OperationDisplay] The display information of the operation. + attr_accessor :display + + # @return [ContainerInstanceOperationsOrigin] The intended executor of + # the operation. Possible values include: 'User', 'System' + attr_accessor :origin + + + # + # Mapper for Operation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationDisplay' + } + }, + origin: { + required: false, + read_only: true, + serialized_name: 'origin', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operation_display.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operation_display.rb new file mode 100644 index 0000000000..05d57705b5 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operation_display.rb @@ -0,0 +1,78 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The display information of the operation. + # + class OperationDisplay + + include MsRestAzure + + # @return [String] The name of the provider of the operation. + attr_accessor :provider + + # @return [String] The name of the resource type of the operation. + attr_accessor :resource + + # @return [String] The friendly name of the operation. + attr_accessor :operation + + # @return [String] The description of the operation. + attr_accessor :description + + + # + # Mapper for OperationDisplay class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Operation_display', + type: { + name: 'Composite', + class_name: 'OperationDisplay', + model_properties: { + provider: { + required: false, + read_only: true, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + read_only: true, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + read_only: true, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + read_only: true, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb new file mode 100644 index 0000000000..2892cfeb7d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb @@ -0,0 +1,63 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The operation list response that contains all operations for Azure + # Container Instance service. + # + class OperationListResult + + include MsRestAzure + + # @return [Array] The list of operations. + attr_accessor :value + + # @return [String] The URI to fetch the next page of operations. + attr_accessor :next_link + + + # + # Mapper for OperationListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationListResult', + type: { + name: 'Composite', + class_name: 'OperationListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OperationElementType', + type: { + name: 'Composite', + class_name: 'Operation' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/port.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/port.rb new file mode 100644 index 0000000000..b70a97aa82 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/port.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The port exposed on the container group. + # + class Port + + include MsRestAzure + + # @return [ContainerGroupNetworkProtocol] The protocol associated with + # the port. Possible values include: 'TCP', 'UDP' + attr_accessor :protocol + + # @return [Integer] The port number. + attr_accessor :port + + + # + # Mapper for Port class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Port', + type: { + name: 'Composite', + class_name: 'Port', + model_properties: { + protocol: { + required: false, + serialized_name: 'protocol', + type: { + name: 'String' + } + }, + port: { + required: true, + serialized_name: 'port', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource.rb new file mode 100644 index 0000000000..93cbebcfd7 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The Resource model definition. + # + class Resource + + include MsRestAzure + + # @return [String] The resource id. + attr_accessor :id + + # @return [String] The resource name. + attr_accessor :name + + # @return [String] The resource type. + attr_accessor :type + + # @return [String] The resource location. + attr_accessor :location + + # @return [Hash{String => String}] The resource tags. + attr_accessor :tags + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource_limits.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource_limits.rb new file mode 100644 index 0000000000..c154e380d5 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource_limits.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The resource limits. + # + class ResourceLimits + + include MsRestAzure + + # @return [Float] The memory limit in GB of this container instance. + attr_accessor :memory_in_gb + + # @return [Float] The CPU limit of this container instance. + attr_accessor :cpu + + + # + # Mapper for ResourceLimits class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResourceLimits', + type: { + name: 'Composite', + class_name: 'ResourceLimits', + model_properties: { + memory_in_gb: { + required: false, + serialized_name: 'memoryInGB', + type: { + name: 'Double' + } + }, + cpu: { + required: false, + serialized_name: 'cpu', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource_requests.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource_requests.rb new file mode 100644 index 0000000000..a389e68a92 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource_requests.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The resource requests. + # + class ResourceRequests + + include MsRestAzure + + # @return [Float] The memory request in GB of this container instance. + attr_accessor :memory_in_gb + + # @return [Float] The CPU request of this container instance. + attr_accessor :cpu + + + # + # Mapper for ResourceRequests class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResourceRequests', + type: { + name: 'Composite', + class_name: 'ResourceRequests', + model_properties: { + memory_in_gb: { + required: true, + serialized_name: 'memoryInGB', + type: { + name: 'Double' + } + }, + cpu: { + required: true, + serialized_name: 'cpu', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb new file mode 100644 index 0000000000..00e14e5f9b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The resource requirements. + # + class ResourceRequirements + + include MsRestAzure + + # @return [ResourceRequests] The resource requests of this container + # instance. + attr_accessor :requests + + # @return [ResourceLimits] The resource limits of this container + # instance. + attr_accessor :limits + + + # + # Mapper for ResourceRequirements class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResourceRequirements', + type: { + name: 'Composite', + class_name: 'ResourceRequirements', + model_properties: { + requests: { + required: true, + serialized_name: 'requests', + type: { + name: 'Composite', + class_name: 'ResourceRequests' + } + }, + limits: { + required: false, + serialized_name: 'limits', + type: { + name: 'Composite', + class_name: 'ResourceLimits' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/usage.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/usage.rb new file mode 100644 index 0000000000..6fa0dee48b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/usage.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A single usage result + # + class Usage + + include MsRestAzure + + # @return [String] Unit of the usage result + attr_accessor :unit + + # @return [Integer] The current usage of the resource + attr_accessor :current_value + + # @return [Integer] The maximum permitted usage of the resource. + attr_accessor :limit + + # @return [UsageName] The name object of the resource + attr_accessor :name + + + # + # Mapper for Usage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Usage', + type: { + name: 'Composite', + class_name: 'Usage', + model_properties: { + unit: { + required: false, + read_only: true, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + current_value: { + required: false, + read_only: true, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + }, + limit: { + required: false, + read_only: true, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'UsageName' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb new file mode 100644 index 0000000000..b6f90c49f4 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The response containing the usage data + # + class UsageListResult + + include MsRestAzure + + # @return [Array] + attr_accessor :value + + + # + # Mapper for UsageListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UsageListResult', + type: { + name: 'Composite', + class_name: 'UsageListResult', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'UsageElementType', + type: { + name: 'Composite', + class_name: 'Usage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/usage_name.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/usage_name.rb new file mode 100644 index 0000000000..8dbd475b63 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/usage_name.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The name object of the resource + # + class UsageName + + include MsRestAzure + + # @return [String] The name of the resource + attr_accessor :value + + # @return [String] The localized name of the resource + attr_accessor :localized_value + + + # + # Mapper for UsageName class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Usage_name', + type: { + name: 'Composite', + class_name: 'UsageName', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'String' + } + }, + localized_value: { + required: false, + read_only: true, + serialized_name: 'localizedValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/volume.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/volume.rb new file mode 100644 index 0000000000..5c7547594d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/volume.rb @@ -0,0 +1,93 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The properties of the volume. + # + class Volume + + include MsRestAzure + + # @return [String] The name of the volume. + attr_accessor :name + + # @return [AzureFileVolume] The Azure File volume. + attr_accessor :azure_file + + # @return The empty directory volume. + attr_accessor :empty_dir + + # @return [Hash{String => String}] The secret volume. + attr_accessor :secret + + # @return [GitRepoVolume] The git repo volume. + attr_accessor :git_repo + + + # + # Mapper for Volume class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Volume', + type: { + name: 'Composite', + class_name: 'Volume', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + azure_file: { + required: false, + serialized_name: 'azureFile', + type: { + name: 'Composite', + class_name: 'AzureFileVolume' + } + }, + empty_dir: { + required: false, + serialized_name: 'emptyDir', + type: { + name: 'Object' + } + }, + secret: { + required: false, + serialized_name: 'secret', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + git_repo: { + required: false, + serialized_name: 'gitRepo', + type: { + name: 'Composite', + class_name: 'GitRepoVolume' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/volume_mount.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/volume_mount.rb new file mode 100644 index 0000000000..71d2041194 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/models/volume_mount.rb @@ -0,0 +1,66 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The properties of the volume mount. + # + class VolumeMount + + include MsRestAzure + + # @return [String] The name of the volume mount. + attr_accessor :name + + # @return [String] The path within the container where the volume should + # be mounted. Must not contain colon (:). + attr_accessor :mount_path + + # @return [Boolean] The flag indicating whether the volume mount is + # read-only. + attr_accessor :read_only + + + # + # Mapper for VolumeMount class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'VolumeMount', + type: { + name: 'Composite', + class_name: 'VolumeMount', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + mount_path: { + required: true, + serialized_name: 'mountPath', + type: { + name: 'String' + } + }, + read_only: { + required: false, + serialized_name: 'readOnly', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/module_definition.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/module_definition.rb new file mode 100644 index 0000000000..7359ebcf14 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::ContainerInstance end +module Azure::ContainerInstance::Mgmt end +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/operations.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/operations.rb new file mode 100644 index 0000000000..2f86fa4ed7 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/operations.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # Operations + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # List the operations for Azure Container Instance service. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] operation results. + # + def list(custom_headers = nil) + response = list_async(custom_headers).value! + response.body unless response.nil? + end + + # + # List the operations for Azure Container Instance service. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # List the operations for Azure Container Instance service. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.ContainerInstance/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/start_container.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/start_container.rb new file mode 100644 index 0000000000..f4ba42f6bf --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/start_container.rb @@ -0,0 +1,145 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # StartContainer + # + class StartContainer + include MsRestAzure + + # + # Creates and initializes a new instance of the StartContainer class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Starts the exec command for a specific container instance. + # + # Starts the exec command for a specified container instance in a specified + # resource group and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param container_exec_request [ContainerExecRequest] The request for the exec + # command. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerExecResponse] operation results. + # + def launch_exec(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers = nil) + response = launch_exec_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers).value! + response.body unless response.nil? + end + + # + # Starts the exec command for a specific container instance. + # + # Starts the exec command for a specified container instance in a specified + # resource group and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param container_exec_request [ContainerExecRequest] The request for the exec + # command. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def launch_exec_with_http_info(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers = nil) + launch_exec_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers).value! + end + + # + # Starts the exec command for a specific container instance. + # + # Starts the exec command for a specified container instance in a specified + # resource group and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param container_exec_request [ContainerExecRequest] The request for the exec + # command. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def launch_exec_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'container_exec_request is nil' if container_exec_request.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerExecRequest.mapper() + request_content = @client.serialize(request_mapper, container_exec_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerExecResponse.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/version.rb b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/version.rb new file mode 100644 index 0000000000..d53bf03778 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-04-01/generated/azure_mgmt_container_instance/version.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + VERSION = '0.16.0' +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance.rb new file mode 100644 index 0000000000..53cbfd4795 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance.rb @@ -0,0 +1,71 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2018-06-01/generated/azure_mgmt_container_instance/module_definition' +require 'ms_rest_azure' + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + autoload :ContainerGroups, '2018-06-01/generated/azure_mgmt_container_instance/container_groups.rb' + autoload :Operations, '2018-06-01/generated/azure_mgmt_container_instance/operations.rb' + autoload :ContainerGroupUsage, '2018-06-01/generated/azure_mgmt_container_instance/container_group_usage.rb' + autoload :ContainerOperations, '2018-06-01/generated/azure_mgmt_container_instance/container_operations.rb' + autoload :ContainerInstanceManagementClient, '2018-06-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb' + + module Models + autoload :Port, '2018-06-01/generated/azure_mgmt_container_instance/models/port.rb' + autoload :IpAddress, '2018-06-01/generated/azure_mgmt_container_instance/models/ip_address.rb' + autoload :EnvironmentVariable, '2018-06-01/generated/azure_mgmt_container_instance/models/environment_variable.rb' + autoload :ContainerGroupPropertiesInstanceView, '2018-06-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb' + autoload :Event, '2018-06-01/generated/azure_mgmt_container_instance/models/event.rb' + autoload :LogAnalytics, '2018-06-01/generated/azure_mgmt_container_instance/models/log_analytics.rb' + autoload :ResourceRequests, '2018-06-01/generated/azure_mgmt_container_instance/models/resource_requests.rb' + autoload :ContainerGroupDiagnostics, '2018-06-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb' + autoload :ResourceRequirements, '2018-06-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb' + autoload :VolumeMount, '2018-06-01/generated/azure_mgmt_container_instance/models/volume_mount.rb' + autoload :ContainerHttpGet, '2018-06-01/generated/azure_mgmt_container_instance/models/container_http_get.rb' + autoload :OperationDisplay, '2018-06-01/generated/azure_mgmt_container_instance/models/operation_display.rb' + autoload :Container, '2018-06-01/generated/azure_mgmt_container_instance/models/container.rb' + autoload :Operation, '2018-06-01/generated/azure_mgmt_container_instance/models/operation.rb' + autoload :GitRepoVolume, '2018-06-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb' + autoload :OperationListResult, '2018-06-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb' + autoload :ImageRegistryCredential, '2018-06-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb' + autoload :UsageName, '2018-06-01/generated/azure_mgmt_container_instance/models/usage_name.rb' + autoload :ContainerState, '2018-06-01/generated/azure_mgmt_container_instance/models/container_state.rb' + autoload :Usage, '2018-06-01/generated/azure_mgmt_container_instance/models/usage.rb' + autoload :ResourceLimits, '2018-06-01/generated/azure_mgmt_container_instance/models/resource_limits.rb' + autoload :UsageListResult, '2018-06-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb' + autoload :ContainerProbe, '2018-06-01/generated/azure_mgmt_container_instance/models/container_probe.rb' + autoload :ContainerGroupListResult, '2018-06-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb' + autoload :Volume, '2018-06-01/generated/azure_mgmt_container_instance/models/volume.rb' + autoload :Logs, '2018-06-01/generated/azure_mgmt_container_instance/models/logs.rb' + autoload :ContainerPropertiesInstanceView, '2018-06-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb' + autoload :ContainerExecRequestTerminalSize, '2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb' + autoload :AzureFileVolume, '2018-06-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb' + autoload :ContainerExecRequest, '2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb' + autoload :ContainerExec, '2018-06-01/generated/azure_mgmt_container_instance/models/container_exec.rb' + autoload :ContainerExecResponse, '2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb' + autoload :ContainerPort, '2018-06-01/generated/azure_mgmt_container_instance/models/container_port.rb' + autoload :Resource, '2018-06-01/generated/azure_mgmt_container_instance/models/resource.rb' + autoload :ContainerGroup, '2018-06-01/generated/azure_mgmt_container_instance/models/container_group.rb' + autoload :ContainerNetworkProtocol, '2018-06-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb' + autoload :ContainerGroupRestartPolicy, '2018-06-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb' + autoload :ContainerGroupNetworkProtocol, '2018-06-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb' + autoload :OperatingSystemTypes, '2018-06-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb' + autoload :ContainerInstanceOperationsOrigin, '2018-06-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb' + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_group_usage.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_group_usage.rb new file mode 100644 index 0000000000..8fc45c23c4 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_group_usage.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # ContainerGroupUsage + # + class ContainerGroupUsage + include MsRestAzure + + # + # Creates and initializes a new instance of the ContainerGroupUsage class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Get the usage for a subscription + # + # @param location [String] The identifier for the physical azure location. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsageListResult] operation results. + # + def list(location, custom_headers = nil) + response = list_async(location, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the usage for a subscription + # + # @param location [String] The identifier for the physical azure location. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(location, custom_headers = nil) + list_async(location, custom_headers).value! + end + + # + # Get the usage for a subscription + # + # @param location [String] The identifier for the physical azure location. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(location, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'location' => location}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::UsageListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_groups.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_groups.rb new file mode 100644 index 0000000000..d68a9cef24 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_groups.rb @@ -0,0 +1,1199 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # ContainerGroups + # + class ContainerGroups + include MsRestAzure + + # + # Creates and initializes a new instance of the ContainerGroups class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) + first_page.get_all_items + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, custom_headers = nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers) + first_page.get_all_items + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil) + list_by_resource_group_async(resource_group_name, custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get the properties of the specified container group. + # + # Gets the properties of the specified container group in the specified + # subscription and resource group. The operation returns the properties of each + # container group including containers, image registry credentials, restart + # policy, IP address type, OS type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def get(resource_group_name, container_group_name, custom_headers = nil) + response = get_async(resource_group_name, container_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the properties of the specified container group. + # + # Gets the properties of the specified container group in the specified + # subscription and resource group. The operation returns the properties of each + # container group including containers, image registry credentials, restart + # policy, IP address type, OS type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + get_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Get the properties of the specified container group. + # + # Gets the properties of the specified container group in the specified + # subscription and resource group. The operation returns the properties of each + # container group including containers, image registry credentials, restart + # policy, IP address type, OS type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def create_or_update(resource_group_name, container_group_name, container_group, custom_headers = nil) + response = create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers = nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Update container groups. + # + # Updates container group tags with specified values. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param resource [Resource] The container group resource with just the tags to + # be updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def update(resource_group_name, container_group_name, resource, custom_headers = nil) + response = update_async(resource_group_name, container_group_name, resource, custom_headers).value! + response.body unless response.nil? + end + + # + # Update container groups. + # + # Updates container group tags with specified values. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param resource [Resource] The container group resource with just the tags to + # be updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def update_with_http_info(resource_group_name, container_group_name, resource, custom_headers = nil) + update_async(resource_group_name, container_group_name, resource, custom_headers).value! + end + + # + # Update container groups. + # + # Updates container group tags with specified values. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param resource [Resource] The container group resource with just the tags to + # be updated. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def update_async(resource_group_name, container_group_name, resource, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'resource is nil' if resource.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::Resource.mapper() + request_content = @client.serialize(request_mapper, resource) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete the specified container group. + # + # Delete the specified container group in the specified subscription and + # resource group. The operation does not delete other resources provided by the + # user, such as volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def delete(resource_group_name, container_group_name, custom_headers = nil) + response = delete_async(resource_group_name, container_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Delete the specified container group. + # + # Delete the specified container group in the specified subscription and + # resource group. The operation does not delete other resources provided by the + # user, such as volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + delete_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Delete the specified container group. + # + # Delete the specified container group in the specified subscription and + # resource group. The operation does not delete other resources provided by the + # user, such as volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Restarts all containers in a container group. + # + # Restarts all containers in a contaienr group in place. If container image has + # updates, new image will be downloaded. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def restart(resource_group_name, container_group_name, custom_headers = nil) + response = restart_async(resource_group_name, container_group_name, custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def restart_async(resource_group_name, container_group_name, custom_headers = nil) + # Send request + promise = begin_restart_async(resource_group_name, container_group_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Stops all containers in a container group. + # + # Stops all containers in a contaienr group. Compute resources will be + # deallocated and billing will stop. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def stop(resource_group_name, container_group_name, custom_headers = nil) + response = stop_async(resource_group_name, container_group_name, custom_headers).value! + nil + end + + # + # Stops all containers in a container group. + # + # Stops all containers in a contaienr group. Compute resources will be + # deallocated and billing will stop. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def stop_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + stop_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Stops all containers in a container group. + # + # Stops all containers in a contaienr group. Compute resources will be + # deallocated and billing will stop. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def stop_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def begin_create_or_update(resource_group_name, container_group_name, container_group, custom_headers = nil) + response = begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, container_group_name, container_group, custom_headers = nil) + begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers).value! + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'container_group is nil' if container_group.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + request_content = @client.serialize(request_mapper, container_group) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Restarts all containers in a container group. + # + # Restarts all containers in a contaienr group in place. If container image has + # updates, new image will be downloaded. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_restart(resource_group_name, container_group_name, custom_headers = nil) + response = begin_restart_async(resource_group_name, container_group_name, custom_headers).value! + nil + end + + # + # Restarts all containers in a container group. + # + # Restarts all containers in a contaienr group in place. If container image has + # updates, new image will be downloaded. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_restart_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + begin_restart_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Restarts all containers in a container group. + # + # Restarts all containers in a contaienr group in place. If container image has + # updates, new image will be downloaded. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_restart_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil) + list_by_resource_group_next_async(next_page_link, custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers = nil) + response = list_async(custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] which provide lazy access to pages of the + # response. + # + def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil) + response = list_by_resource_group_async(resource_group_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb new file mode 100644 index 0000000000..3daf17c859 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb @@ -0,0 +1,143 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # A service client - single point of access to the REST API. + # + class ContainerInstanceManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] Subscription credentials which uniquely identify + # Microsoft Azure subscription. The subscription ID forms part of the URI + # for every service call. + attr_accessor :subscription_id + + # @return [String] Client API version + attr_reader :api_version + + # @return [String] Gets or sets the preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] Gets or sets the retry timeout in seconds for Long + # Running Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] When set to true a unique x-ms-client-request-id value + # is generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [ContainerGroups] container_groups + attr_reader :container_groups + + # @return [Operations] operations + attr_reader :operations + + # @return [ContainerGroupUsage] container_group_usage + attr_reader :container_group_usage + + # @return [ContainerOperations] container_operations + attr_reader :container_operations + + # + # Creates initializes a new instance of the ContainerInstanceManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @container_groups = ContainerGroups.new(self) + @operations = Operations.new(self) + @container_group_usage = ContainerGroupUsage.new(self) + @container_operations = ContainerOperations.new(self) + @api_version = '2018-06-01' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_container_instance' + if defined? Azure::ContainerInstance::Mgmt::V2018_02_01_preview::VERSION + sdk_information = "#{sdk_information}/#{Azure::ContainerInstance::Mgmt::V2018_02_01_preview::VERSION}" + end + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_operations.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_operations.rb new file mode 100644 index 0000000000..58c9481091 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_operations.rb @@ -0,0 +1,258 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # ContainerOperations + # + class ContainerOperations + include MsRestAzure + + # + # Creates and initializes a new instance of the ContainerOperations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Get the logs for a specified container instance. + # + # Get the logs for a specified container instance in a specified resource group + # and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param tail [Integer] The number of lines to show from the tail of the + # container instance log. If not provided, all available logs are shown up to + # 4mb. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Logs] operation results. + # + def list_logs(resource_group_name, container_group_name, container_name, tail = nil, custom_headers = nil) + response = list_logs_async(resource_group_name, container_group_name, container_name, tail, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the logs for a specified container instance. + # + # Get the logs for a specified container instance in a specified resource group + # and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param tail [Integer] The number of lines to show from the tail of the + # container instance log. If not provided, all available logs are shown up to + # 4mb. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_logs_with_http_info(resource_group_name, container_group_name, container_name, tail = nil, custom_headers = nil) + list_logs_async(resource_group_name, container_group_name, container_name, tail, custom_headers).value! + end + + # + # Get the logs for a specified container instance. + # + # Get the logs for a specified container instance in a specified resource group + # and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param tail [Integer] The number of lines to show from the tail of the + # container instance log. If not provided, all available logs are shown up to + # 4mb. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_logs_async(resource_group_name, container_group_name, container_name, tail = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version,'tail' => tail}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::Logs.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Executes a command in a specific container instance. + # + # Executes a command for a specific container instance in a specified resource + # group and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param container_exec_request [ContainerExecRequest] The request for the exec + # command. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerExecResponse] operation results. + # + def execute_command(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers = nil) + response = execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers).value! + response.body unless response.nil? + end + + # + # Executes a command in a specific container instance. + # + # Executes a command for a specific container instance in a specified resource + # group and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param container_exec_request [ContainerExecRequest] The request for the exec + # command. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def execute_command_with_http_info(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers = nil) + execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers).value! + end + + # + # Executes a command in a specific container instance. + # + # Executes a command for a specific container instance in a specified resource + # group and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param container_exec_request [ContainerExecRequest] The request for the exec + # command. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'container_exec_request is nil' if container_exec_request.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerExecRequest.mapper() + request_content = @client.serialize(request_mapper, container_exec_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerExecResponse.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb new file mode 100644 index 0000000000..ca1fcc2318 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The properties of the Azure File volume. Azure File shares are mounted as + # volumes. + # + class AzureFileVolume + + include MsRestAzure + + # @return [String] The name of the Azure File share to be mounted as a + # volume. + attr_accessor :share_name + + # @return [Boolean] The flag indicating whether the Azure File shared + # mounted as a volume is read-only. + attr_accessor :read_only + + # @return [String] The name of the storage account that contains the + # Azure File share. + attr_accessor :storage_account_name + + # @return [String] The storage account access key used to access the + # Azure File share. + attr_accessor :storage_account_key + + + # + # Mapper for AzureFileVolume class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AzureFileVolume', + type: { + name: 'Composite', + class_name: 'AzureFileVolume', + model_properties: { + share_name: { + required: true, + serialized_name: 'shareName', + type: { + name: 'String' + } + }, + read_only: { + required: false, + serialized_name: 'readOnly', + type: { + name: 'Boolean' + } + }, + storage_account_name: { + required: true, + serialized_name: 'storageAccountName', + type: { + name: 'String' + } + }, + storage_account_key: { + required: false, + serialized_name: 'storageAccountKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container.rb new file mode 100644 index 0000000000..e6316c3382 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container.rb @@ -0,0 +1,177 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A container instance. + # + class Container + + include MsRestAzure + + # @return [String] The user-provided name of the container instance. + attr_accessor :name + + # @return [String] The name of the image used to create the container + # instance. + attr_accessor :image + + # @return [Array] The commands to execute within the container + # instance in exec form. + attr_accessor :command + + # @return [Array] The exposed ports on the container + # instance. + attr_accessor :ports + + # @return [Array] The environment variables to set + # in the container instance. + attr_accessor :environment_variables + + # @return [ContainerPropertiesInstanceView] The instance view of the + # container instance. Only valid in response. + attr_accessor :instance_view + + # @return [ResourceRequirements] The resource requirements of the + # container instance. + attr_accessor :resources + + # @return [Array] The volume mounts available to the + # container instance. + attr_accessor :volume_mounts + + # @return [ContainerProbe] The liveness probe. + attr_accessor :liveness_probe + + # @return [ContainerProbe] The readiness probe. + attr_accessor :readiness_probe + + + # + # Mapper for Container class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Container', + type: { + name: 'Composite', + class_name: 'Container', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + image: { + required: true, + serialized_name: 'properties.image', + type: { + name: 'String' + } + }, + command: { + required: false, + serialized_name: 'properties.command', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + ports: { + required: false, + serialized_name: 'properties.ports', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ContainerPortElementType', + type: { + name: 'Composite', + class_name: 'ContainerPort' + } + } + } + }, + environment_variables: { + required: false, + serialized_name: 'properties.environmentVariables', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EnvironmentVariableElementType', + type: { + name: 'Composite', + class_name: 'EnvironmentVariable' + } + } + } + }, + instance_view: { + required: false, + read_only: true, + serialized_name: 'properties.instanceView', + type: { + name: 'Composite', + class_name: 'ContainerPropertiesInstanceView' + } + }, + resources: { + required: true, + serialized_name: 'properties.resources', + type: { + name: 'Composite', + class_name: 'ResourceRequirements' + } + }, + volume_mounts: { + required: false, + serialized_name: 'properties.volumeMounts', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'VolumeMountElementType', + type: { + name: 'Composite', + class_name: 'VolumeMount' + } + } + } + }, + liveness_probe: { + required: false, + serialized_name: 'properties.livenessProbe', + type: { + name: 'Composite', + class_name: 'ContainerProbe' + } + }, + readiness_probe: { + required: false, + serialized_name: 'properties.readinessProbe', + type: { + name: 'Composite', + class_name: 'ContainerProbe' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec.rb new file mode 100644 index 0000000000..0ada7cb63d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec.rb @@ -0,0 +1,51 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container execution command, for liveness or readiness probe + # + class ContainerExec + + include MsRestAzure + + # @return [Array] The commands to execute within the container. + attr_accessor :command + + + # + # Mapper for ContainerExec class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExec', + type: { + name: 'Composite', + class_name: 'ContainerExec', + model_properties: { + command: { + required: false, + serialized_name: 'command', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb new file mode 100644 index 0000000000..0f4e6105a6 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container exec request. + # + class ContainerExecRequest + + include MsRestAzure + + # @return [String] The command to be executed. + attr_accessor :command + + # @return [ContainerExecRequestTerminalSize] The size of the terminal. + attr_accessor :terminal_size + + + # + # Mapper for ContainerExecRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExecRequest', + type: { + name: 'Composite', + class_name: 'ContainerExecRequest', + model_properties: { + command: { + required: false, + serialized_name: 'command', + type: { + name: 'String' + } + }, + terminal_size: { + required: false, + serialized_name: 'terminalSize', + type: { + name: 'Composite', + class_name: 'ContainerExecRequestTerminalSize' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb new file mode 100644 index 0000000000..f7b939bfb2 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The size of the terminal. + # + class ContainerExecRequestTerminalSize + + include MsRestAzure + + # @return [Integer] The row size of the terminal + attr_accessor :rows + + # @return [Integer] The column size of the terminal + attr_accessor :cols + + + # + # Mapper for ContainerExecRequestTerminalSize class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExecRequest_terminalSize', + type: { + name: 'Composite', + class_name: 'ContainerExecRequestTerminalSize', + model_properties: { + rows: { + required: false, + serialized_name: 'rows', + type: { + name: 'Number' + } + }, + cols: { + required: false, + serialized_name: 'cols', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb new file mode 100644 index 0000000000..c5079dab0b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The information for the container exec command. + # + class ContainerExecResponse + + include MsRestAzure + + # @return [String] The uri for the exec websocket. + attr_accessor :web_socket_uri + + # @return [String] The password to start the exec command. + attr_accessor :password + + + # + # Mapper for ContainerExecResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExecResponse', + type: { + name: 'Composite', + class_name: 'ContainerExecResponse', + model_properties: { + web_socket_uri: { + required: false, + serialized_name: 'webSocketUri', + type: { + name: 'String' + } + }, + password: { + required: false, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group.rb new file mode 100644 index 0000000000..2d108920ca --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group.rb @@ -0,0 +1,210 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A container group. + # + class ContainerGroup < Resource + + include MsRestAzure + + # @return [String] The provisioning state of the container group. This + # only appears in the response. + attr_accessor :provisioning_state + + # @return [Array] The containers within the container group. + attr_accessor :containers + + # @return [Array] The image registry credentials + # by which the container group is created from. + attr_accessor :image_registry_credentials + + # @return [ContainerGroupRestartPolicy] Restart policy for all containers + # within the container group. + # - `Always` Always restart + # - `OnFailure` Restart on failure + # - `Never` Never restart + # . Possible values include: 'Always', 'OnFailure', 'Never' + attr_accessor :restart_policy + + # @return [IpAddress] The IP address type of the container group. + attr_accessor :ip_address + + # @return [OperatingSystemTypes] The operating system type required by + # the containers in the container group. Possible values include: + # 'Windows', 'Linux' + attr_accessor :os_type + + # @return [Array] The list of volumes that can be mounted by + # containers in this container group. + attr_accessor :volumes + + # @return [ContainerGroupPropertiesInstanceView] The instance view of the + # container group. Only valid in response. + attr_accessor :instance_view + + # @return [ContainerGroupDiagnostics] The diagnostic information for a + # container group. + attr_accessor :diagnostics + + + # + # Mapper for ContainerGroup class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroup', + type: { + name: 'Composite', + class_name: 'ContainerGroup', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + containers: { + required: false, + serialized_name: 'properties.containers', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ContainerElementType', + type: { + name: 'Composite', + class_name: 'Container' + } + } + } + }, + image_registry_credentials: { + required: false, + serialized_name: 'properties.imageRegistryCredentials', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ImageRegistryCredentialElementType', + type: { + name: 'Composite', + class_name: 'ImageRegistryCredential' + } + } + } + }, + restart_policy: { + required: false, + serialized_name: 'properties.restartPolicy', + type: { + name: 'String' + } + }, + ip_address: { + required: false, + serialized_name: 'properties.ipAddress', + type: { + name: 'Composite', + class_name: 'IpAddress' + } + }, + os_type: { + required: false, + serialized_name: 'properties.osType', + type: { + name: 'String' + } + }, + volumes: { + required: false, + serialized_name: 'properties.volumes', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'VolumeElementType', + type: { + name: 'Composite', + class_name: 'Volume' + } + } + } + }, + instance_view: { + required: false, + read_only: true, + serialized_name: 'properties.instanceView', + type: { + name: 'Composite', + class_name: 'ContainerGroupPropertiesInstanceView' + } + }, + diagnostics: { + required: false, + serialized_name: 'properties.diagnostics', + type: { + name: 'Composite', + class_name: 'ContainerGroupDiagnostics' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb new file mode 100644 index 0000000000..3c00f67412 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Container group diagnostic information. + # + class ContainerGroupDiagnostics + + include MsRestAzure + + # @return [LogAnalytics] Container group log analytics information. + attr_accessor :log_analytics + + + # + # Mapper for ContainerGroupDiagnostics class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroupDiagnostics', + type: { + name: 'Composite', + class_name: 'ContainerGroupDiagnostics', + model_properties: { + log_analytics: { + required: false, + serialized_name: 'logAnalytics', + type: { + name: 'Composite', + class_name: 'LogAnalytics' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb new file mode 100644 index 0000000000..8b6e25e433 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container group list response that contains the container group + # properties. + # + class ContainerGroupListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] The list of container groups. + attr_accessor :value + + # @return [String] The URI to fetch the next page of container groups. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ContainerGroupListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ContainerGroupListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroupListResult', + type: { + name: 'Composite', + class_name: 'ContainerGroupListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ContainerGroupElementType', + type: { + name: 'Composite', + class_name: 'ContainerGroup' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb new file mode 100644 index 0000000000..dab05d0f54 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerGroupNetworkProtocol + # + module ContainerGroupNetworkProtocol + TCP = "TCP" + UDP = "UDP" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb new file mode 100644 index 0000000000..744fce441b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The instance view of the container group. Only valid in response. + # + class ContainerGroupPropertiesInstanceView + + include MsRestAzure + + # @return [Array] The events of this container group. + attr_accessor :events + + # @return [String] The state of the container group. Only valid in + # response. + attr_accessor :state + + + # + # Mapper for ContainerGroupPropertiesInstanceView class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroup_properties_instanceView', + type: { + name: 'Composite', + class_name: 'ContainerGroupPropertiesInstanceView', + model_properties: { + events: { + required: false, + read_only: true, + serialized_name: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EventElementType', + type: { + name: 'Composite', + class_name: 'Event' + } + } + } + }, + state: { + required: false, + read_only: true, + serialized_name: 'state', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb new file mode 100644 index 0000000000..7906ba0862 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerGroupRestartPolicy + # + module ContainerGroupRestartPolicy + Always = "Always" + OnFailure = "OnFailure" + Never = "Never" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_http_get.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_http_get.rb new file mode 100644 index 0000000000..ab1369ab9c --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_http_get.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container Http Get settings, for liveness or readiness probe + # + class ContainerHttpGet + + include MsRestAzure + + # @return [String] The path to probe. + attr_accessor :path + + # @return [Integer] The port number to probe. + attr_accessor :port + + # @return [Enum] The scheme. Possible values include: 'http', 'https' + attr_accessor :scheme + + + # + # Mapper for ContainerHttpGet class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerHttpGet', + type: { + name: 'Composite', + class_name: 'ContainerHttpGet', + model_properties: { + path: { + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + port: { + required: true, + serialized_name: 'port', + type: { + name: 'Number' + } + }, + scheme: { + required: false, + serialized_name: 'scheme', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb new file mode 100644 index 0000000000..30fbc87af0 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerInstanceOperationsOrigin + # + module ContainerInstanceOperationsOrigin + User = "User" + System = "System" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb new file mode 100644 index 0000000000..4aae6a06ed --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerNetworkProtocol + # + module ContainerNetworkProtocol + TCP = "TCP" + UDP = "UDP" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_port.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_port.rb new file mode 100644 index 0000000000..77f5d53b1d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_port.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The port exposed on the container instance. + # + class ContainerPort + + include MsRestAzure + + # @return [ContainerNetworkProtocol] The protocol associated with the + # port. Possible values include: 'TCP', 'UDP' + attr_accessor :protocol + + # @return [Integer] The port number exposed within the container group. + attr_accessor :port + + + # + # Mapper for ContainerPort class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerPort', + type: { + name: 'Composite', + class_name: 'ContainerPort', + model_properties: { + protocol: { + required: false, + serialized_name: 'protocol', + type: { + name: 'String' + } + }, + port: { + required: true, + serialized_name: 'port', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_probe.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_probe.rb new file mode 100644 index 0000000000..d0b7dd28ad --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_probe.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container probe, for liveness or readiness + # + class ContainerProbe + + include MsRestAzure + + # @return [ContainerExec] The execution command to probe + attr_accessor :exec + + # @return [ContainerHttpGet] The Http Get settings to probe + attr_accessor :http_get + + # @return [Integer] The initial delay seconds. + attr_accessor :initial_delay_seconds + + # @return [Integer] The period seconds. + attr_accessor :period_seconds + + # @return [Integer] The failure threshold. + attr_accessor :failure_threshold + + # @return [Integer] The success threshold. + attr_accessor :success_threshold + + # @return [Integer] The timeout seconds. + attr_accessor :timeout_seconds + + + # + # Mapper for ContainerProbe class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerProbe', + type: { + name: 'Composite', + class_name: 'ContainerProbe', + model_properties: { + exec: { + required: false, + serialized_name: 'exec', + type: { + name: 'Composite', + class_name: 'ContainerExec' + } + }, + http_get: { + required: false, + serialized_name: 'httpGet', + type: { + name: 'Composite', + class_name: 'ContainerHttpGet' + } + }, + initial_delay_seconds: { + required: false, + serialized_name: 'initialDelaySeconds', + type: { + name: 'Number' + } + }, + period_seconds: { + required: false, + serialized_name: 'periodSeconds', + type: { + name: 'Number' + } + }, + failure_threshold: { + required: false, + serialized_name: 'failureThreshold', + type: { + name: 'Number' + } + }, + success_threshold: { + required: false, + serialized_name: 'successThreshold', + type: { + name: 'Number' + } + }, + timeout_seconds: { + required: false, + serialized_name: 'timeoutSeconds', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb new file mode 100644 index 0000000000..a66d37f60b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb @@ -0,0 +1,89 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The instance view of the container instance. Only valid in response. + # + class ContainerPropertiesInstanceView + + include MsRestAzure + + # @return [Integer] The number of times that the container instance has + # been restarted. + attr_accessor :restart_count + + # @return [ContainerState] Current container instance state. + attr_accessor :current_state + + # @return [ContainerState] Previous container instance state. + attr_accessor :previous_state + + # @return [Array] The events of the container instance. + attr_accessor :events + + + # + # Mapper for ContainerPropertiesInstanceView class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerProperties_instanceView', + type: { + name: 'Composite', + class_name: 'ContainerPropertiesInstanceView', + model_properties: { + restart_count: { + required: false, + read_only: true, + serialized_name: 'restartCount', + type: { + name: 'Number' + } + }, + current_state: { + required: false, + read_only: true, + serialized_name: 'currentState', + type: { + name: 'Composite', + class_name: 'ContainerState' + } + }, + previous_state: { + required: false, + read_only: true, + serialized_name: 'previousState', + type: { + name: 'Composite', + class_name: 'ContainerState' + } + }, + events: { + required: false, + read_only: true, + serialized_name: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EventElementType', + type: { + name: 'Composite', + class_name: 'Event' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_state.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_state.rb new file mode 100644 index 0000000000..14a4943e70 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_state.rb @@ -0,0 +1,88 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container instance state. + # + class ContainerState + + include MsRestAzure + + # @return [String] The state of the container instance. + attr_accessor :state + + # @return [DateTime] The date-time when the container instance state + # started. + attr_accessor :start_time + + # @return [Integer] The container instance exit codes correspond to those + # from the `docker run` command. + attr_accessor :exit_code + + # @return [DateTime] The date-time when the container instance state + # finished. + attr_accessor :finish_time + + # @return [String] The human-readable status of the container instance + # state. + attr_accessor :detail_status + + + # + # Mapper for ContainerState class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerState', + type: { + name: 'Composite', + class_name: 'ContainerState', + model_properties: { + state: { + required: false, + serialized_name: 'state', + type: { + name: 'String' + } + }, + start_time: { + required: false, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + exit_code: { + required: false, + serialized_name: 'exitCode', + type: { + name: 'Number' + } + }, + finish_time: { + required: false, + serialized_name: 'finishTime', + type: { + name: 'DateTime' + } + }, + detail_status: { + required: false, + serialized_name: 'detailStatus', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/environment_variable.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/environment_variable.rb new file mode 100644 index 0000000000..5d092e47cf --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/environment_variable.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The environment variable to set within the container instance. + # + class EnvironmentVariable + + include MsRestAzure + + # @return [String] The name of the environment variable. + attr_accessor :name + + # @return [String] The value of the environment variable. + attr_accessor :value + + # @return [String] The value of the secure environment variable. + attr_accessor :secure_value + + + # + # Mapper for EnvironmentVariable class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EnvironmentVariable', + type: { + name: 'Composite', + class_name: 'EnvironmentVariable', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + }, + secure_value: { + required: false, + serialized_name: 'secureValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/event.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/event.rb new file mode 100644 index 0000000000..7b6cd72690 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/event.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A container group or container instance event. + # + class Event + + include MsRestAzure + + # @return [Integer] The count of the event. + attr_accessor :count + + # @return [DateTime] The date-time of the earliest logged event. + attr_accessor :first_timestamp + + # @return [DateTime] The date-time of the latest logged event. + attr_accessor :last_timestamp + + # @return [String] The event name. + attr_accessor :name + + # @return [String] The event message. + attr_accessor :message + + # @return [String] The event type. + attr_accessor :type + + + # + # Mapper for Event class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Event', + type: { + name: 'Composite', + class_name: 'Event', + model_properties: { + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + first_timestamp: { + required: false, + serialized_name: 'firstTimestamp', + type: { + name: 'DateTime' + } + }, + last_timestamp: { + required: false, + serialized_name: 'lastTimestamp', + type: { + name: 'DateTime' + } + }, + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + message: { + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + }, + type: { + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb new file mode 100644 index 0000000000..f4833422c1 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Represents a volume that is populated with the contents of a git + # repository + # + class GitRepoVolume + + include MsRestAzure + + # @return [String] Target directory name. Must not contain or start with + # '..'. If '.' is supplied, the volume directory will be the git + # repository. Otherwise, if specified, the volume will contain the git + # repository in the subdirectory with the given name. + attr_accessor :directory + + # @return [String] Repository URL + attr_accessor :repository + + # @return [String] Commit hash for the specified revision. + attr_accessor :revision + + + # + # Mapper for GitRepoVolume class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'GitRepoVolume', + type: { + name: 'Composite', + class_name: 'GitRepoVolume', + model_properties: { + directory: { + required: false, + serialized_name: 'directory', + type: { + name: 'String' + } + }, + repository: { + required: true, + serialized_name: 'repository', + type: { + name: 'String' + } + }, + revision: { + required: false, + serialized_name: 'revision', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb new file mode 100644 index 0000000000..e63da722d2 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Image registry credential. + # + class ImageRegistryCredential + + include MsRestAzure + + # @return [String] The Docker image registry server without a protocol + # such as "http" and "https". + attr_accessor :server + + # @return [String] The username for the private registry. + attr_accessor :username + + # @return [String] The password for the private registry. + attr_accessor :password + + + # + # Mapper for ImageRegistryCredential class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ImageRegistryCredential', + type: { + name: 'Composite', + class_name: 'ImageRegistryCredential', + model_properties: { + server: { + required: true, + serialized_name: 'server', + type: { + name: 'String' + } + }, + username: { + required: true, + serialized_name: 'username', + type: { + name: 'String' + } + }, + password: { + required: false, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/ip_address.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/ip_address.rb new file mode 100644 index 0000000000..38e1f51e49 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/ip_address.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # IP address for the container group. + # + class IpAddress + + include MsRestAzure + + # @return [Array] The list of ports exposed on the container group. + attr_accessor :ports + + # @return [String] Specifies if the IP is exposed to the public internet. + # Default value: 'Public' . + attr_accessor :type + + # @return [String] The IP exposed to the public internet. + attr_accessor :ip + + # @return [String] The Dns name label for the IP. + attr_accessor :dns_name_label + + # @return [String] The FQDN for the IP. + attr_accessor :fqdn + + + # + # Mapper for IpAddress class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IpAddress', + type: { + name: 'Composite', + class_name: 'IpAddress', + model_properties: { + ports: { + required: true, + serialized_name: 'ports', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'PortElementType', + type: { + name: 'Composite', + class_name: 'Port' + } + } + } + }, + type: { + required: true, + is_constant: true, + serialized_name: 'type', + default_value: 'Public', + type: { + name: 'String' + } + }, + ip: { + required: false, + serialized_name: 'ip', + type: { + name: 'String' + } + }, + dns_name_label: { + required: false, + serialized_name: 'dnsNameLabel', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + read_only: true, + serialized_name: 'fqdn', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/log_analytics.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/log_analytics.rb new file mode 100644 index 0000000000..8b653adb86 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/log_analytics.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Container group log analytics information. + # + class LogAnalytics + + include MsRestAzure + + # @return [String] The workspace id for log analytics + attr_accessor :workspace_id + + # @return [String] The workspace key for log analytics + attr_accessor :workspace_key + + + # + # Mapper for LogAnalytics class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'LogAnalytics', + type: { + name: 'Composite', + class_name: 'LogAnalytics', + model_properties: { + workspace_id: { + required: true, + serialized_name: 'workspaceId', + type: { + name: 'String' + } + }, + workspace_key: { + required: true, + serialized_name: 'workspaceKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/logs.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/logs.rb new file mode 100644 index 0000000000..051b0f7cdd --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/logs.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The logs. + # + class Logs + + include MsRestAzure + + # @return [String] The content of the log. + attr_accessor :content + + + # + # Mapper for Logs class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Logs', + type: { + name: 'Composite', + class_name: 'Logs', + model_properties: { + content: { + required: false, + serialized_name: 'content', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb new file mode 100644 index 0000000000..3b18ec683c --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for OperatingSystemTypes + # + module OperatingSystemTypes + Windows = "Windows" + Linux = "Linux" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operation.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operation.rb new file mode 100644 index 0000000000..1ed301a1a0 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operation.rb @@ -0,0 +1,66 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # An operation for Azure Container Instance service. + # + class Operation + + include MsRestAzure + + # @return [String] The name of the operation. + attr_accessor :name + + # @return [OperationDisplay] The display information of the operation. + attr_accessor :display + + # @return [ContainerInstanceOperationsOrigin] The intended executor of + # the operation. Possible values include: 'User', 'System' + attr_accessor :origin + + + # + # Mapper for Operation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + required: true, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationDisplay' + } + }, + origin: { + required: false, + serialized_name: 'origin', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operation_display.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operation_display.rb new file mode 100644 index 0000000000..71d1e9cd16 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operation_display.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The display information of the operation. + # + class OperationDisplay + + include MsRestAzure + + # @return [String] The name of the provider of the operation. + attr_accessor :provider + + # @return [String] The name of the resource type of the operation. + attr_accessor :resource + + # @return [String] The friendly name of the operation. + attr_accessor :operation + + # @return [String] The description of the operation. + attr_accessor :description + + + # + # Mapper for OperationDisplay class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Operation_display', + type: { + name: 'Composite', + class_name: 'OperationDisplay', + model_properties: { + provider: { + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb new file mode 100644 index 0000000000..2892cfeb7d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb @@ -0,0 +1,63 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The operation list response that contains all operations for Azure + # Container Instance service. + # + class OperationListResult + + include MsRestAzure + + # @return [Array] The list of operations. + attr_accessor :value + + # @return [String] The URI to fetch the next page of operations. + attr_accessor :next_link + + + # + # Mapper for OperationListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationListResult', + type: { + name: 'Composite', + class_name: 'OperationListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OperationElementType', + type: { + name: 'Composite', + class_name: 'Operation' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/port.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/port.rb new file mode 100644 index 0000000000..b70a97aa82 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/port.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The port exposed on the container group. + # + class Port + + include MsRestAzure + + # @return [ContainerGroupNetworkProtocol] The protocol associated with + # the port. Possible values include: 'TCP', 'UDP' + attr_accessor :protocol + + # @return [Integer] The port number. + attr_accessor :port + + + # + # Mapper for Port class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Port', + type: { + name: 'Composite', + class_name: 'Port', + model_properties: { + protocol: { + required: false, + serialized_name: 'protocol', + type: { + name: 'String' + } + }, + port: { + required: true, + serialized_name: 'port', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource.rb new file mode 100644 index 0000000000..93cbebcfd7 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The Resource model definition. + # + class Resource + + include MsRestAzure + + # @return [String] The resource id. + attr_accessor :id + + # @return [String] The resource name. + attr_accessor :name + + # @return [String] The resource type. + attr_accessor :type + + # @return [String] The resource location. + attr_accessor :location + + # @return [Hash{String => String}] The resource tags. + attr_accessor :tags + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource_limits.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource_limits.rb new file mode 100644 index 0000000000..c154e380d5 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource_limits.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The resource limits. + # + class ResourceLimits + + include MsRestAzure + + # @return [Float] The memory limit in GB of this container instance. + attr_accessor :memory_in_gb + + # @return [Float] The CPU limit of this container instance. + attr_accessor :cpu + + + # + # Mapper for ResourceLimits class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResourceLimits', + type: { + name: 'Composite', + class_name: 'ResourceLimits', + model_properties: { + memory_in_gb: { + required: false, + serialized_name: 'memoryInGB', + type: { + name: 'Double' + } + }, + cpu: { + required: false, + serialized_name: 'cpu', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource_requests.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource_requests.rb new file mode 100644 index 0000000000..a389e68a92 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource_requests.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The resource requests. + # + class ResourceRequests + + include MsRestAzure + + # @return [Float] The memory request in GB of this container instance. + attr_accessor :memory_in_gb + + # @return [Float] The CPU request of this container instance. + attr_accessor :cpu + + + # + # Mapper for ResourceRequests class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResourceRequests', + type: { + name: 'Composite', + class_name: 'ResourceRequests', + model_properties: { + memory_in_gb: { + required: true, + serialized_name: 'memoryInGB', + type: { + name: 'Double' + } + }, + cpu: { + required: true, + serialized_name: 'cpu', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb new file mode 100644 index 0000000000..00e14e5f9b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The resource requirements. + # + class ResourceRequirements + + include MsRestAzure + + # @return [ResourceRequests] The resource requests of this container + # instance. + attr_accessor :requests + + # @return [ResourceLimits] The resource limits of this container + # instance. + attr_accessor :limits + + + # + # Mapper for ResourceRequirements class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResourceRequirements', + type: { + name: 'Composite', + class_name: 'ResourceRequirements', + model_properties: { + requests: { + required: true, + serialized_name: 'requests', + type: { + name: 'Composite', + class_name: 'ResourceRequests' + } + }, + limits: { + required: false, + serialized_name: 'limits', + type: { + name: 'Composite', + class_name: 'ResourceLimits' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/usage.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/usage.rb new file mode 100644 index 0000000000..6fa0dee48b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/usage.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A single usage result + # + class Usage + + include MsRestAzure + + # @return [String] Unit of the usage result + attr_accessor :unit + + # @return [Integer] The current usage of the resource + attr_accessor :current_value + + # @return [Integer] The maximum permitted usage of the resource. + attr_accessor :limit + + # @return [UsageName] The name object of the resource + attr_accessor :name + + + # + # Mapper for Usage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Usage', + type: { + name: 'Composite', + class_name: 'Usage', + model_properties: { + unit: { + required: false, + read_only: true, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + current_value: { + required: false, + read_only: true, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + }, + limit: { + required: false, + read_only: true, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'UsageName' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb new file mode 100644 index 0000000000..b6f90c49f4 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The response containing the usage data + # + class UsageListResult + + include MsRestAzure + + # @return [Array] + attr_accessor :value + + + # + # Mapper for UsageListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UsageListResult', + type: { + name: 'Composite', + class_name: 'UsageListResult', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'UsageElementType', + type: { + name: 'Composite', + class_name: 'Usage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/usage_name.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/usage_name.rb new file mode 100644 index 0000000000..8dbd475b63 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/usage_name.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The name object of the resource + # + class UsageName + + include MsRestAzure + + # @return [String] The name of the resource + attr_accessor :value + + # @return [String] The localized name of the resource + attr_accessor :localized_value + + + # + # Mapper for UsageName class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Usage_name', + type: { + name: 'Composite', + class_name: 'UsageName', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'String' + } + }, + localized_value: { + required: false, + read_only: true, + serialized_name: 'localizedValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/volume.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/volume.rb new file mode 100644 index 0000000000..5c7547594d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/volume.rb @@ -0,0 +1,93 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The properties of the volume. + # + class Volume + + include MsRestAzure + + # @return [String] The name of the volume. + attr_accessor :name + + # @return [AzureFileVolume] The Azure File volume. + attr_accessor :azure_file + + # @return The empty directory volume. + attr_accessor :empty_dir + + # @return [Hash{String => String}] The secret volume. + attr_accessor :secret + + # @return [GitRepoVolume] The git repo volume. + attr_accessor :git_repo + + + # + # Mapper for Volume class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Volume', + type: { + name: 'Composite', + class_name: 'Volume', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + azure_file: { + required: false, + serialized_name: 'azureFile', + type: { + name: 'Composite', + class_name: 'AzureFileVolume' + } + }, + empty_dir: { + required: false, + serialized_name: 'emptyDir', + type: { + name: 'Object' + } + }, + secret: { + required: false, + serialized_name: 'secret', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + git_repo: { + required: false, + serialized_name: 'gitRepo', + type: { + name: 'Composite', + class_name: 'GitRepoVolume' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/volume_mount.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/volume_mount.rb new file mode 100644 index 0000000000..71d2041194 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/models/volume_mount.rb @@ -0,0 +1,66 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The properties of the volume mount. + # + class VolumeMount + + include MsRestAzure + + # @return [String] The name of the volume mount. + attr_accessor :name + + # @return [String] The path within the container where the volume should + # be mounted. Must not contain colon (:). + attr_accessor :mount_path + + # @return [Boolean] The flag indicating whether the volume mount is + # read-only. + attr_accessor :read_only + + + # + # Mapper for VolumeMount class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'VolumeMount', + type: { + name: 'Composite', + class_name: 'VolumeMount', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + mount_path: { + required: true, + serialized_name: 'mountPath', + type: { + name: 'String' + } + }, + read_only: { + required: false, + serialized_name: 'readOnly', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/module_definition.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/module_definition.rb new file mode 100644 index 0000000000..7359ebcf14 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::ContainerInstance end +module Azure::ContainerInstance::Mgmt end +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/operations.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/operations.rb new file mode 100644 index 0000000000..2f86fa4ed7 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/operations.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # Operations + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # List the operations for Azure Container Instance service. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] operation results. + # + def list(custom_headers = nil) + response = list_async(custom_headers).value! + response.body unless response.nil? + end + + # + # List the operations for Azure Container Instance service. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # List the operations for Azure Container Instance service. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.ContainerInstance/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/version.rb b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/version.rb new file mode 100644 index 0000000000..d53bf03778 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/version.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + VERSION = '0.16.0' +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance.rb new file mode 100644 index 0000000000..398acb277c --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance.rb @@ -0,0 +1,73 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +require 'uri' +require 'cgi' +require 'date' +require 'json' +require 'base64' +require 'erb' +require 'securerandom' +require 'time' +require 'timeliness' +require 'faraday' +require 'faraday-cookie_jar' +require 'concurrent' +require 'ms_rest' +require '2018-09-01/generated/azure_mgmt_container_instance/module_definition' +require 'ms_rest_azure' + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + autoload :ContainerGroups, '2018-09-01/generated/azure_mgmt_container_instance/container_groups.rb' + autoload :Operations, '2018-09-01/generated/azure_mgmt_container_instance/operations.rb' + autoload :ContainerGroupUsage, '2018-09-01/generated/azure_mgmt_container_instance/container_group_usage.rb' + autoload :ContainerOperations, '2018-09-01/generated/azure_mgmt_container_instance/container_operations.rb' + autoload :ContainerInstanceManagementClient, '2018-09-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb' + + module Models + autoload :IpAddress, '2018-09-01/generated/azure_mgmt_container_instance/models/ip_address.rb' + autoload :ContainerPort, '2018-09-01/generated/azure_mgmt_container_instance/models/container_port.rb' + autoload :ContainerGroupPropertiesInstanceView, '2018-09-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb' + autoload :ContainerState, '2018-09-01/generated/azure_mgmt_container_instance/models/container_state.rb' + autoload :LogAnalytics, '2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics.rb' + autoload :ContainerPropertiesInstanceView, '2018-09-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb' + autoload :ContainerGroupDiagnostics, '2018-09-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb' + autoload :ResourceLimits, '2018-09-01/generated/azure_mgmt_container_instance/models/resource_limits.rb' + autoload :ContainerGroupNetworkProfile, '2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb' + autoload :VolumeMount, '2018-09-01/generated/azure_mgmt_container_instance/models/volume_mount.rb' + autoload :ContainerExec, '2018-09-01/generated/azure_mgmt_container_instance/models/container_exec.rb' + autoload :ContainerProbe, '2018-09-01/generated/azure_mgmt_container_instance/models/container_probe.rb' + autoload :OperationDisplay, '2018-09-01/generated/azure_mgmt_container_instance/models/operation_display.rb' + autoload :AzureFileVolume, '2018-09-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb' + autoload :Operation, '2018-09-01/generated/azure_mgmt_container_instance/models/operation.rb' + autoload :Volume, '2018-09-01/generated/azure_mgmt_container_instance/models/volume.rb' + autoload :OperationListResult, '2018-09-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb' + autoload :Port, '2018-09-01/generated/azure_mgmt_container_instance/models/port.rb' + autoload :UsageName, '2018-09-01/generated/azure_mgmt_container_instance/models/usage_name.rb' + autoload :Event, '2018-09-01/generated/azure_mgmt_container_instance/models/event.rb' + autoload :Usage, '2018-09-01/generated/azure_mgmt_container_instance/models/usage.rb' + autoload :ResourceRequirements, '2018-09-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb' + autoload :UsageListResult, '2018-09-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb' + autoload :Container, '2018-09-01/generated/azure_mgmt_container_instance/models/container.rb' + autoload :ContainerGroupListResult, '2018-09-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb' + autoload :ImageRegistryCredential, '2018-09-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb' + autoload :Logs, '2018-09-01/generated/azure_mgmt_container_instance/models/logs.rb' + autoload :ResourceRequests, '2018-09-01/generated/azure_mgmt_container_instance/models/resource_requests.rb' + autoload :ContainerExecRequestTerminalSize, '2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb' + autoload :GitRepoVolume, '2018-09-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb' + autoload :ContainerExecRequest, '2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb' + autoload :ContainerHttpGet, '2018-09-01/generated/azure_mgmt_container_instance/models/container_http_get.rb' + autoload :ContainerExecResponse, '2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb' + autoload :EnvironmentVariable, '2018-09-01/generated/azure_mgmt_container_instance/models/environment_variable.rb' + autoload :Resource, '2018-09-01/generated/azure_mgmt_container_instance/models/resource.rb' + autoload :ContainerGroup, '2018-09-01/generated/azure_mgmt_container_instance/models/container_group.rb' + autoload :ContainerNetworkProtocol, '2018-09-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb' + autoload :ContainerGroupRestartPolicy, '2018-09-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb' + autoload :ContainerGroupNetworkProtocol, '2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb' + autoload :OperatingSystemTypes, '2018-09-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb' + autoload :LogAnalyticsLogType, '2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb' + autoload :ContainerInstanceOperationsOrigin, '2018-09-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb' + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_group_usage.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_group_usage.rb new file mode 100644 index 0000000000..8fc45c23c4 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_group_usage.rb @@ -0,0 +1,112 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # ContainerGroupUsage + # + class ContainerGroupUsage + include MsRestAzure + + # + # Creates and initializes a new instance of the ContainerGroupUsage class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Get the usage for a subscription + # + # @param location [String] The identifier for the physical azure location. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [UsageListResult] operation results. + # + def list(location, custom_headers = nil) + response = list_async(location, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the usage for a subscription + # + # @param location [String] The identifier for the physical azure location. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(location, custom_headers = nil) + list_async(location, custom_headers).value! + end + + # + # Get the usage for a subscription + # + # @param location [String] The identifier for the physical azure location. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(location, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, 'location is nil' if location.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'location' => location}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::UsageListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_groups.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_groups.rb new file mode 100644 index 0000000000..03380e377c --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_groups.rb @@ -0,0 +1,1199 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # ContainerGroups + # + class ContainerGroups + include MsRestAzure + + # + # Creates and initializes a new instance of the ContainerGroups class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list(custom_headers = nil) + first_page = list_as_lazy(custom_headers) + first_page.get_all_items + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Array] operation results. + # + def list_by_resource_group(resource_group_name, custom_headers = nil) + first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers) + first_page.get_all_items + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil) + list_by_resource_group_async(resource_group_name, custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_async(resource_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get the properties of the specified container group. + # + # Gets the properties of the specified container group in the specified + # subscription and resource group. The operation returns the properties of each + # container group including containers, image registry credentials, restart + # policy, IP address type, OS type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def get(resource_group_name, container_group_name, custom_headers = nil) + response = get_async(resource_group_name, container_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the properties of the specified container group. + # + # Gets the properties of the specified container group in the specified + # subscription and resource group. The operation returns the properties of each + # container group including containers, image registry credentials, restart + # policy, IP address type, OS type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def get_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + get_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Get the properties of the specified container group. + # + # Gets the properties of the specified container group in the specified + # subscription and resource group. The operation returns the properties of each + # container group including containers, image registry credentials, restart + # policy, IP address type, OS type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def get_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def create_or_update(resource_group_name, container_group_name, container_group, custom_headers = nil) + response = create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers).value! + response.body unless response.nil? + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers = nil) + # Send request + promise = begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + parsed_response = @client.deserialize(result_mapper, parsed_response) + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Update container groups. + # + # Updates container group tags with specified values. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param resource [Resource] The container group resource with just the tags to + # be updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def update(resource_group_name, container_group_name, resource, custom_headers = nil) + response = update_async(resource_group_name, container_group_name, resource, custom_headers).value! + response.body unless response.nil? + end + + # + # Update container groups. + # + # Updates container group tags with specified values. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param resource [Resource] The container group resource with just the tags to + # be updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def update_with_http_info(resource_group_name, container_group_name, resource, custom_headers = nil) + update_async(resource_group_name, container_group_name, resource, custom_headers).value! + end + + # + # Update container groups. + # + # Updates container group tags with specified values. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param resource [Resource] The container group resource with just the tags to + # be updated. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def update_async(resource_group_name, container_group_name, resource, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'resource is nil' if resource.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::Resource.mapper() + request_content = @client.serialize(request_mapper, resource) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:patch, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Delete the specified container group. + # + # Delete the specified container group in the specified subscription and + # resource group. The operation does not delete other resources provided by the + # user, such as volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def delete(resource_group_name, container_group_name, custom_headers = nil) + response = delete_async(resource_group_name, container_group_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Delete the specified container group. + # + # Delete the specified container group in the specified subscription and + # resource group. The operation does not delete other resources provided by the + # user, such as volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def delete_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + delete_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Delete the specified container group. + # + # Delete the specified container group in the specified subscription and + # resource group. The operation does not delete other resources provided by the + # user, such as volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def delete_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:delete, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Restarts all containers in a container group. + # + # Restarts all containers in a container group in place. If container image has + # updates, new image will be downloaded. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + def restart(resource_group_name, container_group_name, custom_headers = nil) + response = restart_async(resource_group_name, container_group_name, custom_headers).value! + nil + end + + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Concurrent::Promise] promise which provides async access to http + # response. + # + def restart_async(resource_group_name, container_group_name, custom_headers = nil) + # Send request + promise = begin_restart_async(resource_group_name, container_group_name, custom_headers) + + promise = promise.then do |response| + # Defining deserialization method. + deserialize_method = lambda do |parsed_response| + end + + # Waiting for response. + @client.get_long_running_operation_result(response, deserialize_method) + end + + promise + end + + # + # Stops all containers in a container group. + # + # Stops all containers in a container group. Compute resources will be + # deallocated and billing will stop. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def stop(resource_group_name, container_group_name, custom_headers = nil) + response = stop_async(resource_group_name, container_group_name, custom_headers).value! + nil + end + + # + # Stops all containers in a container group. + # + # Stops all containers in a container group. Compute resources will be + # deallocated and billing will stop. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def stop_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + stop_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Stops all containers in a container group. + # + # Stops all containers in a container group. Compute resources will be + # deallocated and billing will stop. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def stop_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroup] operation results. + # + def begin_create_or_update(resource_group_name, container_group_name, container_group, custom_headers = nil) + response = begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers).value! + response.body unless response.nil? + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_create_or_update_with_http_info(resource_group_name, container_group_name, container_group, custom_headers = nil) + begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers).value! + end + + # + # Create or update container groups. + # + # Create or update container groups with specified configurations. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_group [ContainerGroup] The properties of the container group + # to be created or updated. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'container_group is nil' if container_group.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + request_content = @client.serialize(request_mapper, container_group) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:put, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 || status_code == 201 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + # Deserialize Response + if status_code == 201 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Restarts all containers in a container group. + # + # Restarts all containers in a container group in place. If container image has + # updates, new image will be downloaded. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # + def begin_restart(resource_group_name, container_group_name, custom_headers = nil) + response = begin_restart_async(resource_group_name, container_group_name, custom_headers).value! + nil + end + + # + # Restarts all containers in a container group. + # + # Restarts all containers in a container group in place. If container image has + # updates, new image will be downloaded. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def begin_restart_with_http_info(resource_group_name, container_group_name, custom_headers = nil) + begin_restart_async(resource_group_name, container_group_name, custom_headers).value! + end + + # + # Restarts all containers in a container group. + # + # Restarts all containers in a container group in place. If container image has + # updates, new image will be downloaded. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def begin_restart_async(resource_group_name, container_group_name, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 204 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] operation results. + # + def list_next(next_page_link, custom_headers = nil) + response = list_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_next_with_http_info(next_page_link, custom_headers = nil) + list_next_async(next_page_link, custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] operation results. + # + def list_by_resource_group_next(next_page_link, custom_headers = nil) + response = list_by_resource_group_next_async(next_page_link, custom_headers).value! + response.body unless response.nil? + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil) + list_by_resource_group_next_async(next_page_link, custom_headers).value! + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param next_page_link [String] The NextLink from the previous successful call + # to List operation. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_by_resource_group_next_async(next_page_link, custom_headers = nil) + fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '{nextLink}' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + skip_encoding_path_params: {'nextLink' => next_page_link}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Get a list of container groups in the specified subscription. + # + # Get a list of container groups in the specified subscription. This operation + # returns properties of each container group including containers, image + # registry credentials, restart policy, IP address type, OS type, state, and + # volumes. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] which provide lazy access to pages of the + # response. + # + def list_as_lazy(custom_headers = nil) + response = list_async(custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_next_async(next_page_link, custom_headers) + end + page + end + end + + # + # Get a list of container groups in the specified subscription and resource + # group. + # + # Get a list of container groups in a specified subscription and resource + # group. This operation returns properties of each container group including + # containers, image registry credentials, restart policy, IP address type, OS + # type, state, and volumes. + # + # @param resource_group_name [String] The name of the resource group. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerGroupListResult] which provide lazy access to pages of the + # response. + # + def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil) + response = list_by_resource_group_async(resource_group_name, custom_headers).value! + unless response.nil? + page = response.body + page.next_method = Proc.new do |next_page_link| + list_by_resource_group_next_async(next_page_link, custom_headers) + end + page + end + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb new file mode 100644 index 0000000000..de788db15f --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb @@ -0,0 +1,143 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # A service client - single point of access to the REST API. + # + class ContainerInstanceManagementClient < MsRestAzure::AzureServiceClient + include MsRestAzure + include MsRestAzure::Serialization + + # @return [String] the base URI of the service. + attr_accessor :base_url + + # @return Credentials needed for the client to connect to Azure. + attr_reader :credentials + + # @return [String] Subscription credentials which uniquely identify + # Microsoft Azure subscription. The subscription ID forms part of the URI + # for every service call. + attr_accessor :subscription_id + + # @return [String] Client API version + attr_reader :api_version + + # @return [String] Gets or sets the preferred language for the response. + attr_accessor :accept_language + + # @return [Integer] Gets or sets the retry timeout in seconds for Long + # Running Operations. Default value is 30. + attr_accessor :long_running_operation_retry_timeout + + # @return [Boolean] When set to true a unique x-ms-client-request-id value + # is generated and included in each request. Default is true. + attr_accessor :generate_client_request_id + + # @return [ContainerGroups] container_groups + attr_reader :container_groups + + # @return [Operations] operations + attr_reader :operations + + # @return [ContainerGroupUsage] container_group_usage + attr_reader :container_group_usage + + # @return [ContainerOperations] container_operations + attr_reader :container_operations + + # + # Creates initializes a new instance of the ContainerInstanceManagementClient class. + # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. + # @param base_url [String] the base URI of the service. + # @param options [Array] filters to be applied to the HTTP requests. + # + def initialize(credentials = nil, base_url = nil, options = nil) + super(credentials, options) + @base_url = base_url || 'https://management.azure.com' + + fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? + @credentials = credentials + + @container_groups = ContainerGroups.new(self) + @operations = Operations.new(self) + @container_group_usage = ContainerGroupUsage.new(self) + @container_operations = ContainerOperations.new(self) + @api_version = '2018-09-01' + @accept_language = 'en-US' + @long_running_operation_retry_timeout = 30 + @generate_client_request_id = true + add_telemetry + end + + # + # Makes a request and returns the body of the response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Hash{String=>String}] containing the body of the response. + # Example: + # + # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" + # path = "/path" + # options = { + # body: request_content, + # query_params: {'api-version' => '2016-02-01'} + # } + # result = @client.make_request(:put, path, options) + # + def make_request(method, path, options = {}) + result = make_request_with_http_info(method, path, options) + result.body unless result.nil? + end + + # + # Makes a request and returns the operation response. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status. + # + def make_request_with_http_info(method, path, options = {}) + result = make_request_async(method, path, options).value! + result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) + result + end + + # + # Makes a request asynchronously. + # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. + # @param path [String] the path, relative to {base_url}. + # @param options [Hash{String=>String}] specifying any request options like :body. + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def make_request_async(method, path, options = {}) + fail ArgumentError, 'method is nil' if method.nil? + fail ArgumentError, 'path is nil' if path.nil? + + request_url = options[:base_url] || @base_url + + request_headers = @request_headers + request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil? + options.merge!({headers: request_headers.merge(options[:headers] || {})}) + options.merge!({credentials: @credentials}) unless @credentials.nil? + + super(request_url, method, path, options) + end + + + private + # + # Adds telemetry information. + # + def add_telemetry + sdk_information = 'azure_mgmt_container_instance' + if defined? Azure::ContainerInstance::Mgmt::V2018_02_01_preview::VERSION + sdk_information = "#{sdk_information}/#{Azure::ContainerInstance::Mgmt::V2018_02_01_preview::VERSION}" + end + add_user_agent_information(sdk_information) + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_operations.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_operations.rb new file mode 100644 index 0000000000..58c9481091 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/container_operations.rb @@ -0,0 +1,258 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # ContainerOperations + # + class ContainerOperations + include MsRestAzure + + # + # Creates and initializes a new instance of the ContainerOperations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # Get the logs for a specified container instance. + # + # Get the logs for a specified container instance in a specified resource group + # and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param tail [Integer] The number of lines to show from the tail of the + # container instance log. If not provided, all available logs are shown up to + # 4mb. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [Logs] operation results. + # + def list_logs(resource_group_name, container_group_name, container_name, tail = nil, custom_headers = nil) + response = list_logs_async(resource_group_name, container_group_name, container_name, tail, custom_headers).value! + response.body unless response.nil? + end + + # + # Get the logs for a specified container instance. + # + # Get the logs for a specified container instance in a specified resource group + # and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param tail [Integer] The number of lines to show from the tail of the + # container instance log. If not provided, all available logs are shown up to + # 4mb. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_logs_with_http_info(resource_group_name, container_group_name, container_name, tail = nil, custom_headers = nil) + list_logs_async(resource_group_name, container_group_name, container_name, tail, custom_headers).value! + end + + # + # Get the logs for a specified container instance. + # + # Get the logs for a specified container instance in a specified resource group + # and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param tail [Integer] The number of lines to show from the tail of the + # container instance log. If not provided, all available logs are shown up to + # 4mb. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_logs_async(resource_group_name, container_group_name, container_name, tail = nil, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version,'tail' => tail}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::Logs.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Executes a command in a specific container instance. + # + # Executes a command for a specific container instance in a specified resource + # group and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param container_exec_request [ContainerExecRequest] The request for the exec + # command. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [ContainerExecResponse] operation results. + # + def execute_command(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers = nil) + response = execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers).value! + response.body unless response.nil? + end + + # + # Executes a command in a specific container instance. + # + # Executes a command for a specific container instance in a specified resource + # group and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param container_exec_request [ContainerExecRequest] The request for the exec + # command. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def execute_command_with_http_info(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers = nil) + execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers).value! + end + + # + # Executes a command in a specific container instance. + # + # Executes a command for a specific container instance in a specified resource + # group and container group. + # + # @param resource_group_name [String] The name of the resource group. + # @param container_group_name [String] The name of the container group. + # @param container_name [String] The name of the container instance. + # @param container_exec_request [ContainerExecRequest] The request for the exec + # command. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers = nil) + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'container_group_name is nil' if container_group_name.nil? + fail ArgumentError, 'container_name is nil' if container_name.nil? + fail ArgumentError, 'container_exec_request is nil' if container_exec_request.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + + request_headers['Content-Type'] = 'application/json; charset=utf-8' + + # Serialize Request + request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerExecRequest.mapper() + request_content = @client.serialize(request_mapper, container_exec_request) + request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil + + path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name,'containerName' => container_name}, + query_params: {'api-version' => @client.api_version}, + body: request_content, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerExecResponse.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb new file mode 100644 index 0000000000..ca1fcc2318 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The properties of the Azure File volume. Azure File shares are mounted as + # volumes. + # + class AzureFileVolume + + include MsRestAzure + + # @return [String] The name of the Azure File share to be mounted as a + # volume. + attr_accessor :share_name + + # @return [Boolean] The flag indicating whether the Azure File shared + # mounted as a volume is read-only. + attr_accessor :read_only + + # @return [String] The name of the storage account that contains the + # Azure File share. + attr_accessor :storage_account_name + + # @return [String] The storage account access key used to access the + # Azure File share. + attr_accessor :storage_account_key + + + # + # Mapper for AzureFileVolume class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'AzureFileVolume', + type: { + name: 'Composite', + class_name: 'AzureFileVolume', + model_properties: { + share_name: { + required: true, + serialized_name: 'shareName', + type: { + name: 'String' + } + }, + read_only: { + required: false, + serialized_name: 'readOnly', + type: { + name: 'Boolean' + } + }, + storage_account_name: { + required: true, + serialized_name: 'storageAccountName', + type: { + name: 'String' + } + }, + storage_account_key: { + required: false, + serialized_name: 'storageAccountKey', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container.rb new file mode 100644 index 0000000000..e6316c3382 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container.rb @@ -0,0 +1,177 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A container instance. + # + class Container + + include MsRestAzure + + # @return [String] The user-provided name of the container instance. + attr_accessor :name + + # @return [String] The name of the image used to create the container + # instance. + attr_accessor :image + + # @return [Array] The commands to execute within the container + # instance in exec form. + attr_accessor :command + + # @return [Array] The exposed ports on the container + # instance. + attr_accessor :ports + + # @return [Array] The environment variables to set + # in the container instance. + attr_accessor :environment_variables + + # @return [ContainerPropertiesInstanceView] The instance view of the + # container instance. Only valid in response. + attr_accessor :instance_view + + # @return [ResourceRequirements] The resource requirements of the + # container instance. + attr_accessor :resources + + # @return [Array] The volume mounts available to the + # container instance. + attr_accessor :volume_mounts + + # @return [ContainerProbe] The liveness probe. + attr_accessor :liveness_probe + + # @return [ContainerProbe] The readiness probe. + attr_accessor :readiness_probe + + + # + # Mapper for Container class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Container', + type: { + name: 'Composite', + class_name: 'Container', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + image: { + required: true, + serialized_name: 'properties.image', + type: { + name: 'String' + } + }, + command: { + required: false, + serialized_name: 'properties.command', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + ports: { + required: false, + serialized_name: 'properties.ports', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ContainerPortElementType', + type: { + name: 'Composite', + class_name: 'ContainerPort' + } + } + } + }, + environment_variables: { + required: false, + serialized_name: 'properties.environmentVariables', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EnvironmentVariableElementType', + type: { + name: 'Composite', + class_name: 'EnvironmentVariable' + } + } + } + }, + instance_view: { + required: false, + read_only: true, + serialized_name: 'properties.instanceView', + type: { + name: 'Composite', + class_name: 'ContainerPropertiesInstanceView' + } + }, + resources: { + required: true, + serialized_name: 'properties.resources', + type: { + name: 'Composite', + class_name: 'ResourceRequirements' + } + }, + volume_mounts: { + required: false, + serialized_name: 'properties.volumeMounts', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'VolumeMountElementType', + type: { + name: 'Composite', + class_name: 'VolumeMount' + } + } + } + }, + liveness_probe: { + required: false, + serialized_name: 'properties.livenessProbe', + type: { + name: 'Composite', + class_name: 'ContainerProbe' + } + }, + readiness_probe: { + required: false, + serialized_name: 'properties.readinessProbe', + type: { + name: 'Composite', + class_name: 'ContainerProbe' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec.rb new file mode 100644 index 0000000000..0ada7cb63d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec.rb @@ -0,0 +1,51 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container execution command, for liveness or readiness probe + # + class ContainerExec + + include MsRestAzure + + # @return [Array] The commands to execute within the container. + attr_accessor :command + + + # + # Mapper for ContainerExec class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExec', + type: { + name: 'Composite', + class_name: 'ContainerExec', + model_properties: { + command: { + required: false, + serialized_name: 'command', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb new file mode 100644 index 0000000000..0f4e6105a6 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container exec request. + # + class ContainerExecRequest + + include MsRestAzure + + # @return [String] The command to be executed. + attr_accessor :command + + # @return [ContainerExecRequestTerminalSize] The size of the terminal. + attr_accessor :terminal_size + + + # + # Mapper for ContainerExecRequest class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExecRequest', + type: { + name: 'Composite', + class_name: 'ContainerExecRequest', + model_properties: { + command: { + required: false, + serialized_name: 'command', + type: { + name: 'String' + } + }, + terminal_size: { + required: false, + serialized_name: 'terminalSize', + type: { + name: 'Composite', + class_name: 'ContainerExecRequestTerminalSize' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb new file mode 100644 index 0000000000..f7b939bfb2 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The size of the terminal. + # + class ContainerExecRequestTerminalSize + + include MsRestAzure + + # @return [Integer] The row size of the terminal + attr_accessor :rows + + # @return [Integer] The column size of the terminal + attr_accessor :cols + + + # + # Mapper for ContainerExecRequestTerminalSize class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExecRequest_terminalSize', + type: { + name: 'Composite', + class_name: 'ContainerExecRequestTerminalSize', + model_properties: { + rows: { + required: false, + serialized_name: 'rows', + type: { + name: 'Number' + } + }, + cols: { + required: false, + serialized_name: 'cols', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb new file mode 100644 index 0000000000..c5079dab0b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The information for the container exec command. + # + class ContainerExecResponse + + include MsRestAzure + + # @return [String] The uri for the exec websocket. + attr_accessor :web_socket_uri + + # @return [String] The password to start the exec command. + attr_accessor :password + + + # + # Mapper for ContainerExecResponse class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerExecResponse', + type: { + name: 'Composite', + class_name: 'ContainerExecResponse', + model_properties: { + web_socket_uri: { + required: false, + serialized_name: 'webSocketUri', + type: { + name: 'String' + } + }, + password: { + required: false, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group.rb new file mode 100644 index 0000000000..60efcfed51 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group.rb @@ -0,0 +1,222 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A container group. + # + class ContainerGroup < Resource + + include MsRestAzure + + # @return [String] The provisioning state of the container group. This + # only appears in the response. + attr_accessor :provisioning_state + + # @return [Array] The containers within the container group. + attr_accessor :containers + + # @return [Array] The image registry credentials + # by which the container group is created from. + attr_accessor :image_registry_credentials + + # @return [ContainerGroupRestartPolicy] Restart policy for all containers + # within the container group. + # - `Always` Always restart + # - `OnFailure` Restart on failure + # - `Never` Never restart + # . Possible values include: 'Always', 'OnFailure', 'Never' + attr_accessor :restart_policy + + # @return [IpAddress] The IP address type of the container group. + attr_accessor :ip_address + + # @return [OperatingSystemTypes] The operating system type required by + # the containers in the container group. Possible values include: + # 'Windows', 'Linux' + attr_accessor :os_type + + # @return [Array] The list of volumes that can be mounted by + # containers in this container group. + attr_accessor :volumes + + # @return [ContainerGroupPropertiesInstanceView] The instance view of the + # container group. Only valid in response. + attr_accessor :instance_view + + # @return [ContainerGroupDiagnostics] The diagnostic information for a + # container group. + attr_accessor :diagnostics + + # @return [ContainerGroupNetworkProfile] The network profile information + # for a container group. + attr_accessor :network_profile + + + # + # Mapper for ContainerGroup class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroup', + type: { + name: 'Composite', + class_name: 'ContainerGroup', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.provisioningState', + type: { + name: 'String' + } + }, + containers: { + required: false, + serialized_name: 'properties.containers', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ContainerElementType', + type: { + name: 'Composite', + class_name: 'Container' + } + } + } + }, + image_registry_credentials: { + required: false, + serialized_name: 'properties.imageRegistryCredentials', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ImageRegistryCredentialElementType', + type: { + name: 'Composite', + class_name: 'ImageRegistryCredential' + } + } + } + }, + restart_policy: { + required: false, + serialized_name: 'properties.restartPolicy', + type: { + name: 'String' + } + }, + ip_address: { + required: false, + serialized_name: 'properties.ipAddress', + type: { + name: 'Composite', + class_name: 'IpAddress' + } + }, + os_type: { + required: false, + serialized_name: 'properties.osType', + type: { + name: 'String' + } + }, + volumes: { + required: false, + serialized_name: 'properties.volumes', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'VolumeElementType', + type: { + name: 'Composite', + class_name: 'Volume' + } + } + } + }, + instance_view: { + required: false, + read_only: true, + serialized_name: 'properties.instanceView', + type: { + name: 'Composite', + class_name: 'ContainerGroupPropertiesInstanceView' + } + }, + diagnostics: { + required: false, + serialized_name: 'properties.diagnostics', + type: { + name: 'Composite', + class_name: 'ContainerGroupDiagnostics' + } + }, + network_profile: { + required: false, + serialized_name: 'properties.networkProfile', + type: { + name: 'Composite', + class_name: 'ContainerGroupNetworkProfile' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb new file mode 100644 index 0000000000..3c00f67412 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb @@ -0,0 +1,45 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Container group diagnostic information. + # + class ContainerGroupDiagnostics + + include MsRestAzure + + # @return [LogAnalytics] Container group log analytics information. + attr_accessor :log_analytics + + + # + # Mapper for ContainerGroupDiagnostics class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroupDiagnostics', + type: { + name: 'Composite', + class_name: 'ContainerGroupDiagnostics', + model_properties: { + log_analytics: { + required: false, + serialized_name: 'logAnalytics', + type: { + name: 'Composite', + class_name: 'LogAnalytics' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb new file mode 100644 index 0000000000..8b6e25e433 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb @@ -0,0 +1,95 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container group list response that contains the container group + # properties. + # + class ContainerGroupListResult + + include MsRestAzure + + include MsRest::JSONable + # @return [Array] The list of container groups. + attr_accessor :value + + # @return [String] The URI to fetch the next page of container groups. + attr_accessor :next_link + + # return [Proc] with next page method call. + attr_accessor :next_method + + # + # Gets the rest of the items for the request, enabling auto-pagination. + # + # @return [Array] operation results. + # + def get_all_items + items = @value + page = self + while page.next_link != nil do + page = page.get_next_page + items.concat(page.value) + end + items + end + + # + # Gets the next page of results. + # + # @return [ContainerGroupListResult] with next page content. + # + def get_next_page + response = @next_method.call(@next_link).value! unless @next_method.nil? + unless response.nil? + @next_link = response.body.next_link + @value = response.body.value + self + end + end + + # + # Mapper for ContainerGroupListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroupListResult', + type: { + name: 'Composite', + class_name: 'ContainerGroupListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'ContainerGroupElementType', + type: { + name: 'Composite', + class_name: 'ContainerGroup' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb new file mode 100644 index 0000000000..9c3f172ff0 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Container group network profile information. + # + class ContainerGroupNetworkProfile + + include MsRestAzure + + # @return [String] The identifier for a network profile. + attr_accessor :id + + + # + # Mapper for ContainerGroupNetworkProfile class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroupNetworkProfile', + type: { + name: 'Composite', + class_name: 'ContainerGroupNetworkProfile', + model_properties: { + id: { + required: true, + serialized_name: 'id', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb new file mode 100644 index 0000000000..dab05d0f54 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerGroupNetworkProtocol + # + module ContainerGroupNetworkProtocol + TCP = "TCP" + UDP = "UDP" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb new file mode 100644 index 0000000000..744fce441b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The instance view of the container group. Only valid in response. + # + class ContainerGroupPropertiesInstanceView + + include MsRestAzure + + # @return [Array] The events of this container group. + attr_accessor :events + + # @return [String] The state of the container group. Only valid in + # response. + attr_accessor :state + + + # + # Mapper for ContainerGroupPropertiesInstanceView class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerGroup_properties_instanceView', + type: { + name: 'Composite', + class_name: 'ContainerGroupPropertiesInstanceView', + model_properties: { + events: { + required: false, + read_only: true, + serialized_name: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EventElementType', + type: { + name: 'Composite', + class_name: 'Event' + } + } + } + }, + state: { + required: false, + read_only: true, + serialized_name: 'state', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb new file mode 100644 index 0000000000..7906ba0862 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb @@ -0,0 +1,17 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerGroupRestartPolicy + # + module ContainerGroupRestartPolicy + Always = "Always" + OnFailure = "OnFailure" + Never = "Never" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_http_get.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_http_get.rb new file mode 100644 index 0000000000..ab1369ab9c --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_http_get.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container Http Get settings, for liveness or readiness probe + # + class ContainerHttpGet + + include MsRestAzure + + # @return [String] The path to probe. + attr_accessor :path + + # @return [Integer] The port number to probe. + attr_accessor :port + + # @return [Enum] The scheme. Possible values include: 'http', 'https' + attr_accessor :scheme + + + # + # Mapper for ContainerHttpGet class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerHttpGet', + type: { + name: 'Composite', + class_name: 'ContainerHttpGet', + model_properties: { + path: { + required: false, + serialized_name: 'path', + type: { + name: 'String' + } + }, + port: { + required: true, + serialized_name: 'port', + type: { + name: 'Number' + } + }, + scheme: { + required: false, + serialized_name: 'scheme', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb new file mode 100644 index 0000000000..30fbc87af0 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerInstanceOperationsOrigin + # + module ContainerInstanceOperationsOrigin + User = "User" + System = "System" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb new file mode 100644 index 0000000000..4aae6a06ed --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for ContainerNetworkProtocol + # + module ContainerNetworkProtocol + TCP = "TCP" + UDP = "UDP" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_port.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_port.rb new file mode 100644 index 0000000000..77f5d53b1d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_port.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The port exposed on the container instance. + # + class ContainerPort + + include MsRestAzure + + # @return [ContainerNetworkProtocol] The protocol associated with the + # port. Possible values include: 'TCP', 'UDP' + attr_accessor :protocol + + # @return [Integer] The port number exposed within the container group. + attr_accessor :port + + + # + # Mapper for ContainerPort class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerPort', + type: { + name: 'Composite', + class_name: 'ContainerPort', + model_properties: { + protocol: { + required: false, + serialized_name: 'protocol', + type: { + name: 'String' + } + }, + port: { + required: true, + serialized_name: 'port', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_probe.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_probe.rb new file mode 100644 index 0000000000..d0b7dd28ad --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_probe.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container probe, for liveness or readiness + # + class ContainerProbe + + include MsRestAzure + + # @return [ContainerExec] The execution command to probe + attr_accessor :exec + + # @return [ContainerHttpGet] The Http Get settings to probe + attr_accessor :http_get + + # @return [Integer] The initial delay seconds. + attr_accessor :initial_delay_seconds + + # @return [Integer] The period seconds. + attr_accessor :period_seconds + + # @return [Integer] The failure threshold. + attr_accessor :failure_threshold + + # @return [Integer] The success threshold. + attr_accessor :success_threshold + + # @return [Integer] The timeout seconds. + attr_accessor :timeout_seconds + + + # + # Mapper for ContainerProbe class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerProbe', + type: { + name: 'Composite', + class_name: 'ContainerProbe', + model_properties: { + exec: { + required: false, + serialized_name: 'exec', + type: { + name: 'Composite', + class_name: 'ContainerExec' + } + }, + http_get: { + required: false, + serialized_name: 'httpGet', + type: { + name: 'Composite', + class_name: 'ContainerHttpGet' + } + }, + initial_delay_seconds: { + required: false, + serialized_name: 'initialDelaySeconds', + type: { + name: 'Number' + } + }, + period_seconds: { + required: false, + serialized_name: 'periodSeconds', + type: { + name: 'Number' + } + }, + failure_threshold: { + required: false, + serialized_name: 'failureThreshold', + type: { + name: 'Number' + } + }, + success_threshold: { + required: false, + serialized_name: 'successThreshold', + type: { + name: 'Number' + } + }, + timeout_seconds: { + required: false, + serialized_name: 'timeoutSeconds', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb new file mode 100644 index 0000000000..a66d37f60b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb @@ -0,0 +1,89 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The instance view of the container instance. Only valid in response. + # + class ContainerPropertiesInstanceView + + include MsRestAzure + + # @return [Integer] The number of times that the container instance has + # been restarted. + attr_accessor :restart_count + + # @return [ContainerState] Current container instance state. + attr_accessor :current_state + + # @return [ContainerState] Previous container instance state. + attr_accessor :previous_state + + # @return [Array] The events of the container instance. + attr_accessor :events + + + # + # Mapper for ContainerPropertiesInstanceView class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerProperties_instanceView', + type: { + name: 'Composite', + class_name: 'ContainerPropertiesInstanceView', + model_properties: { + restart_count: { + required: false, + read_only: true, + serialized_name: 'restartCount', + type: { + name: 'Number' + } + }, + current_state: { + required: false, + read_only: true, + serialized_name: 'currentState', + type: { + name: 'Composite', + class_name: 'ContainerState' + } + }, + previous_state: { + required: false, + read_only: true, + serialized_name: 'previousState', + type: { + name: 'Composite', + class_name: 'ContainerState' + } + }, + events: { + required: false, + read_only: true, + serialized_name: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'EventElementType', + type: { + name: 'Composite', + class_name: 'Event' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_state.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_state.rb new file mode 100644 index 0000000000..14a4943e70 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_state.rb @@ -0,0 +1,88 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The container instance state. + # + class ContainerState + + include MsRestAzure + + # @return [String] The state of the container instance. + attr_accessor :state + + # @return [DateTime] The date-time when the container instance state + # started. + attr_accessor :start_time + + # @return [Integer] The container instance exit codes correspond to those + # from the `docker run` command. + attr_accessor :exit_code + + # @return [DateTime] The date-time when the container instance state + # finished. + attr_accessor :finish_time + + # @return [String] The human-readable status of the container instance + # state. + attr_accessor :detail_status + + + # + # Mapper for ContainerState class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ContainerState', + type: { + name: 'Composite', + class_name: 'ContainerState', + model_properties: { + state: { + required: false, + serialized_name: 'state', + type: { + name: 'String' + } + }, + start_time: { + required: false, + serialized_name: 'startTime', + type: { + name: 'DateTime' + } + }, + exit_code: { + required: false, + serialized_name: 'exitCode', + type: { + name: 'Number' + } + }, + finish_time: { + required: false, + serialized_name: 'finishTime', + type: { + name: 'DateTime' + } + }, + detail_status: { + required: false, + serialized_name: 'detailStatus', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/environment_variable.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/environment_variable.rb new file mode 100644 index 0000000000..5d092e47cf --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/environment_variable.rb @@ -0,0 +1,64 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The environment variable to set within the container instance. + # + class EnvironmentVariable + + include MsRestAzure + + # @return [String] The name of the environment variable. + attr_accessor :name + + # @return [String] The value of the environment variable. + attr_accessor :value + + # @return [String] The value of the secure environment variable. + attr_accessor :secure_value + + + # + # Mapper for EnvironmentVariable class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'EnvironmentVariable', + type: { + name: 'Composite', + class_name: 'EnvironmentVariable', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serialized_name: 'value', + type: { + name: 'String' + } + }, + secure_value: { + required: false, + serialized_name: 'secureValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/event.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/event.rb new file mode 100644 index 0000000000..7b6cd72690 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/event.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A container group or container instance event. + # + class Event + + include MsRestAzure + + # @return [Integer] The count of the event. + attr_accessor :count + + # @return [DateTime] The date-time of the earliest logged event. + attr_accessor :first_timestamp + + # @return [DateTime] The date-time of the latest logged event. + attr_accessor :last_timestamp + + # @return [String] The event name. + attr_accessor :name + + # @return [String] The event message. + attr_accessor :message + + # @return [String] The event type. + attr_accessor :type + + + # + # Mapper for Event class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Event', + type: { + name: 'Composite', + class_name: 'Event', + model_properties: { + count: { + required: false, + serialized_name: 'count', + type: { + name: 'Number' + } + }, + first_timestamp: { + required: false, + serialized_name: 'firstTimestamp', + type: { + name: 'DateTime' + } + }, + last_timestamp: { + required: false, + serialized_name: 'lastTimestamp', + type: { + name: 'DateTime' + } + }, + name: { + required: false, + serialized_name: 'name', + type: { + name: 'String' + } + }, + message: { + required: false, + serialized_name: 'message', + type: { + name: 'String' + } + }, + type: { + required: false, + serialized_name: 'type', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb new file mode 100644 index 0000000000..f4833422c1 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb @@ -0,0 +1,68 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Represents a volume that is populated with the contents of a git + # repository + # + class GitRepoVolume + + include MsRestAzure + + # @return [String] Target directory name. Must not contain or start with + # '..'. If '.' is supplied, the volume directory will be the git + # repository. Otherwise, if specified, the volume will contain the git + # repository in the subdirectory with the given name. + attr_accessor :directory + + # @return [String] Repository URL + attr_accessor :repository + + # @return [String] Commit hash for the specified revision. + attr_accessor :revision + + + # + # Mapper for GitRepoVolume class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'GitRepoVolume', + type: { + name: 'Composite', + class_name: 'GitRepoVolume', + model_properties: { + directory: { + required: false, + serialized_name: 'directory', + type: { + name: 'String' + } + }, + repository: { + required: true, + serialized_name: 'repository', + type: { + name: 'String' + } + }, + revision: { + required: false, + serialized_name: 'revision', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb new file mode 100644 index 0000000000..e63da722d2 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb @@ -0,0 +1,65 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Image registry credential. + # + class ImageRegistryCredential + + include MsRestAzure + + # @return [String] The Docker image registry server without a protocol + # such as "http" and "https". + attr_accessor :server + + # @return [String] The username for the private registry. + attr_accessor :username + + # @return [String] The password for the private registry. + attr_accessor :password + + + # + # Mapper for ImageRegistryCredential class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ImageRegistryCredential', + type: { + name: 'Composite', + class_name: 'ImageRegistryCredential', + model_properties: { + server: { + required: true, + serialized_name: 'server', + type: { + name: 'String' + } + }, + username: { + required: true, + serialized_name: 'username', + type: { + name: 'String' + } + }, + password: { + required: false, + serialized_name: 'password', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/ip_address.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/ip_address.rb new file mode 100644 index 0000000000..38e1f51e49 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/ip_address.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # IP address for the container group. + # + class IpAddress + + include MsRestAzure + + # @return [Array] The list of ports exposed on the container group. + attr_accessor :ports + + # @return [String] Specifies if the IP is exposed to the public internet. + # Default value: 'Public' . + attr_accessor :type + + # @return [String] The IP exposed to the public internet. + attr_accessor :ip + + # @return [String] The Dns name label for the IP. + attr_accessor :dns_name_label + + # @return [String] The FQDN for the IP. + attr_accessor :fqdn + + + # + # Mapper for IpAddress class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'IpAddress', + type: { + name: 'Composite', + class_name: 'IpAddress', + model_properties: { + ports: { + required: true, + serialized_name: 'ports', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'PortElementType', + type: { + name: 'Composite', + class_name: 'Port' + } + } + } + }, + type: { + required: true, + is_constant: true, + serialized_name: 'type', + default_value: 'Public', + type: { + name: 'String' + } + }, + ip: { + required: false, + serialized_name: 'ip', + type: { + name: 'String' + } + }, + dns_name_label: { + required: false, + serialized_name: 'dnsNameLabel', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + read_only: true, + serialized_name: 'fqdn', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics.rb new file mode 100644 index 0000000000..6894d3a128 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics.rb @@ -0,0 +1,82 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Container group log analytics information. + # + class LogAnalytics + + include MsRestAzure + + # @return [String] The workspace id for log analytics + attr_accessor :workspace_id + + # @return [String] The workspace key for log analytics + attr_accessor :workspace_key + + # @return [LogAnalyticsLogType] The log type to be used. Possible values + # include: 'ContainerInsights', 'ContainerInstanceLogs' + attr_accessor :log_type + + # @return [Hash{String => String}] Metadata for log analytics. + attr_accessor :metadata + + + # + # Mapper for LogAnalytics class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'LogAnalytics', + type: { + name: 'Composite', + class_name: 'LogAnalytics', + model_properties: { + workspace_id: { + required: true, + serialized_name: 'workspaceId', + type: { + name: 'String' + } + }, + workspace_key: { + required: true, + serialized_name: 'workspaceKey', + type: { + name: 'String' + } + }, + log_type: { + required: false, + serialized_name: 'logType', + type: { + name: 'String' + } + }, + metadata: { + required: false, + serialized_name: 'metadata', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb new file mode 100644 index 0000000000..74e8a488b5 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for LogAnalyticsLogType + # + module LogAnalyticsLogType + ContainerInsights = "ContainerInsights" + ContainerInstanceLogs = "ContainerInstanceLogs" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/logs.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/logs.rb new file mode 100644 index 0000000000..051b0f7cdd --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/logs.rb @@ -0,0 +1,44 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The logs. + # + class Logs + + include MsRestAzure + + # @return [String] The content of the log. + attr_accessor :content + + + # + # Mapper for Logs class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Logs', + type: { + name: 'Composite', + class_name: 'Logs', + model_properties: { + content: { + required: false, + serialized_name: 'content', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb new file mode 100644 index 0000000000..3b18ec683c --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb @@ -0,0 +1,16 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # Defines values for OperatingSystemTypes + # + module OperatingSystemTypes + Windows = "Windows" + Linux = "Linux" + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation.rb new file mode 100644 index 0000000000..1ed301a1a0 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation.rb @@ -0,0 +1,66 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # An operation for Azure Container Instance service. + # + class Operation + + include MsRestAzure + + # @return [String] The name of the operation. + attr_accessor :name + + # @return [OperationDisplay] The display information of the operation. + attr_accessor :display + + # @return [ContainerInstanceOperationsOrigin] The intended executor of + # the operation. Possible values include: 'User', 'System' + attr_accessor :origin + + + # + # Mapper for Operation class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Operation', + type: { + name: 'Composite', + class_name: 'Operation', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + display: { + required: true, + serialized_name: 'display', + type: { + name: 'Composite', + class_name: 'OperationDisplay' + } + }, + origin: { + required: false, + serialized_name: 'origin', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_display.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_display.rb new file mode 100644 index 0000000000..71d1e9cd16 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_display.rb @@ -0,0 +1,74 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The display information of the operation. + # + class OperationDisplay + + include MsRestAzure + + # @return [String] The name of the provider of the operation. + attr_accessor :provider + + # @return [String] The name of the resource type of the operation. + attr_accessor :resource + + # @return [String] The friendly name of the operation. + attr_accessor :operation + + # @return [String] The description of the operation. + attr_accessor :description + + + # + # Mapper for OperationDisplay class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Operation_display', + type: { + name: 'Composite', + class_name: 'OperationDisplay', + model_properties: { + provider: { + required: false, + serialized_name: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serialized_name: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serialized_name: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serialized_name: 'description', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb new file mode 100644 index 0000000000..2892cfeb7d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb @@ -0,0 +1,63 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The operation list response that contains all operations for Azure + # Container Instance service. + # + class OperationListResult + + include MsRestAzure + + # @return [Array] The list of operations. + attr_accessor :value + + # @return [String] The URI to fetch the next page of operations. + attr_accessor :next_link + + + # + # Mapper for OperationListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'OperationListResult', + type: { + name: 'Composite', + class_name: 'OperationListResult', + model_properties: { + value: { + required: false, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'OperationElementType', + type: { + name: 'Composite', + class_name: 'Operation' + } + } + } + }, + next_link: { + required: false, + serialized_name: 'nextLink', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/port.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/port.rb new file mode 100644 index 0000000000..b70a97aa82 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/port.rb @@ -0,0 +1,55 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The port exposed on the container group. + # + class Port + + include MsRestAzure + + # @return [ContainerGroupNetworkProtocol] The protocol associated with + # the port. Possible values include: 'TCP', 'UDP' + attr_accessor :protocol + + # @return [Integer] The port number. + attr_accessor :port + + + # + # Mapper for Port class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Port', + type: { + name: 'Composite', + class_name: 'Port', + model_properties: { + protocol: { + required: false, + serialized_name: 'protocol', + type: { + name: 'String' + } + }, + port: { + required: true, + serialized_name: 'port', + type: { + name: 'Number' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource.rb new file mode 100644 index 0000000000..93cbebcfd7 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource.rb @@ -0,0 +1,94 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The Resource model definition. + # + class Resource + + include MsRestAzure + + # @return [String] The resource id. + attr_accessor :id + + # @return [String] The resource name. + attr_accessor :name + + # @return [String] The resource type. + attr_accessor :type + + # @return [String] The resource location. + attr_accessor :location + + # @return [Hash{String => String}] The resource tags. + attr_accessor :tags + + + # + # Mapper for Resource class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Resource', + type: { + name: 'Composite', + class_name: 'Resource', + model_properties: { + id: { + required: false, + read_only: true, + serialized_name: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + read_only: true, + serialized_name: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serialized_name: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serialized_name: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_limits.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_limits.rb new file mode 100644 index 0000000000..c154e380d5 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_limits.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The resource limits. + # + class ResourceLimits + + include MsRestAzure + + # @return [Float] The memory limit in GB of this container instance. + attr_accessor :memory_in_gb + + # @return [Float] The CPU limit of this container instance. + attr_accessor :cpu + + + # + # Mapper for ResourceLimits class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResourceLimits', + type: { + name: 'Composite', + class_name: 'ResourceLimits', + model_properties: { + memory_in_gb: { + required: false, + serialized_name: 'memoryInGB', + type: { + name: 'Double' + } + }, + cpu: { + required: false, + serialized_name: 'cpu', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requests.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requests.rb new file mode 100644 index 0000000000..a389e68a92 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requests.rb @@ -0,0 +1,54 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The resource requests. + # + class ResourceRequests + + include MsRestAzure + + # @return [Float] The memory request in GB of this container instance. + attr_accessor :memory_in_gb + + # @return [Float] The CPU request of this container instance. + attr_accessor :cpu + + + # + # Mapper for ResourceRequests class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResourceRequests', + type: { + name: 'Composite', + class_name: 'ResourceRequests', + model_properties: { + memory_in_gb: { + required: true, + serialized_name: 'memoryInGB', + type: { + name: 'Double' + } + }, + cpu: { + required: true, + serialized_name: 'cpu', + type: { + name: 'Double' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb new file mode 100644 index 0000000000..00e14e5f9b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb @@ -0,0 +1,58 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The resource requirements. + # + class ResourceRequirements + + include MsRestAzure + + # @return [ResourceRequests] The resource requests of this container + # instance. + attr_accessor :requests + + # @return [ResourceLimits] The resource limits of this container + # instance. + attr_accessor :limits + + + # + # Mapper for ResourceRequirements class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'ResourceRequirements', + type: { + name: 'Composite', + class_name: 'ResourceRequirements', + model_properties: { + requests: { + required: true, + serialized_name: 'requests', + type: { + name: 'Composite', + class_name: 'ResourceRequests' + } + }, + limits: { + required: false, + serialized_name: 'limits', + type: { + name: 'Composite', + class_name: 'ResourceLimits' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage.rb new file mode 100644 index 0000000000..6fa0dee48b --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # A single usage result + # + class Usage + + include MsRestAzure + + # @return [String] Unit of the usage result + attr_accessor :unit + + # @return [Integer] The current usage of the resource + attr_accessor :current_value + + # @return [Integer] The maximum permitted usage of the resource. + attr_accessor :limit + + # @return [UsageName] The name object of the resource + attr_accessor :name + + + # + # Mapper for Usage class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Usage', + type: { + name: 'Composite', + class_name: 'Usage', + model_properties: { + unit: { + required: false, + read_only: true, + serialized_name: 'unit', + type: { + name: 'String' + } + }, + current_value: { + required: false, + read_only: true, + serialized_name: 'currentValue', + type: { + name: 'Number' + } + }, + limit: { + required: false, + read_only: true, + serialized_name: 'limit', + type: { + name: 'Number' + } + }, + name: { + required: false, + read_only: true, + serialized_name: 'name', + type: { + name: 'Composite', + class_name: 'UsageName' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb new file mode 100644 index 0000000000..b6f90c49f4 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb @@ -0,0 +1,53 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The response containing the usage data + # + class UsageListResult + + include MsRestAzure + + # @return [Array] + attr_accessor :value + + + # + # Mapper for UsageListResult class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'UsageListResult', + type: { + name: 'Composite', + class_name: 'UsageListResult', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serialized_name: 'UsageElementType', + type: { + name: 'Composite', + class_name: 'Usage' + } + } + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_name.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_name.rb new file mode 100644 index 0000000000..8dbd475b63 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_name.rb @@ -0,0 +1,56 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The name object of the resource + # + class UsageName + + include MsRestAzure + + # @return [String] The name of the resource + attr_accessor :value + + # @return [String] The localized name of the resource + attr_accessor :localized_value + + + # + # Mapper for UsageName class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Usage_name', + type: { + name: 'Composite', + class_name: 'UsageName', + model_properties: { + value: { + required: false, + read_only: true, + serialized_name: 'value', + type: { + name: 'String' + } + }, + localized_value: { + required: false, + read_only: true, + serialized_name: 'localizedValue', + type: { + name: 'String' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume.rb new file mode 100644 index 0000000000..5c7547594d --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume.rb @@ -0,0 +1,93 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The properties of the volume. + # + class Volume + + include MsRestAzure + + # @return [String] The name of the volume. + attr_accessor :name + + # @return [AzureFileVolume] The Azure File volume. + attr_accessor :azure_file + + # @return The empty directory volume. + attr_accessor :empty_dir + + # @return [Hash{String => String}] The secret volume. + attr_accessor :secret + + # @return [GitRepoVolume] The git repo volume. + attr_accessor :git_repo + + + # + # Mapper for Volume class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'Volume', + type: { + name: 'Composite', + class_name: 'Volume', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + azure_file: { + required: false, + serialized_name: 'azureFile', + type: { + name: 'Composite', + class_name: 'AzureFileVolume' + } + }, + empty_dir: { + required: false, + serialized_name: 'emptyDir', + type: { + name: 'Object' + } + }, + secret: { + required: false, + serialized_name: 'secret', + type: { + name: 'Dictionary', + value: { + required: false, + serialized_name: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + git_repo: { + required: false, + serialized_name: 'gitRepo', + type: { + name: 'Composite', + class_name: 'GitRepoVolume' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume_mount.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume_mount.rb new file mode 100644 index 0000000000..71d2041194 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume_mount.rb @@ -0,0 +1,66 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + module Models + # + # The properties of the volume mount. + # + class VolumeMount + + include MsRestAzure + + # @return [String] The name of the volume mount. + attr_accessor :name + + # @return [String] The path within the container where the volume should + # be mounted. Must not contain colon (:). + attr_accessor :mount_path + + # @return [Boolean] The flag indicating whether the volume mount is + # read-only. + attr_accessor :read_only + + + # + # Mapper for VolumeMount class as Ruby Hash. + # This will be used for serialization/deserialization. + # + def self.mapper() + { + required: false, + serialized_name: 'VolumeMount', + type: { + name: 'Composite', + class_name: 'VolumeMount', + model_properties: { + name: { + required: true, + serialized_name: 'name', + type: { + name: 'String' + } + }, + mount_path: { + required: true, + serialized_name: 'mountPath', + type: { + name: 'String' + } + }, + read_only: { + required: false, + serialized_name: 'readOnly', + type: { + name: 'Boolean' + } + } + } + } + } + end + end + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/module_definition.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/module_definition.rb new file mode 100644 index 0000000000..7359ebcf14 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/module_definition.rb @@ -0,0 +1,9 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure end +module Azure::ContainerInstance end +module Azure::ContainerInstance::Mgmt end +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/operations.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/operations.rb new file mode 100644 index 0000000000..2f86fa4ed7 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/operations.rb @@ -0,0 +1,106 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + # + # Operations + # + class Operations + include MsRestAzure + + # + # Creates and initializes a new instance of the Operations class. + # @param client service class for accessing basic functionality. + # + def initialize(client) + @client = client + end + + # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient + attr_reader :client + + # + # List the operations for Azure Container Instance service. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [OperationListResult] operation results. + # + def list(custom_headers = nil) + response = list_async(custom_headers).value! + response.body unless response.nil? + end + + # + # List the operations for Azure Container Instance service. + # + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def list_with_http_info(custom_headers = nil) + list_async(custom_headers).value! + end + + # + # List the operations for Azure Container Instance service. + # + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def list_async(custom_headers = nil) + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = 'providers/Microsoft.ContainerInstance/operations' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:get, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 200 + error_model = JSON.load(response_content) + fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 200 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::OperationListResult.mapper() + result.body = @client.deserialize(result_mapper, parsed_response) + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + end +end diff --git a/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/version.rb b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/version.rb new file mode 100644 index 0000000000..d53bf03778 --- /dev/null +++ b/management/azure_mgmt_container_instance/lib/2018-09-01/generated/azure_mgmt_container_instance/version.rb @@ -0,0 +1,8 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ContainerInstance::Mgmt::V2018_02_01_preview + VERSION = '0.16.0' +end diff --git a/management/azure_mgmt_container_instance/lib/azure_mgmt_container_instance.rb b/management/azure_mgmt_container_instance/lib/azure_mgmt_container_instance.rb index 0b7d3d6edb..497e778066 100644 --- a/management/azure_mgmt_container_instance/lib/azure_mgmt_container_instance.rb +++ b/management/azure_mgmt_container_instance/lib/azure_mgmt_container_instance.rb @@ -3,7 +3,10 @@ # Licensed under the MIT License. See License.txt in the project root for license information. require '2017-08-01-preview/generated/azure_mgmt_container_instance' +require '2018-09-01/generated/azure_mgmt_container_instance' +require '2018-06-01/generated/azure_mgmt_container_instance' require '2017-10-01-preview/generated/azure_mgmt_container_instance' +require '2018-04-01/generated/azure_mgmt_container_instance' require '2017-12-01-preview/generated/azure_mgmt_container_instance' require '2018-02-01-preview/generated/azure_mgmt_container_instance' require 'profiles/latest/containerinstance_latest_profile_client'