зеркало из
1
0
Форкнуть 0
This commit is contained in:
Veronica Giaudrone 2017-08-24 18:40:03 -07:00
Родитель 666c3b580d
Коммит d3178a0b38
2564 изменённых файлов: 24 добавлений и 392492 удалений

Просмотреть файл

@ -1,51 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# 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 'generated/azure_mgmt_authorization/module_definition'
require 'ms_rest_azure'
module Azure::ARM::Authorization
autoload :ClassicAdministrators, 'generated/azure_mgmt_authorization/classic_administrators.rb'
autoload :Permissions, 'generated/azure_mgmt_authorization/permissions.rb'
autoload :ProviderOperationsMetadataOperations, 'generated/azure_mgmt_authorization/provider_operations_metadata_operations.rb'
autoload :RoleAssignments, 'generated/azure_mgmt_authorization/role_assignments.rb'
autoload :RoleDefinitions, 'generated/azure_mgmt_authorization/role_definitions.rb'
autoload :AuthorizationManagementClient, 'generated/azure_mgmt_authorization/authorization_management_client.rb'
module Models
autoload :ProviderOperationsMetadata, 'generated/azure_mgmt_authorization/models/provider_operations_metadata.rb'
autoload :ProviderOperationsMetadataListResult, 'generated/azure_mgmt_authorization/models/provider_operations_metadata_list_result.rb'
autoload :RoleDefinitionFilter, 'generated/azure_mgmt_authorization/models/role_definition_filter.rb'
autoload :RoleAssignmentPropertiesWithScope, 'generated/azure_mgmt_authorization/models/role_assignment_properties_with_scope.rb'
autoload :ClassicAdministrator, 'generated/azure_mgmt_authorization/models/classic_administrator.rb'
autoload :RoleAssignment, 'generated/azure_mgmt_authorization/models/role_assignment.rb'
autoload :Permission, 'generated/azure_mgmt_authorization/models/permission.rb'
autoload :RoleAssignmentListResult, 'generated/azure_mgmt_authorization/models/role_assignment_list_result.rb'
autoload :ProviderOperation, 'generated/azure_mgmt_authorization/models/provider_operation.rb'
autoload :RoleAssignmentProperties, 'generated/azure_mgmt_authorization/models/role_assignment_properties.rb'
autoload :RoleAssignmentFilter, 'generated/azure_mgmt_authorization/models/role_assignment_filter.rb'
autoload :RoleAssignmentCreateParameters, 'generated/azure_mgmt_authorization/models/role_assignment_create_parameters.rb'
autoload :ClassicAdministratorListResult, 'generated/azure_mgmt_authorization/models/classic_administrator_list_result.rb'
autoload :RoleDefinitionProperties, 'generated/azure_mgmt_authorization/models/role_definition_properties.rb'
autoload :ResourceType, 'generated/azure_mgmt_authorization/models/resource_type.rb'
autoload :RoleDefinition, 'generated/azure_mgmt_authorization/models/role_definition.rb'
autoload :PermissionGetResult, 'generated/azure_mgmt_authorization/models/permission_get_result.rb'
autoload :RoleDefinitionListResult, 'generated/azure_mgmt_authorization/models/role_definition_list_result.rb'
autoload :ClassicAdministratorProperties, 'generated/azure_mgmt_authorization/models/classic_administrator_properties.rb'
end
end

Просмотреть файл

@ -1,146 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
#
# A service client - single point of access to the REST API.
#
class AuthorizationManagementClient < 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] The ID of the target subscription.
attr_accessor :subscription_id
# @return [String] The API version to use for this operation.
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 [ClassicAdministrators] classic_administrators
attr_reader :classic_administrators
# @return [Permissions] permissions
attr_reader :permissions
# @return [ProviderOperationsMetadataOperations]
# provider_operations_metadata_operations
attr_reader :provider_operations_metadata_operations
# @return [RoleAssignments] role_assignments
attr_reader :role_assignments
# @return [RoleDefinitions] role_definitions
attr_reader :role_definitions
#
# Creates initializes a new instance of the AuthorizationManagementClient 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
@classic_administrators = ClassicAdministrators.new(self)
@permissions = Permissions.new(self)
@provider_operations_metadata_operations = ProviderOperationsMetadataOperations.new(self)
@role_assignments = RoleAssignments.new(self)
@role_definitions = RoleDefinitions.new(self)
@api_version = '2015-07-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_authorization'
if defined? Azure::ARM::Authorization::VERSION
sdk_information = "#{sdk_information}/#{Azure::ARM::Authorization::VERSION}"
end
add_user_agent_information(sdk_information)
end
end
end

Просмотреть файл

@ -1,230 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
#
# Role based access control provides you a way to apply granular level policy
# administration down to individual resources or resource groups. These
# operations enable you to manage role definitions and role assignments. A
# role definition describes the set of actions that can be performed on
# resources. A role assignment grants access to Azure Active Directory users.
#
class ClassicAdministrators
include MsRestAzure
#
# Creates and initializes a new instance of the ClassicAdministrators class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [AuthorizationManagementClient] reference to the AuthorizationManagementClient
attr_reader :client
#
# Gets service administrator, account administrator, and co-administrators for
# the subscription.
#
# @param api_version [String] The API version to use for this operation.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<ClassicAdministrator>] operation results.
#
def list(api_version, custom_headers = nil)
first_page = list_as_lazy(api_version, custom_headers)
first_page.get_all_items
end
#
# Gets service administrator, account administrator, and co-administrators for
# the subscription.
#
# @param api_version [String] The API version to use for this 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_with_http_info(api_version, custom_headers = nil)
list_async(api_version, custom_headers).value!
end
#
# Gets service administrator, account administrator, and co-administrators for
# the subscription.
#
# @param api_version [String] The API version to use for this 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_async(api_version, custom_headers = nil)
fail ArgumentError, 'api_version is nil' if api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Authorization/classicAdministrators'
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' => 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::ARM::Authorization::Models::ClassicAdministratorListResult.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
#
# Gets service administrator, account administrator, and co-administrators for
# the subscription.
#
# @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 [ClassicAdministratorListResult] 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
#
# Gets service administrator, account administrator, and co-administrators for
# the subscription.
#
# @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
#
# Gets service administrator, account administrator, and co-administrators for
# the subscription.
#
# @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::ARM::Authorization::Models::ClassicAdministratorListResult.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
#
# Gets service administrator, account administrator, and co-administrators for
# the subscription.
#
# @param api_version [String] The API version to use for this operation.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [ClassicAdministratorListResult] which provide lazy access to pages
# of the response.
#
def list_as_lazy(api_version, custom_headers = nil)
response = list_async(api_version, 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
end
end

Просмотреть файл

@ -1,77 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Classic Administrators
#
class ClassicAdministrator
include MsRestAzure
include MsRest::JSONable
# @return [String] The ID of the administrator.
attr_accessor :id
# @return [String] The name of the administrator.
attr_accessor :name
# @return [String] The type of the administrator.
attr_accessor :type
# @return [ClassicAdministratorProperties] Properties for the classic
# administrator.
attr_accessor :properties
#
# Mapper for ClassicAdministrator class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ClassicAdministrator',
type: {
name: 'Composite',
class_name: 'ClassicAdministrator',
model_properties: {
id: {
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
serialized_name: 'type',
type: {
name: 'String'
}
},
properties: {
required: false,
serialized_name: 'properties',
type: {
name: 'Composite',
class_name: 'ClassicAdministratorProperties'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,94 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# ClassicAdministrator list result information.
#
class ClassicAdministratorListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<ClassicAdministrator>] An array of administrators.
attr_accessor :value
# @return [String] The URL to use for getting the next set of results.
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<ClassicAdministrator>] 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 [ClassicAdministratorListResult] 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 ClassicAdministratorListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ClassicAdministratorListResult',
type: {
name: 'Composite',
class_name: 'ClassicAdministratorListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'ClassicAdministratorElementType',
type: {
name: 'Composite',
class_name: 'ClassicAdministrator'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,55 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Classic Administrator properties.
#
class ClassicAdministratorProperties
include MsRestAzure
include MsRest::JSONable
# @return [String] The email address of the administrator.
attr_accessor :email_address
# @return [String] The role of the administrator.
attr_accessor :role
#
# Mapper for ClassicAdministratorProperties class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ClassicAdministratorProperties',
type: {
name: 'Composite',
class_name: 'ClassicAdministratorProperties',
model_properties: {
email_address: {
required: false,
serialized_name: 'emailAddress',
type: {
name: 'String'
}
},
role: {
required: false,
serialized_name: 'role',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,69 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role definition permissions.
#
class Permission
include MsRestAzure
include MsRest::JSONable
# @return [Array<String>] Allowed actions.
attr_accessor :actions
# @return [Array<String>] Denied actions.
attr_accessor :not_actions
#
# Mapper for Permission class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'Permission',
type: {
name: 'Composite',
class_name: 'Permission',
model_properties: {
actions: {
required: false,
serialized_name: 'actions',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
not_actions: {
required: false,
serialized_name: 'notActions',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,94 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Permissions information.
#
class PermissionGetResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Permission>] An array of permissions.
attr_accessor :value
# @return [String] The URL to use for getting the next set of results.
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<Permission>] 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 [PermissionGetResult] 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 PermissionGetResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'PermissionGetResult',
type: {
name: 'Composite',
class_name: 'PermissionGetResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'PermissionElementType',
type: {
name: 'Composite',
class_name: 'Permission'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,85 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Operation
#
class ProviderOperation
include MsRestAzure
include MsRest::JSONable
# @return [String] The operation name.
attr_accessor :name
# @return [String] The operation display name.
attr_accessor :display_name
# @return [String] The operation description.
attr_accessor :description
# @return [String] The operation origin.
attr_accessor :origin
# @return The operation properties.
attr_accessor :properties
#
# Mapper for ProviderOperation class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ProviderOperation',
type: {
name: 'Composite',
class_name: 'ProviderOperation',
model_properties: {
name: {
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
display_name: {
required: false,
serialized_name: 'displayName',
type: {
name: 'String'
}
},
description: {
required: false,
serialized_name: 'description',
type: {
name: 'String'
}
},
origin: {
required: false,
serialized_name: 'origin',
type: {
name: 'String'
}
},
properties: {
required: false,
serialized_name: 'properties',
type: {
name: 'Object'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,111 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Provider Operations metadata
#
class ProviderOperationsMetadata
include MsRestAzure
include MsRest::JSONable
# @return [String] The provider id.
attr_accessor :id
# @return [String] The provider name.
attr_accessor :name
# @return [String] The provider type.
attr_accessor :type
# @return [String] The provider display name.
attr_accessor :display_name
# @return [Array<ResourceType>] The provider resource types
attr_accessor :resource_types
# @return [Array<ProviderOperation>] The provider operations.
attr_accessor :operations
#
# Mapper for ProviderOperationsMetadata class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ProviderOperationsMetadata',
type: {
name: 'Composite',
class_name: 'ProviderOperationsMetadata',
model_properties: {
id: {
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
serialized_name: 'type',
type: {
name: 'String'
}
},
display_name: {
required: false,
serialized_name: 'displayName',
type: {
name: 'String'
}
},
resource_types: {
required: false,
serialized_name: 'resourceTypes',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'ResourceTypeElementType',
type: {
name: 'Composite',
class_name: 'ResourceType'
}
}
}
},
operations: {
required: false,
serialized_name: 'operations',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'ProviderOperationElementType',
type: {
name: 'Composite',
class_name: 'ProviderOperation'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,94 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Provider operations metadata list
#
class ProviderOperationsMetadataListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<ProviderOperationsMetadata>] The list of providers.
attr_accessor :value
# @return [String] The URL to use for getting the next set of results.
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<ProviderOperationsMetadata>] 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 [ProviderOperationsMetadataListResult] 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 ProviderOperationsMetadataListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ProviderOperationsMetadataListResult',
type: {
name: 'Composite',
class_name: 'ProviderOperationsMetadataListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'ProviderOperationsMetadataElementType',
type: {
name: 'Composite',
class_name: 'ProviderOperationsMetadata'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,73 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Resource Type
#
class ResourceType
include MsRestAzure
include MsRest::JSONable
# @return [String] The resource type name.
attr_accessor :name
# @return [String] The resource type display name.
attr_accessor :display_name
# @return [Array<ProviderOperation>] The resource type operations.
attr_accessor :operations
#
# Mapper for ResourceType class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ResourceType',
type: {
name: 'Composite',
class_name: 'ResourceType',
model_properties: {
name: {
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
display_name: {
required: false,
serialized_name: 'displayName',
type: {
name: 'String'
}
},
operations: {
required: false,
serialized_name: 'operations',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'ProviderOperationElementType',
type: {
name: 'Composite',
class_name: 'ProviderOperation'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,76 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role Assignments
#
class RoleAssignment
include MsRestAzure
include MsRest::JSONable
# @return [String] The role assignment ID.
attr_accessor :id
# @return [String] The role assignment name.
attr_accessor :name
# @return [String] The role assignment type.
attr_accessor :type
# @return [RoleAssignmentPropertiesWithScope] Role assignment properties.
attr_accessor :properties
#
# Mapper for RoleAssignment class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleAssignment',
type: {
name: 'Composite',
class_name: 'RoleAssignment',
model_properties: {
id: {
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
serialized_name: 'type',
type: {
name: 'String'
}
},
properties: {
required: false,
serialized_name: 'properties',
type: {
name: 'Composite',
class_name: 'RoleAssignmentPropertiesWithScope'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,46 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role assignment create parameters.
#
class RoleAssignmentCreateParameters
include MsRestAzure
include MsRest::JSONable
# @return [RoleAssignmentProperties] Role assignment properties.
attr_accessor :properties
#
# Mapper for RoleAssignmentCreateParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleAssignmentCreateParameters',
type: {
name: 'Composite',
class_name: 'RoleAssignmentCreateParameters',
model_properties: {
properties: {
required: false,
serialized_name: 'properties',
type: {
name: 'Composite',
class_name: 'RoleAssignmentProperties'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,45 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role Assignments filter
#
class RoleAssignmentFilter
include MsRestAzure
include MsRest::JSONable
# @return [String] Returns role assignment of the specific principal.
attr_accessor :principal_id
#
# Mapper for RoleAssignmentFilter class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleAssignmentFilter',
type: {
name: 'Composite',
class_name: 'RoleAssignmentFilter',
model_properties: {
principal_id: {
required: false,
serialized_name: 'principalId',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,94 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role assignment list operation result.
#
class RoleAssignmentListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<RoleAssignment>] Role assignment list.
attr_accessor :value
# @return [String] The URL to use for getting the next set of results.
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<RoleAssignment>] 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 [RoleAssignmentListResult] 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 RoleAssignmentListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleAssignmentListResult',
type: {
name: 'Composite',
class_name: 'RoleAssignmentListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'RoleAssignmentElementType',
type: {
name: 'Composite',
class_name: 'RoleAssignment'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,57 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role assignment properties.
#
class RoleAssignmentProperties
include MsRestAzure
include MsRest::JSONable
# @return [String] The role definition ID used in the role assignment.
attr_accessor :role_definition_id
# @return [String] The principal ID assigned to the role. This maps to
# the ID inside the Active Directory. It can point to a user, service
# principal, or security group.
attr_accessor :principal_id
#
# Mapper for RoleAssignmentProperties class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleAssignmentProperties',
type: {
name: 'Composite',
class_name: 'RoleAssignmentProperties',
model_properties: {
role_definition_id: {
required: false,
serialized_name: 'roleDefinitionId',
type: {
name: 'String'
}
},
principal_id: {
required: false,
serialized_name: 'principalId',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,65 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role assignment properties with scope.
#
class RoleAssignmentPropertiesWithScope
include MsRestAzure
include MsRest::JSONable
# @return [String] The role assignment scope.
attr_accessor :scope
# @return [String] The role definition ID.
attr_accessor :role_definition_id
# @return [String] The principal ID.
attr_accessor :principal_id
#
# Mapper for RoleAssignmentPropertiesWithScope class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleAssignmentPropertiesWithScope',
type: {
name: 'Composite',
class_name: 'RoleAssignmentPropertiesWithScope',
model_properties: {
scope: {
required: false,
serialized_name: 'scope',
type: {
name: 'String'
}
},
role_definition_id: {
required: false,
serialized_name: 'roleDefinitionId',
type: {
name: 'String'
}
},
principal_id: {
required: false,
serialized_name: 'principalId',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,76 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role definition.
#
class RoleDefinition
include MsRestAzure
include MsRest::JSONable
# @return [String] The role definition ID.
attr_accessor :id
# @return [String] The role definition name.
attr_accessor :name
# @return [String] The role definition type.
attr_accessor :type
# @return [RoleDefinitionProperties] Role definition properties.
attr_accessor :properties
#
# Mapper for RoleDefinition class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleDefinition',
type: {
name: 'Composite',
class_name: 'RoleDefinition',
model_properties: {
id: {
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
serialized_name: 'type',
type: {
name: 'String'
}
},
properties: {
required: false,
serialized_name: 'properties',
type: {
name: 'Composite',
class_name: 'RoleDefinitionProperties'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,45 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role Definitions filter
#
class RoleDefinitionFilter
include MsRestAzure
include MsRest::JSONable
# @return [String] Returns role definition with the specific name.
attr_accessor :role_name
#
# Mapper for RoleDefinitionFilter class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleDefinitionFilter',
type: {
name: 'Composite',
class_name: 'RoleDefinitionFilter',
model_properties: {
role_name: {
required: false,
serialized_name: 'roleName',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,94 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role definition list operation result.
#
class RoleDefinitionListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<RoleDefinition>] Role definition list.
attr_accessor :value
# @return [String] The URL to use for getting the next set of results.
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<RoleDefinition>] 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 [RoleDefinitionListResult] 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 RoleDefinitionListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleDefinitionListResult',
type: {
name: 'Composite',
class_name: 'RoleDefinitionListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'RoleDefinitionElementType',
type: {
name: 'Composite',
class_name: 'RoleDefinition'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,100 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
module Models
#
# Role definition properties.
#
class RoleDefinitionProperties
include MsRestAzure
include MsRest::JSONable
# @return [String] The role name.
attr_accessor :role_name
# @return [String] The role definition description.
attr_accessor :description
# @return [String] The role type.
attr_accessor :type
# @return [Array<Permission>] Role definition permissions.
attr_accessor :permissions
# @return [Array<String>] Role definition assignable scopes.
attr_accessor :assignable_scopes
#
# Mapper for RoleDefinitionProperties class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'RoleDefinitionProperties',
type: {
name: 'Composite',
class_name: 'RoleDefinitionProperties',
model_properties: {
role_name: {
required: false,
serialized_name: 'roleName',
type: {
name: 'String'
}
},
description: {
required: false,
serialized_name: 'description',
type: {
name: 'String'
}
},
type: {
required: false,
serialized_name: 'type',
type: {
name: 'String'
}
},
permissions: {
required: false,
serialized_name: 'permissions',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'PermissionElementType',
type: {
name: 'Composite',
class_name: 'Permission'
}
}
}
},
assignable_scopes: {
required: false,
serialized_name: 'assignableScopes',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,8 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure end
module Azure::ARM end
module Azure::ARM::Authorization end

Просмотреть файл

@ -1,456 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
#
# Role based access control provides you a way to apply granular level policy
# administration down to individual resources or resource groups. These
# operations enable you to manage role definitions and role assignments. A
# role definition describes the set of actions that can be performed on
# resources. A role assignment grants access to Azure Active Directory users.
#
class Permissions
include MsRestAzure
#
# Creates and initializes a new instance of the Permissions class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [AuthorizationManagementClient] reference to the AuthorizationManagementClient
attr_reader :client
#
# Gets all permissions the caller has for a resource group.
#
# @param resource_group_name [String] The name of the resource group to get the
# permissions for. The name is case insensitive.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<Permission>] operation results.
#
def list_for_resource_group(resource_group_name, custom_headers = nil)
first_page = list_for_resource_group_as_lazy(resource_group_name, custom_headers)
first_page.get_all_items
end
#
# Gets all permissions the caller has for a resource group.
#
# @param resource_group_name [String] The name of the resource group to get the
# permissions for. The name is case insensitive.
# @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_for_resource_group_with_http_info(resource_group_name, custom_headers = nil)
list_for_resource_group_async(resource_group_name, custom_headers).value!
end
#
# Gets all permissions the caller has for a resource group.
#
# @param resource_group_name [String] The name of the resource group to get the
# permissions for. The name is case insensitive.
# @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_for_resource_group_async(resource_group_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Authorization/permissions'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'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::ARM::Authorization::Models::PermissionGetResult.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
#
# Gets all permissions the caller has for a resource.
#
# @param resource_group_name [String] The name of the resource group containing
# the resource. The name is case insensitive.
# @param resource_provider_namespace [String] The namespace of the resource
# provider.
# @param parent_resource_path [String] The parent resource identity.
# @param resource_type [String] The resource type of the resource.
# @param resource_name [String] The name of the resource to get the permissions
# for.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<Permission>] operation results.
#
def list_for_resource(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers = nil)
first_page = list_for_resource_as_lazy(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers)
first_page.get_all_items
end
#
# Gets all permissions the caller has for a resource.
#
# @param resource_group_name [String] The name of the resource group containing
# the resource. The name is case insensitive.
# @param resource_provider_namespace [String] The namespace of the resource
# provider.
# @param parent_resource_path [String] The parent resource identity.
# @param resource_type [String] The resource type of the resource.
# @param resource_name [String] The name of the resource to get the permissions
# for.
# @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_for_resource_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers = nil)
list_for_resource_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers).value!
end
#
# Gets all permissions the caller has for a resource.
#
# @param resource_group_name [String] The name of the resource group containing
# the resource. The name is case insensitive.
# @param resource_provider_namespace [String] The namespace of the resource
# provider.
# @param parent_resource_path [String] The parent resource identity.
# @param resource_type [String] The resource type of the resource.
# @param resource_name [String] The name of the resource to get the permissions
# for.
# @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_for_resource_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
fail ArgumentError, 'resource_type is nil' if resource_type.nil?
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/permissions'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
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::ARM::Authorization::Models::PermissionGetResult.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
#
# Gets all permissions the caller has for a resource group.
#
# @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 [PermissionGetResult] operation results.
#
def list_for_resource_group_next(next_page_link, custom_headers = nil)
response = list_for_resource_group_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Gets all permissions the caller has for a resource group.
#
# @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_for_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
list_for_resource_group_next_async(next_page_link, custom_headers).value!
end
#
# Gets all permissions the caller has for a resource group.
#
# @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_for_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::ARM::Authorization::Models::PermissionGetResult.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
#
# Gets all permissions the caller has for a resource.
#
# @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 [PermissionGetResult] operation results.
#
def list_for_resource_next(next_page_link, custom_headers = nil)
response = list_for_resource_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Gets all permissions the caller has for a resource.
#
# @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_for_resource_next_with_http_info(next_page_link, custom_headers = nil)
list_for_resource_next_async(next_page_link, custom_headers).value!
end
#
# Gets all permissions the caller has for a resource.
#
# @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_for_resource_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::ARM::Authorization::Models::PermissionGetResult.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
#
# Gets all permissions the caller has for a resource group.
#
# @param resource_group_name [String] The name of the resource group to get the
# permissions for. The name is case insensitive.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [PermissionGetResult] which provide lazy access to pages of the
# response.
#
def list_for_resource_group_as_lazy(resource_group_name, custom_headers = nil)
response = list_for_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_for_resource_group_next_async(next_page_link, custom_headers)
end
page
end
end
#
# Gets all permissions the caller has for a resource.
#
# @param resource_group_name [String] The name of the resource group containing
# the resource. The name is case insensitive.
# @param resource_provider_namespace [String] The namespace of the resource
# provider.
# @param parent_resource_path [String] The parent resource identity.
# @param resource_type [String] The resource type of the resource.
# @param resource_name [String] The name of the resource to get the permissions
# for.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [PermissionGetResult] which provide lazy access to pages of the
# response.
#
def list_for_resource_as_lazy(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers = nil)
response = list_for_resource_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_for_resource_next_async(next_page_link, custom_headers)
end
page
end
end
end
end

Просмотреть файл

@ -1,320 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
#
# Role based access control provides you a way to apply granular level policy
# administration down to individual resources or resource groups. These
# operations enable you to manage role definitions and role assignments. A
# role definition describes the set of actions that can be performed on
# resources. A role assignment grants access to Azure Active Directory users.
#
class ProviderOperationsMetadataOperations
include MsRestAzure
#
# Creates and initializes a new instance of the ProviderOperationsMetadataOperations class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [AuthorizationManagementClient] reference to the AuthorizationManagementClient
attr_reader :client
#
# Gets provider operations metadata for the specified resource provider.
#
# @param resource_provider_namespace [String] The namespace of the resource
# provider.
# @param api_version [String] The API version to use for the operation.
# @param expand [String] Specifies whether to expand the values.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [ProviderOperationsMetadata] operation results.
#
def get(resource_provider_namespace, api_version, expand = 'resourceTypes', custom_headers = nil)
response = get_async(resource_provider_namespace, api_version, expand, custom_headers).value!
response.body unless response.nil?
end
#
# Gets provider operations metadata for the specified resource provider.
#
# @param resource_provider_namespace [String] The namespace of the resource
# provider.
# @param api_version [String] The API version to use for the operation.
# @param expand [String] Specifies whether to expand the values.
# @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_provider_namespace, api_version, expand = 'resourceTypes', custom_headers = nil)
get_async(resource_provider_namespace, api_version, expand, custom_headers).value!
end
#
# Gets provider operations metadata for the specified resource provider.
#
# @param resource_provider_namespace [String] The namespace of the resource
# provider.
# @param api_version [String] The API version to use for the operation.
# @param expand [String] Specifies whether to expand the values.
# @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_provider_namespace, api_version, expand = 'resourceTypes', custom_headers = nil)
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
fail ArgumentError, 'api_version is nil' if 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.Authorization/providerOperations/{resourceProviderNamespace}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceProviderNamespace' => resource_provider_namespace},
query_params: {'api-version' => api_version,'$expand' => expand},
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::ARM::Authorization::Models::ProviderOperationsMetadata.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
#
# Gets provider operations metadata for all resource providers.
#
# @param api_version [String] The API version to use for this operation.
# @param expand [String] Specifies whether to expand the values.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<ProviderOperationsMetadata>] operation results.
#
def list(api_version, expand = 'resourceTypes', custom_headers = nil)
first_page = list_as_lazy(api_version, expand, custom_headers)
first_page.get_all_items
end
#
# Gets provider operations metadata for all resource providers.
#
# @param api_version [String] The API version to use for this operation.
# @param expand [String] Specifies whether to expand the values.
# @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(api_version, expand = 'resourceTypes', custom_headers = nil)
list_async(api_version, expand, custom_headers).value!
end
#
# Gets provider operations metadata for all resource providers.
#
# @param api_version [String] The API version to use for this operation.
# @param expand [String] Specifies whether to expand the values.
# @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(api_version, expand = 'resourceTypes', custom_headers = nil)
fail ArgumentError, 'api_version is nil' if 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.Authorization/providerOperations'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
query_params: {'api-version' => api_version,'$expand' => expand},
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::ARM::Authorization::Models::ProviderOperationsMetadataListResult.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
#
# Gets provider operations metadata for all resource providers.
#
# @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 [ProviderOperationsMetadataListResult] 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
#
# Gets provider operations metadata for all resource providers.
#
# @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
#
# Gets provider operations metadata for all resource providers.
#
# @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::ARM::Authorization::Models::ProviderOperationsMetadataListResult.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
#
# Gets provider operations metadata for all resource providers.
#
# @param api_version [String] The API version to use for this operation.
# @param expand [String] Specifies whether to expand the values.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [ProviderOperationsMetadataListResult] which provide lazy access to
# pages of the response.
#
def list_as_lazy(api_version, expand = 'resourceTypes', custom_headers = nil)
response = list_async(api_version, expand, 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
end
end

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,606 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
#
# Role based access control provides you a way to apply granular level policy
# administration down to individual resources or resource groups. These
# operations enable you to manage role definitions and role assignments. A
# role definition describes the set of actions that can be performed on
# resources. A role assignment grants access to Azure Active Directory users.
#
class RoleDefinitions
include MsRestAzure
#
# Creates and initializes a new instance of the RoleDefinitions class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [AuthorizationManagementClient] reference to the AuthorizationManagementClient
attr_reader :client
#
# Deletes a role definition.
#
# @param scope [String] The scope of the role definition.
# @param role_definition_id [String] The ID of the role definition to delete.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [RoleDefinition] operation results.
#
def delete(scope, role_definition_id, custom_headers = nil)
response = delete_async(scope, role_definition_id, custom_headers).value!
response.body unless response.nil?
end
#
# Deletes a role definition.
#
# @param scope [String] The scope of the role definition.
# @param role_definition_id [String] The ID of the role definition to delete.
# @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(scope, role_definition_id, custom_headers = nil)
delete_async(scope, role_definition_id, custom_headers).value!
end
#
# Deletes a role definition.
#
# @param scope [String] The scope of the role definition.
# @param role_definition_id [String] The ID of the role definition to delete.
# @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(scope, role_definition_id, custom_headers = nil)
fail ArgumentError, 'scope is nil' if scope.nil?
fail ArgumentError, 'role_definition_id is nil' if role_definition_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 = '{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'roleDefinitionId' => role_definition_id},
skip_encoding_path_params: {'scope' => scope},
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
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::ARM::Authorization::Models::RoleDefinition.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 role definition by name (GUID).
#
# @param scope [String] The scope of the role definition.
# @param role_definition_id [String] The ID of the role definition.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [RoleDefinition] operation results.
#
def get(scope, role_definition_id, custom_headers = nil)
response = get_async(scope, role_definition_id, custom_headers).value!
response.body unless response.nil?
end
#
# Get role definition by name (GUID).
#
# @param scope [String] The scope of the role definition.
# @param role_definition_id [String] The ID of the role definition.
# @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(scope, role_definition_id, custom_headers = nil)
get_async(scope, role_definition_id, custom_headers).value!
end
#
# Get role definition by name (GUID).
#
# @param scope [String] The scope of the role definition.
# @param role_definition_id [String] The ID of the role definition.
# @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(scope, role_definition_id, custom_headers = nil)
fail ArgumentError, 'scope is nil' if scope.nil?
fail ArgumentError, 'role_definition_id is nil' if role_definition_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 = '{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'roleDefinitionId' => role_definition_id},
skip_encoding_path_params: {'scope' => scope},
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::ARM::Authorization::Models::RoleDefinition.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
#
# Creates or updates a role definition.
#
# @param scope [String] The scope of the role definition.
# @param role_definition_id [String] The ID of the role definition.
# @param role_definition [RoleDefinition] The values for the role definition.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [RoleDefinition] operation results.
#
def create_or_update(scope, role_definition_id, role_definition, custom_headers = nil)
response = create_or_update_async(scope, role_definition_id, role_definition, custom_headers).value!
response.body unless response.nil?
end
#
# Creates or updates a role definition.
#
# @param scope [String] The scope of the role definition.
# @param role_definition_id [String] The ID of the role definition.
# @param role_definition [RoleDefinition] The values for the role definition.
# @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 create_or_update_with_http_info(scope, role_definition_id, role_definition, custom_headers = nil)
create_or_update_async(scope, role_definition_id, role_definition, custom_headers).value!
end
#
# Creates or updates a role definition.
#
# @param scope [String] The scope of the role definition.
# @param role_definition_id [String] The ID of the role definition.
# @param role_definition [RoleDefinition] The values for the role definition.
# @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 create_or_update_async(scope, role_definition_id, role_definition, custom_headers = nil)
fail ArgumentError, 'scope is nil' if scope.nil?
fail ArgumentError, 'role_definition_id is nil' if role_definition_id.nil?
fail ArgumentError, 'role_definition is nil' if role_definition.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?
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Serialize Request
request_mapper = Azure::ARM::Authorization::Models::RoleDefinition.mapper()
request_content = @client.serialize(request_mapper, role_definition)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = '{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'roleDefinitionId' => role_definition_id},
skip_encoding_path_params: {'scope' => scope},
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 == 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 == 201
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::Authorization::Models::RoleDefinition.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
#
# Gets a role definition by ID.
#
# @param role_definition_id [String] The fully qualified role definition ID to
# get.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [RoleDefinition] operation results.
#
def get_by_id(role_definition_id, custom_headers = nil)
response = get_by_id_async(role_definition_id, custom_headers).value!
response.body unless response.nil?
end
#
# Gets a role definition by ID.
#
# @param role_definition_id [String] The fully qualified role definition ID to
# get.
# @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_by_id_with_http_info(role_definition_id, custom_headers = nil)
get_by_id_async(role_definition_id, custom_headers).value!
end
#
# Gets a role definition by ID.
#
# @param role_definition_id [String] The fully qualified role definition ID to
# get.
# @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_by_id_async(role_definition_id, custom_headers = nil)
fail ArgumentError, 'role_definition_id is nil' if role_definition_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 = '{roleDefinitionId}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
skip_encoding_path_params: {'roleDefinitionId' => role_definition_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::ARM::Authorization::Models::RoleDefinition.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 all role definitions that are applicable at scope and above.
#
# @param scope [String] The scope of the role definition.
# @param filter [String] The filter to apply on the operation. Use
# atScopeAndBelow filter to search below the given scope as well.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<RoleDefinition>] operation results.
#
def list(scope, filter = nil, custom_headers = nil)
first_page = list_as_lazy(scope, filter, custom_headers)
first_page.get_all_items
end
#
# Get all role definitions that are applicable at scope and above.
#
# @param scope [String] The scope of the role definition.
# @param filter [String] The filter to apply on the operation. Use
# atScopeAndBelow filter to search below the given scope as well.
# @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(scope, filter = nil, custom_headers = nil)
list_async(scope, filter, custom_headers).value!
end
#
# Get all role definitions that are applicable at scope and above.
#
# @param scope [String] The scope of the role definition.
# @param filter [String] The filter to apply on the operation. Use
# atScopeAndBelow filter to search below the given scope as well.
# @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(scope, filter = nil, custom_headers = nil)
fail ArgumentError, 'scope is nil' if scope.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 = '{scope}/providers/Microsoft.Authorization/roleDefinitions'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
skip_encoding_path_params: {'scope' => scope},
query_params: {'$filter' => filter,'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::ARM::Authorization::Models::RoleDefinitionListResult.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 all role definitions that are applicable at scope and above.
#
# @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 [RoleDefinitionListResult] 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 all role definitions that are applicable at scope and above.
#
# @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 all role definitions that are applicable at scope and above.
#
# @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::ARM::Authorization::Models::RoleDefinitionListResult.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 all role definitions that are applicable at scope and above.
#
# @param scope [String] The scope of the role definition.
# @param filter [String] The filter to apply on the operation. Use
# atScopeAndBelow filter to search below the given scope as well.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [RoleDefinitionListResult] which provide lazy access to pages of the
# response.
#
def list_as_lazy(scope, filter = nil, custom_headers = nil)
response = list_async(scope, filter, 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
end
end

Просмотреть файл

@ -1,8 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Authorization
VERSION = '0.11.0'
end

Просмотреть файл

@ -1,55 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# 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 'generated/azure_mgmt_batch/module_definition'
require 'ms_rest_azure'
module Azure::ARM::Batch
autoload :BatchAccountOperations, 'generated/azure_mgmt_batch/batch_account_operations.rb'
autoload :ApplicationPackageOperations, 'generated/azure_mgmt_batch/application_package_operations.rb'
autoload :ApplicationOperations, 'generated/azure_mgmt_batch/application_operations.rb'
autoload :Location, 'generated/azure_mgmt_batch/location.rb'
autoload :Operations, 'generated/azure_mgmt_batch/operations.rb'
autoload :BatchManagementClient, 'generated/azure_mgmt_batch/batch_management_client.rb'
module Models
autoload :ApplicationCreateParameters, 'generated/azure_mgmt_batch/models/application_create_parameters.rb'
autoload :ApplicationPackage, 'generated/azure_mgmt_batch/models/application_package.rb'
autoload :KeyVaultReference, 'generated/azure_mgmt_batch/models/key_vault_reference.rb'
autoload :Application, 'generated/azure_mgmt_batch/models/application.rb'
autoload :BatchAccountCreateParameters, 'generated/azure_mgmt_batch/models/batch_account_create_parameters.rb'
autoload :Operation, 'generated/azure_mgmt_batch/models/operation.rb'
autoload :BatchAccountUpdateParameters, 'generated/azure_mgmt_batch/models/batch_account_update_parameters.rb'
autoload :ListApplicationsResult, 'generated/azure_mgmt_batch/models/list_applications_result.rb'
autoload :BatchAccountRegenerateKeyParameters, 'generated/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb'
autoload :ApplicationUpdateParameters, 'generated/azure_mgmt_batch/models/application_update_parameters.rb'
autoload :ActivateApplicationPackageParameters, 'generated/azure_mgmt_batch/models/activate_application_package_parameters.rb'
autoload :BatchLocationQuota, 'generated/azure_mgmt_batch/models/batch_location_quota.rb'
autoload :OperationListResult, 'generated/azure_mgmt_batch/models/operation_list_result.rb'
autoload :BatchAccountKeys, 'generated/azure_mgmt_batch/models/batch_account_keys.rb'
autoload :BatchAccountListResult, 'generated/azure_mgmt_batch/models/batch_account_list_result.rb'
autoload :AutoStorageBaseProperties, 'generated/azure_mgmt_batch/models/auto_storage_base_properties.rb'
autoload :OperationDisplay, 'generated/azure_mgmt_batch/models/operation_display.rb'
autoload :AutoStorageProperties, 'generated/azure_mgmt_batch/models/auto_storage_properties.rb'
autoload :BatchAccount, 'generated/azure_mgmt_batch/models/batch_account.rb'
autoload :PoolAllocationMode, 'generated/azure_mgmt_batch/models/pool_allocation_mode.rb'
autoload :ProvisioningState, 'generated/azure_mgmt_batch/models/provisioning_state.rb'
autoload :AccountKeyType, 'generated/azure_mgmt_batch/models/account_key_type.rb'
autoload :PackageState, 'generated/azure_mgmt_batch/models/package_state.rb'
end
end

Просмотреть файл

@ -1,638 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
#
# ApplicationOperations
#
class ApplicationOperations
include MsRestAzure
#
# Creates and initializes a new instance of the ApplicationOperations class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [BatchManagementClient] reference to the BatchManagementClient
attr_reader :client
#
# Adds an application to the specified Batch account.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param parameters [ApplicationCreateParameters] The parameters for the
# request.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Application] operation results.
#
def create(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
response = create_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
response.body unless response.nil?
end
#
# Adds an application to the specified Batch account.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param parameters [ApplicationCreateParameters] The parameters for the
# request.
# @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 create_with_http_info(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
create_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
end
#
# Adds an application to the specified Batch account.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param parameters [ApplicationCreateParameters] The parameters for the
# request.
# @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 create_async(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'account_name is nil' if account_name.nil?
fail ArgumentError, 'application_id is nil' if application_id.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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::ARM::Batch::Models::ApplicationCreateParameters.mapper()
request_content = @client.serialize(request_mapper, parameters)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
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 == 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 == 201
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::Batch::Models::Application.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
#
# Deletes an application.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def delete(resource_group_name, account_name, application_id, custom_headers = nil)
response = delete_async(resource_group_name, account_name, application_id, custom_headers).value!
nil
end
#
# Deletes an application.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @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, account_name, application_id, custom_headers = nil)
delete_async(resource_group_name, account_name, application_id, custom_headers).value!
end
#
# Deletes an application.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @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, account_name, application_id, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'account_name is nil' if account_name.nil?
fail ArgumentError, 'application_id is nil' if application_id.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Batch/batchAccounts/{accountName}/applications/{applicationId}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'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(: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 == 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
#
# Gets information about the specified application.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Application] operation results.
#
def get(resource_group_name, account_name, application_id, custom_headers = nil)
response = get_async(resource_group_name, account_name, application_id, custom_headers).value!
response.body unless response.nil?
end
#
# Gets information about the specified application.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @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, account_name, application_id, custom_headers = nil)
get_async(resource_group_name, account_name, application_id, custom_headers).value!
end
#
# Gets information about the specified application.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @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, account_name, application_id, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'account_name is nil' if account_name.nil?
fail ArgumentError, 'application_id is nil' if application_id.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Batch/batchAccounts/{accountName}/applications/{applicationId}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'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::ARM::Batch::Models::Application.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
#
# Updates settings for the specified application.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param parameters [ApplicationUpdateParameters] The parameters for the
# request.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def update(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
response = update_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
nil
end
#
# Updates settings for the specified application.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param parameters [ApplicationUpdateParameters] The parameters for the
# request.
# @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, account_name, application_id, parameters, custom_headers = nil)
update_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
end
#
# Updates settings for the specified application.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param parameters [ApplicationUpdateParameters] The parameters for the
# request.
# @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, account_name, application_id, parameters, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'account_name is nil' if account_name.nil?
fail ArgumentError, 'application_id is nil' if application_id.nil?
fail ArgumentError, 'parameters is nil' if parameters.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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::ARM::Batch::Models::ApplicationUpdateParameters.mapper()
request_content = @client.serialize(request_mapper, parameters)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
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 == 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
#
# Lists all of the applications in the specified account.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param maxresults [Integer] The maximum number of items to return in the
# response.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<Application>] operation results.
#
def list(resource_group_name, account_name, maxresults = nil, custom_headers = nil)
first_page = list_as_lazy(resource_group_name, account_name, maxresults, custom_headers)
first_page.get_all_items
end
#
# Lists all of the applications in the specified account.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param maxresults [Integer] The maximum number of items to return in the
# response.
# @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, account_name, maxresults = nil, custom_headers = nil)
list_async(resource_group_name, account_name, maxresults, custom_headers).value!
end
#
# Lists all of the applications in the specified account.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param maxresults [Integer] The maximum number of items to return in the
# response.
# @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, account_name, maxresults = nil, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'account_name is nil' if account_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Batch/batchAccounts/{accountName}/applications'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
query_params: {'maxresults' => maxresults,'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::ARM::Batch::Models::ListApplicationsResult.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
#
# Lists all of the applications in the specified account.
#
# @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 [ListApplicationsResult] 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
#
# Lists all of the applications in the specified account.
#
# @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
#
# Lists all of the applications in the specified account.
#
# @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::ARM::Batch::Models::ListApplicationsResult.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
#
# Lists all of the applications in the specified account.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param maxresults [Integer] The maximum number of items to return in the
# response.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [ListApplicationsResult] which provide lazy access to pages of the
# response.
#
def list_as_lazy(resource_group_name, account_name, maxresults = nil, custom_headers = nil)
response = list_async(resource_group_name, account_name, maxresults, 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
end
end

Просмотреть файл

@ -1,427 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
#
# ApplicationPackageOperations
#
class ApplicationPackageOperations
include MsRestAzure
#
# Creates and initializes a new instance of the ApplicationPackageOperations class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [BatchManagementClient] reference to the BatchManagementClient
attr_reader :client
#
# Activates the specified application package.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application to activate.
# @param parameters [ActivateApplicationPackageParameters] The parameters for
# the request.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def activate(resource_group_name, account_name, application_id, version, parameters, custom_headers = nil)
response = activate_async(resource_group_name, account_name, application_id, version, parameters, custom_headers).value!
nil
end
#
# Activates the specified application package.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application to activate.
# @param parameters [ActivateApplicationPackageParameters] The parameters for
# the request.
# @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 activate_with_http_info(resource_group_name, account_name, application_id, version, parameters, custom_headers = nil)
activate_async(resource_group_name, account_name, application_id, version, parameters, custom_headers).value!
end
#
# Activates the specified application package.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application to activate.
# @param parameters [ActivateApplicationPackageParameters] The parameters for
# the request.
# @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 activate_async(resource_group_name, account_name, application_id, version, parameters, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'account_name is nil' if account_name.nil?
fail ArgumentError, 'application_id is nil' if application_id.nil?
fail ArgumentError, 'version is nil' if version.nil?
fail ArgumentError, 'parameters is nil' if parameters.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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::ARM::Batch::Models::ActivateApplicationPackageParameters.mapper()
request_content = @client.serialize(request_mapper, parameters)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}/activate'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
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 == 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
#
# Creates an application package record.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [ApplicationPackage] operation results.
#
def create(resource_group_name, account_name, application_id, version, custom_headers = nil)
response = create_async(resource_group_name, account_name, application_id, version, custom_headers).value!
response.body unless response.nil?
end
#
# Creates an application package record.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application.
# @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 create_with_http_info(resource_group_name, account_name, application_id, version, custom_headers = nil)
create_async(resource_group_name, account_name, application_id, version, custom_headers).value!
end
#
# Creates an application package record.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application.
# @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 create_async(resource_group_name, account_name, application_id, version, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'account_name is nil' if account_name.nil?
fail ArgumentError, 'application_id is nil' if application_id.nil?
fail ArgumentError, 'version is nil' if version.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'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(: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 == 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 == 201
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::Batch::Models::ApplicationPackage.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
#
# Deletes an application package record and its associated binary file.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application to delete.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def delete(resource_group_name, account_name, application_id, version, custom_headers = nil)
response = delete_async(resource_group_name, account_name, application_id, version, custom_headers).value!
nil
end
#
# Deletes an application package record and its associated binary file.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application to delete.
# @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, account_name, application_id, version, custom_headers = nil)
delete_async(resource_group_name, account_name, application_id, version, custom_headers).value!
end
#
# Deletes an application package record and its associated binary file.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application to delete.
# @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, account_name, application_id, version, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'account_name is nil' if account_name.nil?
fail ArgumentError, 'application_id is nil' if application_id.nil?
fail ArgumentError, 'version is nil' if version.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'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(: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 == 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
#
# Gets information about the specified application package.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [ApplicationPackage] operation results.
#
def get(resource_group_name, account_name, application_id, version, custom_headers = nil)
response = get_async(resource_group_name, account_name, application_id, version, custom_headers).value!
response.body unless response.nil?
end
#
# Gets information about the specified application package.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application.
# @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, account_name, application_id, version, custom_headers = nil)
get_async(resource_group_name, account_name, application_id, version, custom_headers).value!
end
#
# Gets information about the specified application package.
#
# @param resource_group_name [String] The name of the resource group that
# contains the Batch account.
# @param account_name [String] The name of the Batch account.
# @param application_id [String] The ID of the application.
# @param version [String] The version of the application.
# @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, account_name, application_id, version, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'account_name is nil' if account_name.nil?
fail ArgumentError, 'application_id is nil' if application_id.nil?
fail ArgumentError, 'version is nil' if version.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'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::ARM::Batch::Models::ApplicationPackage.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

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,146 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
#
# A service client - single point of access to the REST API.
#
class BatchManagementClient < 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] The Azure subscription ID. This is a GUID-formatted
# string (e.g. 00000000-0000-0000-0000-000000000000)
attr_accessor :subscription_id
# @return [String] The API version to be used with the HTTP request.
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 [BatchAccountOperations] batch_account_operations
attr_reader :batch_account_operations
# @return [ApplicationPackageOperations] application_package_operations
attr_reader :application_package_operations
# @return [ApplicationOperations] application_operations
attr_reader :application_operations
# @return [Location] location
attr_reader :location
# @return [Operations] operations
attr_reader :operations
#
# Creates initializes a new instance of the BatchManagementClient 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
@batch_account_operations = BatchAccountOperations.new(self)
@application_package_operations = ApplicationPackageOperations.new(self)
@application_operations = ApplicationOperations.new(self)
@location = Location.new(self)
@operations = Operations.new(self)
@api_version = '2017-05-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_batch'
if defined? Azure::ARM::Batch::VERSION
sdk_information = "#{sdk_information}/#{Azure::ARM::Batch::VERSION}"
end
add_user_agent_information(sdk_information)
end
end
end

Просмотреть файл

@ -1,118 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
#
# Location
#
class Location
include MsRestAzure
#
# Creates and initializes a new instance of the Location class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [BatchManagementClient] reference to the BatchManagementClient
attr_reader :client
#
# Gets the Batch service quotas for the specified subscription at the given
# location.
#
# @param location_name [String] The region for which to retrieve Batch service
# quotas.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [BatchLocationQuota] operation results.
#
def get_quotas(location_name, custom_headers = nil)
response = get_quotas_async(location_name, custom_headers).value!
response.body unless response.nil?
end
#
# Gets the Batch service quotas for the specified subscription at the given
# location.
#
# @param location_name [String] The region for which to retrieve Batch service
# quotas.
# @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_quotas_with_http_info(location_name, custom_headers = nil)
get_quotas_async(location_name, custom_headers).value!
end
#
# Gets the Batch service quotas for the specified subscription at the given
# location.
#
# @param location_name [String] The region for which to retrieve Batch service
# quotas.
# @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_quotas_async(location_name, custom_headers = nil)
fail ArgumentError, 'location_name is nil' if location_name.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Batch/locations/{locationName}/quotas'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'locationName' => location_name,'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::ARM::Batch::Models::BatchLocationQuota.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

Просмотреть файл

@ -1,16 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Defines values for AccountKeyType
#
module AccountKeyType
Primary = "Primary"
Secondary = "Secondary"
end
end
end

Просмотреть файл

@ -1,45 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Parameters for an activating an application package.
#
class ActivateApplicationPackageParameters
include MsRestAzure
include MsRest::JSONable
# @return [String] The format of the application package binary file.
attr_accessor :format
#
# Mapper for ActivateApplicationPackageParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ActivateApplicationPackageParameters',
type: {
name: 'Composite',
class_name: 'ActivateApplicationPackageParameters',
model_properties: {
format: {
required: true,
serialized_name: 'format',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,97 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Contains information about an application in a Batch account.
#
class Application
include MsRestAzure
include MsRest::JSONable
# @return [String] A string that uniquely identifies the application
# within the account.
attr_accessor :id
# @return [String] The display name for the application.
attr_accessor :display_name
# @return [Array<ApplicationPackage>] The list of packages under this
# application.
attr_accessor :packages
# @return [Boolean] A value indicating whether packages within the
# application may be overwritten using the same version string.
attr_accessor :allow_updates
# @return [String] The package to use if a client requests the
# application but does not specify a version.
attr_accessor :default_version
#
# Mapper for Application class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'Application',
type: {
name: 'Composite',
class_name: 'Application',
model_properties: {
id: {
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
display_name: {
required: false,
serialized_name: 'displayName',
type: {
name: 'String'
}
},
packages: {
required: false,
serialized_name: 'packages',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'ApplicationPackageElementType',
type: {
name: 'Composite',
class_name: 'ApplicationPackage'
}
}
}
},
allow_updates: {
required: false,
serialized_name: 'allowUpdates',
type: {
name: 'Boolean'
}
},
default_version: {
required: false,
serialized_name: 'defaultVersion',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,56 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Parameters for adding an Application.
#
class ApplicationCreateParameters
include MsRestAzure
include MsRest::JSONable
# @return [Boolean] A value indicating whether packages within the
# application may be overwritten using the same version string.
attr_accessor :allow_updates
# @return [String] The display name for the application.
attr_accessor :display_name
#
# Mapper for ApplicationCreateParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ApplicationCreateParameters',
type: {
name: 'Composite',
class_name: 'ApplicationCreateParameters',
model_properties: {
allow_updates: {
required: false,
serialized_name: 'allowUpdates',
type: {
name: 'Boolean'
}
},
display_name: {
required: false,
serialized_name: 'displayName',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,118 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# An application package which represents a particular version of an
# application.
#
class ApplicationPackage
include MsRestAzure
include MsRest::JSONable
# @return [String] The ID of the application.
attr_accessor :id
# @return [String] The version of the application package.
attr_accessor :version
# @return [PackageState] The current state of the application package.
# Possible values include: 'pending', 'active', 'unmapped'
attr_accessor :state
# @return [String] The format of the application package, if the package
# is active.
attr_accessor :format
# @return [String] The URL for the application package in Azure Storage.
attr_accessor :storage_url
# @return [DateTime] The UTC time at which the Azure Storage URL will
# expire.
attr_accessor :storage_url_expiry
# @return [DateTime] The time at which the package was last activated, if
# the package is active.
attr_accessor :last_activation_time
#
# Mapper for ApplicationPackage class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ApplicationPackage',
type: {
name: 'Composite',
class_name: 'ApplicationPackage',
model_properties: {
id: {
required: false,
read_only: true,
serialized_name: 'id',
type: {
name: 'String'
}
},
version: {
required: false,
read_only: true,
serialized_name: 'version',
type: {
name: 'String'
}
},
state: {
required: false,
read_only: true,
serialized_name: 'state',
type: {
name: 'Enum',
module: 'PackageState'
}
},
format: {
required: false,
read_only: true,
serialized_name: 'format',
type: {
name: 'String'
}
},
storage_url: {
required: false,
read_only: true,
serialized_name: 'storageUrl',
type: {
name: 'String'
}
},
storage_url_expiry: {
required: false,
read_only: true,
serialized_name: 'storageUrlExpiry',
type: {
name: 'DateTime'
}
},
last_activation_time: {
required: false,
read_only: true,
serialized_name: 'lastActivationTime',
type: {
name: 'DateTime'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,67 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Parameters for an update application request.
#
class ApplicationUpdateParameters
include MsRestAzure
include MsRest::JSONable
# @return [Boolean] A value indicating whether packages within the
# application may be overwritten using the same version string.
attr_accessor :allow_updates
# @return [String] The package to use if a client requests the
# application but does not specify a version.
attr_accessor :default_version
# @return [String] The display name for the application.
attr_accessor :display_name
#
# Mapper for ApplicationUpdateParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ApplicationUpdateParameters',
type: {
name: 'Composite',
class_name: 'ApplicationUpdateParameters',
model_properties: {
allow_updates: {
required: false,
serialized_name: 'allowUpdates',
type: {
name: 'Boolean'
}
},
default_version: {
required: false,
serialized_name: 'defaultVersion',
type: {
name: 'String'
}
},
display_name: {
required: false,
serialized_name: 'displayName',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,46 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# The properties related to the auto-storage account.
#
class AutoStorageBaseProperties
include MsRestAzure
include MsRest::JSONable
# @return [String] The resource ID of the storage account to be used for
# auto-storage account.
attr_accessor :storage_account_id
#
# Mapper for AutoStorageBaseProperties class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'AutoStorageBaseProperties',
type: {
name: 'Composite',
class_name: 'AutoStorageBaseProperties',
model_properties: {
storage_account_id: {
required: true,
serialized_name: 'storageAccountId',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,54 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Contains information about the auto-storage account associated with a
# Batch account.
#
class AutoStorageProperties < AutoStorageBaseProperties
include MsRestAzure
include MsRest::JSONable
# @return [DateTime] The UTC time at which storage keys were last
# synchronized with the Batch account.
attr_accessor :last_key_sync
#
# Mapper for AutoStorageProperties class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'AutoStorageProperties',
type: {
name: 'Composite',
class_name: 'AutoStorageProperties',
model_properties: {
storage_account_id: {
required: true,
serialized_name: 'storageAccountId',
type: {
name: 'String'
}
},
last_key_sync: {
required: true,
serialized_name: 'lastKeySync',
type: {
name: 'DateTime'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,193 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Contains information about an Azure Batch account.
#
class BatchAccount < MsRestAzure::Resource
include MsRestAzure
include MsRest::JSONable
# @return [String] The account endpoint used to interact with the Batch
# service.
attr_accessor :account_endpoint
# @return [ProvisioningState] The provisioned state of the resource.
# Possible values include: 'Invalid', 'Creating', 'Deleting',
# 'Succeeded', 'Failed', 'Cancelled'
attr_accessor :provisioning_state
# @return [PoolAllocationMode] The allocation mode to use for creating
# pools in the Batch account. Possible values include: 'BatchService',
# 'UserSubscription'
attr_accessor :pool_allocation_mode
# @return [KeyVaultReference] A reference to the Azure key vault
# associated with the Batch account.
attr_accessor :key_vault_reference
# @return [AutoStorageProperties] The properties and status of any
# auto-storage account associated with the Batch account.
attr_accessor :auto_storage
# @return [Integer] The dedicated core quota for this Batch account.
attr_accessor :dedicated_core_quota
# @return [Integer] The low-priority core quota for this Batch account.
attr_accessor :low_priority_core_quota
# @return [Integer] The pool quota for this Batch account.
attr_accessor :pool_quota
# @return [Integer] The active job and job schedule quota for this Batch
# account.
attr_accessor :active_job_and_job_schedule_quota
#
# Mapper for BatchAccount class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'BatchAccount',
type: {
name: 'Composite',
class_name: 'BatchAccount',
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,
read_only: true,
serialized_name: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
read_only: true,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
account_endpoint: {
required: false,
read_only: true,
serialized_name: 'properties.accountEndpoint',
type: {
name: 'String'
}
},
provisioning_state: {
required: false,
read_only: true,
serialized_name: 'properties.provisioningState',
type: {
name: 'Enum',
module: 'ProvisioningState'
}
},
pool_allocation_mode: {
required: false,
read_only: true,
serialized_name: 'properties.poolAllocationMode',
type: {
name: 'Enum',
module: 'PoolAllocationMode'
}
},
key_vault_reference: {
required: false,
read_only: true,
serialized_name: 'properties.keyVaultReference',
type: {
name: 'Composite',
class_name: 'KeyVaultReference'
}
},
auto_storage: {
required: false,
read_only: true,
serialized_name: 'properties.autoStorage',
type: {
name: 'Composite',
class_name: 'AutoStorageProperties'
}
},
dedicated_core_quota: {
required: false,
read_only: true,
serialized_name: 'properties.dedicatedCoreQuota',
type: {
name: 'Number'
}
},
low_priority_core_quota: {
required: false,
read_only: true,
serialized_name: 'properties.lowPriorityCoreQuota',
type: {
name: 'Number'
}
},
pool_quota: {
required: false,
read_only: true,
serialized_name: 'properties.poolQuota',
type: {
name: 'Number'
}
},
active_job_and_job_schedule_quota: {
required: false,
read_only: true,
serialized_name: 'properties.activeJobAndJobScheduleQuota',
type: {
name: 'Number'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,104 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Parameters supplied to the Create operation.
#
class BatchAccountCreateParameters
include MsRestAzure
include MsRest::JSONable
# @return [String] The region in which to create the account.
attr_accessor :location
# @return [Hash{String => String}] The user-specified tags associated
# with the account.
attr_accessor :tags
# @return [AutoStorageBaseProperties] The properties related to the
# auto-storage account.
attr_accessor :auto_storage
# @return [PoolAllocationMode] The allocation mode to use for creating
# pools in the Batch account. The pool allocation mode also affects how
# clients may authenticate to the Batch Service API. If the mode is
# BatchService, clients may authenticate using access keys or Azure
# Active Directory. If the mode is UserSubscription, clients must use
# Azure Active Directory. The default is BatchService. Possible values
# include: 'BatchService', 'UserSubscription'
attr_accessor :pool_allocation_mode
# @return [KeyVaultReference] A reference to the Azure key vault
# associated with the Batch account.
attr_accessor :key_vault_reference
#
# Mapper for BatchAccountCreateParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'BatchAccountCreateParameters',
type: {
name: 'Composite',
class_name: 'BatchAccountCreateParameters',
model_properties: {
location: {
required: true,
serialized_name: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
auto_storage: {
required: false,
serialized_name: 'properties.autoStorage',
type: {
name: 'Composite',
class_name: 'AutoStorageBaseProperties'
}
},
pool_allocation_mode: {
required: false,
serialized_name: 'properties.poolAllocationMode',
type: {
name: 'Enum',
module: 'PoolAllocationMode'
}
},
key_vault_reference: {
required: false,
serialized_name: 'properties.keyVaultReference',
type: {
name: 'Composite',
class_name: 'KeyVaultReference'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,68 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# A set of Azure Batch account keys.
#
class BatchAccountKeys
include MsRestAzure
include MsRest::JSONable
# @return [String] The Batch account name.
attr_accessor :account_name
# @return [String] The primary key associated with the account.
attr_accessor :primary
# @return [String] The secondary key associated with the account.
attr_accessor :secondary
#
# Mapper for BatchAccountKeys class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'BatchAccountKeys',
type: {
name: 'Composite',
class_name: 'BatchAccountKeys',
model_properties: {
account_name: {
required: false,
read_only: true,
serialized_name: 'accountName',
type: {
name: 'String'
}
},
primary: {
required: false,
read_only: true,
serialized_name: 'primary',
type: {
name: 'String'
}
},
secondary: {
required: false,
read_only: true,
serialized_name: 'secondary',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,95 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Values returned by the List operation.
#
class BatchAccountListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<BatchAccount>] The collection of Batch accounts returned
# by the listing operation.
attr_accessor :value
# @return [String] The continuation token.
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<BatchAccount>] 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 [BatchAccountListResult] 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 BatchAccountListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'BatchAccountListResult',
type: {
name: 'Composite',
class_name: 'BatchAccountListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'BatchAccountElementType',
type: {
name: 'Composite',
class_name: 'BatchAccount'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,47 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Parameters supplied to the RegenerateKey operation.
#
class BatchAccountRegenerateKeyParameters
include MsRestAzure
include MsRest::JSONable
# @return [AccountKeyType] The type of account key to regenerate.
# Possible values include: 'Primary', 'Secondary'
attr_accessor :key_name
#
# Mapper for BatchAccountRegenerateKeyParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'BatchAccountRegenerateKeyParameters',
type: {
name: 'Composite',
class_name: 'BatchAccountRegenerateKeyParameters',
model_properties: {
key_name: {
required: true,
serialized_name: 'keyName',
type: {
name: 'Enum',
module: 'AccountKeyType'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,65 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Parameters for updating an Azure Batch account.
#
class BatchAccountUpdateParameters
include MsRestAzure
include MsRest::JSONable
# @return [Hash{String => String}] The user-specified tags associated
# with the account.
attr_accessor :tags
# @return [AutoStorageBaseProperties] The properties related to the
# auto-storage account.
attr_accessor :auto_storage
#
# Mapper for BatchAccountUpdateParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'BatchAccountUpdateParameters',
type: {
name: 'Composite',
class_name: 'BatchAccountUpdateParameters',
model_properties: {
tags: {
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
auto_storage: {
required: false,
serialized_name: 'properties.autoStorage',
type: {
name: 'Composite',
class_name: 'AutoStorageBaseProperties'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,47 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Quotas associated with a Batch region for a particular subscription.
#
class BatchLocationQuota
include MsRestAzure
include MsRest::JSONable
# @return [Integer] The number of Batch accounts that may be created
# under the subscription in the specified region.
attr_accessor :account_quota
#
# Mapper for BatchLocationQuota class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'BatchLocationQuota',
type: {
name: 'Composite',
class_name: 'BatchLocationQuota',
model_properties: {
account_quota: {
required: false,
read_only: true,
serialized_name: 'accountQuota',
type: {
name: 'Number'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,57 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Identifies the Azure key vault associated with a Batch account.
#
class KeyVaultReference
include MsRestAzure
include MsRest::JSONable
# @return [String] The resource ID of the Azure key vault associated with
# the Batch account.
attr_accessor :id
# @return [String] The URL of the Azure key vault associated with the
# Batch account.
attr_accessor :url
#
# Mapper for KeyVaultReference class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'KeyVaultReference',
type: {
name: 'Composite',
class_name: 'KeyVaultReference',
model_properties: {
id: {
required: true,
serialized_name: 'id',
type: {
name: 'String'
}
},
url: {
required: true,
serialized_name: 'url',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,94 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# The result of performing list applications.
#
class ListApplicationsResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Application>] The list of applications.
attr_accessor :value
# @return [String] The URL to get the next set of results.
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<Application>] 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 [ListApplicationsResult] 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 ListApplicationsResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ListApplicationsResult',
type: {
name: 'Composite',
class_name: 'ListApplicationsResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'ApplicationElementType',
type: {
name: 'Composite',
class_name: 'Application'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,78 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# A REST API operation
#
#
class Operation
include MsRestAzure
include MsRest::JSONable
# @return [String] The operation name. This is of the format
# {provider}/{resource}/{operation}
attr_accessor :name
# @return [OperationDisplay] The object that describes the operation.
attr_accessor :display
# @return [String] The intended executor of the operation.
attr_accessor :origin
# @return Properties of the operation.
attr_accessor :properties
#
# 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,
serialized_name: 'name',
type: {
name: 'String'
}
},
display: {
required: false,
serialized_name: 'display',
type: {
name: 'Composite',
class_name: 'OperationDisplay'
}
},
origin: {
required: false,
serialized_name: 'origin',
type: {
name: 'String'
}
},
properties: {
required: false,
serialized_name: 'properties',
type: {
name: 'Object'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,77 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# The object that describes the operation.
#
#
class OperationDisplay
include MsRestAzure
include MsRest::JSONable
# @return [String] Friendly name of the resource provider.
attr_accessor :provider
# @return [String] The operation type. For example: read, write, delete,
# or listKeys/action
attr_accessor :operation
# @return [String] The resource type on which the operation is performed.
attr_accessor :resource
# @return [String] The friendly name 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'
}
},
operation: {
required: false,
serialized_name: 'operation',
type: {
name: 'String'
}
},
resource: {
required: false,
serialized_name: 'resource',
type: {
name: 'String'
}
},
description: {
required: false,
serialized_name: 'description',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,94 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Model object.
#
class OperationListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Operation>]
attr_accessor :value
# @return [String]
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>] 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 [OperationListResult] 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 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

Просмотреть файл

@ -1,17 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Defines values for PackageState
#
module PackageState
Pending = "pending"
Active = "active"
Unmapped = "unmapped"
end
end
end

Просмотреть файл

@ -1,16 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Defines values for PoolAllocationMode
#
module PoolAllocationMode
BatchService = "BatchService"
UserSubscription = "UserSubscription"
end
end
end

Просмотреть файл

@ -1,20 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
module Models
#
# Defines values for ProvisioningState
#
module ProvisioningState
Invalid = "Invalid"
Creating = "Creating"
Deleting = "Deleting"
Succeeded = "Succeeded"
Failed = "Failed"
Cancelled = "Cancelled"
end
end
end

Просмотреть файл

@ -1,8 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure end
module Azure::ARM end
module Azure::ARM::Batch end

Просмотреть файл

@ -1,213 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
#
# 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 [BatchManagementClient] reference to the BatchManagementClient
attr_reader :client
#
# Lists available operations for the Microsoft.Batch provider
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<Operation>] operation results.
#
def list(custom_headers = nil)
first_page = list_as_lazy(custom_headers)
first_page.get_all_items
end
#
# Lists available operations for the Microsoft.Batch provider
#
# @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
#
# Lists available operations for the Microsoft.Batch provider
#
# @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.Batch/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::ARM::Batch::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
#
# Lists available operations for the Microsoft.Batch provider
#
# @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 [OperationListResult] 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
#
# Lists available operations for the Microsoft.Batch provider
#
# @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
#
# Lists available operations for the Microsoft.Batch provider
#
# @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::ARM::Batch::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
#
# Lists available operations for the Microsoft.Batch provider
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [OperationListResult] 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
end
end

Просмотреть файл

@ -1,8 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::Batch
VERSION = '0.11.0'
end

Просмотреть файл

@ -1,73 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# 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 'generated/azure_mgmt_cdn/module_definition'
require 'ms_rest_azure'
module Azure::ARM::CDN
autoload :Profiles, 'generated/azure_mgmt_cdn/profiles.rb'
autoload :Endpoints, 'generated/azure_mgmt_cdn/endpoints.rb'
autoload :Origins, 'generated/azure_mgmt_cdn/origins.rb'
autoload :CustomDomains, 'generated/azure_mgmt_cdn/custom_domains.rb'
autoload :EdgeNodes, 'generated/azure_mgmt_cdn/edge_nodes.rb'
autoload :CdnManagementClient, 'generated/azure_mgmt_cdn/cdn_management_client.rb'
module Models
autoload :CustomDomainParameters, 'generated/azure_mgmt_cdn/models/custom_domain_parameters.rb'
autoload :CustomDomainListResult, 'generated/azure_mgmt_cdn/models/custom_domain_list_result.rb'
autoload :ProfileListResult, 'generated/azure_mgmt_cdn/models/profile_list_result.rb'
autoload :Sku, 'generated/azure_mgmt_cdn/models/sku.rb'
autoload :SsoUri, 'generated/azure_mgmt_cdn/models/sso_uri.rb'
autoload :EdgenodeResult, 'generated/azure_mgmt_cdn/models/edgenode_result.rb'
autoload :ValidateCustomDomainInput, 'generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb'
autoload :GeoFilter, 'generated/azure_mgmt_cdn/models/geo_filter.rb'
autoload :ValidateCustomDomainOutput, 'generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb'
autoload :PurgeParameters, 'generated/azure_mgmt_cdn/models/purge_parameters.rb'
autoload :CheckNameAvailabilityInput, 'generated/azure_mgmt_cdn/models/check_name_availability_input.rb'
autoload :ErrorResponse, 'generated/azure_mgmt_cdn/models/error_response.rb'
autoload :CheckNameAvailabilityOutput, 'generated/azure_mgmt_cdn/models/check_name_availability_output.rb'
autoload :OriginListResult, 'generated/azure_mgmt_cdn/models/origin_list_result.rb'
autoload :ResourceUsage, 'generated/azure_mgmt_cdn/models/resource_usage.rb'
autoload :DeepCreatedOrigin, 'generated/azure_mgmt_cdn/models/deep_created_origin.rb'
autoload :ResourceUsageListResult, 'generated/azure_mgmt_cdn/models/resource_usage_list_result.rb'
autoload :EndpointUpdateParameters, 'generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb'
autoload :OperationDisplay, 'generated/azure_mgmt_cdn/models/operation_display.rb'
autoload :OriginUpdateParameters, 'generated/azure_mgmt_cdn/models/origin_update_parameters.rb'
autoload :Operation, 'generated/azure_mgmt_cdn/models/operation.rb'
autoload :EndpointListResult, 'generated/azure_mgmt_cdn/models/endpoint_list_result.rb'
autoload :OperationListResult, 'generated/azure_mgmt_cdn/models/operation_list_result.rb'
autoload :ProfileUpdateParameters, 'generated/azure_mgmt_cdn/models/profile_update_parameters.rb'
autoload :CidrIpAddress, 'generated/azure_mgmt_cdn/models/cidr_ip_address.rb'
autoload :LoadParameters, 'generated/azure_mgmt_cdn/models/load_parameters.rb'
autoload :IpAddressGroup, 'generated/azure_mgmt_cdn/models/ip_address_group.rb'
autoload :Profile, 'generated/azure_mgmt_cdn/models/profile.rb'
autoload :Endpoint, 'generated/azure_mgmt_cdn/models/endpoint.rb'
autoload :Origin, 'generated/azure_mgmt_cdn/models/origin.rb'
autoload :CustomDomain, 'generated/azure_mgmt_cdn/models/custom_domain.rb'
autoload :EdgeNode, 'generated/azure_mgmt_cdn/models/edge_node.rb'
autoload :SkuName, 'generated/azure_mgmt_cdn/models/sku_name.rb'
autoload :ProfileResourceState, 'generated/azure_mgmt_cdn/models/profile_resource_state.rb'
autoload :EndpointResourceState, 'generated/azure_mgmt_cdn/models/endpoint_resource_state.rb'
autoload :QueryStringCachingBehavior, 'generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb'
autoload :GeoFilterActions, 'generated/azure_mgmt_cdn/models/geo_filter_actions.rb'
autoload :OriginResourceState, 'generated/azure_mgmt_cdn/models/origin_resource_state.rb'
autoload :CustomDomainResourceState, 'generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb'
autoload :CustomHttpsProvisioningState, 'generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb'
autoload :ResourceType, 'generated/azure_mgmt_cdn/models/resource_type.rb'
end
end

Просмотреть файл

@ -1,743 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
#
# A service client - single point of access to the REST API.
#
class CdnManagementClient < 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] Azure Subscription ID.
attr_accessor :subscription_id
# @return [String] Version of the API to be used with the client request.
# Current version is 2016-10-02.
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 [Profiles] profiles
attr_reader :profiles
# @return [Endpoints] endpoints
attr_reader :endpoints
# @return [Origins] origins
attr_reader :origins
# @return [CustomDomains] custom_domains
attr_reader :custom_domains
# @return [EdgeNodes] edge_nodes
attr_reader :edge_nodes
#
# Creates initializes a new instance of the CdnManagementClient 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
@profiles = Profiles.new(self)
@endpoints = Endpoints.new(self)
@origins = Origins.new(self)
@custom_domains = CustomDomains.new(self)
@edge_nodes = EdgeNodes.new(self)
@api_version = '2016-10-02'
@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
#
# Check the availability of a resource name. This is needed for resources where
# name is globally unique, such as a CDN endpoint.
#
# @param check_name_availability_input [CheckNameAvailabilityInput] Input to
# check.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [CheckNameAvailabilityOutput] operation results.
#
def check_name_availability(check_name_availability_input, custom_headers = nil)
response = check_name_availability_async(check_name_availability_input, custom_headers).value!
response.body unless response.nil?
end
#
# Check the availability of a resource name. This is needed for resources where
# name is globally unique, such as a CDN endpoint.
#
# @param check_name_availability_input [CheckNameAvailabilityInput] Input to
# check.
# @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 check_name_availability_with_http_info(check_name_availability_input, custom_headers = nil)
check_name_availability_async(check_name_availability_input, custom_headers).value!
end
#
# Check the availability of a resource name. This is needed for resources where
# name is globally unique, such as a CDN endpoint.
#
# @param check_name_availability_input [CheckNameAvailabilityInput] Input to
# check.
# @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 check_name_availability_async(check_name_availability_input, custom_headers = nil)
fail ArgumentError, 'check_name_availability_input is nil' if check_name_availability_input.nil?
fail ArgumentError, 'api_version is nil' if api_version.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = accept_language unless accept_language.nil?
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Serialize Request
request_mapper = Azure::ARM::CDN::Models::CheckNameAvailabilityInput.mapper()
request_content = self.serialize(request_mapper, check_name_availability_input)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'providers/Microsoft.Cdn/checkNameAvailability'
request_url = @base_url || self.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
query_params: {'api-version' => api_version},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = self.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 MsRest::HttpOperationError.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::ARM::CDN::Models::CheckNameAvailabilityOutput.mapper()
result.body = self.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
#
# Check the quota and actual usage of the CDN profiles under the given
# subscription.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<ResourceUsage>] operation results.
#
def list_resource_usage(custom_headers = nil)
first_page = list_resource_usage_as_lazy(custom_headers)
first_page.get_all_items
end
#
# Check the quota and actual usage of the CDN profiles under the given
# subscription.
#
# @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_resource_usage_with_http_info(custom_headers = nil)
list_resource_usage_async(custom_headers).value!
end
#
# Check the quota and actual usage of the CDN profiles under the given
# subscription.
#
# @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_resource_usage_async(custom_headers = nil)
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
fail ArgumentError, 'api_version is nil' if api_version.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = accept_language unless accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage'
request_url = @base_url || self.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => subscription_id},
query_params: {'api-version' => api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = self.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 MsRest::HttpOperationError.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::ARM::CDN::Models::ResourceUsageListResult.mapper()
result.body = self.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
#
# Lists all of the available CDN REST API operations.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<Operation>] operation results.
#
def list_operations(custom_headers = nil)
first_page = list_operations_as_lazy(custom_headers)
first_page.get_all_items
end
#
# Lists all of the available CDN REST API operations.
#
# @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_operations_with_http_info(custom_headers = nil)
list_operations_async(custom_headers).value!
end
#
# Lists all of the available CDN REST API operations.
#
# @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_operations_async(custom_headers = nil)
fail ArgumentError, 'api_version is nil' if api_version.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = accept_language unless accept_language.nil?
path_template = 'providers/Microsoft.Cdn/operations'
request_url = @base_url || self.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
query_params: {'api-version' => api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = self.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 MsRest::HttpOperationError.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::ARM::CDN::Models::OperationListResult.mapper()
result.body = self.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
#
# Check the quota and actual usage of the CDN profiles under the given
# subscription.
#
# @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 [ResourceUsageListResult] operation results.
#
def list_resource_usage_next(next_page_link, custom_headers = nil)
response = list_resource_usage_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Check the quota and actual usage of the CDN profiles under the given
# subscription.
#
# @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_resource_usage_next_with_http_info(next_page_link, custom_headers = nil)
list_resource_usage_next_async(next_page_link, custom_headers).value!
end
#
# Check the quota and actual usage of the CDN profiles under the given
# subscription.
#
# @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_resource_usage_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'] = accept_language unless accept_language.nil?
path_template = '{nextLink}'
request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::ARM::CDN::Models::ResourceUsageListResult.mapper()
result.body = self.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
#
# Lists all of the available CDN REST API operations.
#
# @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 [OperationListResult] operation results.
#
def list_operations_next(next_page_link, custom_headers = nil)
response = list_operations_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Lists all of the available CDN REST API operations.
#
# @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_operations_next_with_http_info(next_page_link, custom_headers = nil)
list_operations_next_async(next_page_link, custom_headers).value!
end
#
# Lists all of the available CDN REST API operations.
#
# @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_operations_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'] = accept_language unless accept_language.nil?
path_template = '{nextLink}'
request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::ARM::CDN::Models::OperationListResult.mapper()
result.body = self.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
#
# Check the quota and actual usage of the CDN profiles under the given
# subscription.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [ResourceUsageListResult] operation results.
#
def list_resource_usage_as_lazy(custom_headers = nil)
first_page = list_resource_usage_as_lazy_as_lazy(custom_headers)
first_page.get_all_items
end
#
# Check the quota and actual usage of the CDN profiles under the given
# subscription.
#
# @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_resource_usage_as_lazy_with_http_info(custom_headers = nil)
list_resource_usage_as_lazy_async(custom_headers).value!
end
#
# Check the quota and actual usage of the CDN profiles under the given
# subscription.
#
# @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_resource_usage_as_lazy_async(custom_headers = nil)
request_headers = {}
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage'
request_url = @base_url || self.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = self.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 MsRest::HttpOperationError.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::ARM::CDN::Models::ResourceUsageListResult.mapper()
result.body = self.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
#
# Lists all of the available CDN REST API operations.
#
# @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_operations_as_lazy(custom_headers = nil)
first_page = list_operations_as_lazy_as_lazy(custom_headers)
first_page.get_all_items
end
#
# Lists all of the available CDN REST API operations.
#
# @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_operations_as_lazy_with_http_info(custom_headers = nil)
list_operations_as_lazy_async(custom_headers).value!
end
#
# Lists all of the available CDN REST API operations.
#
# @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_operations_as_lazy_async(custom_headers = nil)
request_headers = {}
path_template = 'providers/Microsoft.Cdn/operations'
request_url = @base_url || self.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = self.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 MsRest::HttpOperationError.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::ARM::CDN::Models::OperationListResult.mapper()
result.body = self.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
private
#
# Adds telemetry information.
#
def add_telemetry
sdk_information = 'azure_mgmt_cdn'
if defined? Azure::ARM::CDN::VERSION
sdk_information = "#{sdk_information}/#{Azure::ARM::CDN::VERSION}"
end
add_user_agent_information(sdk_information)
end
end
end

Просмотреть файл

@ -1,947 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
#
# Use these APIs to manage Azure CDN resources through the Azure Resource
# Manager. You must make sure that requests made to these resources are
# secure.
#
class CustomDomains
include MsRestAzure
#
# Creates and initializes a new instance of the CustomDomains class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [CdnManagementClient] reference to the CdnManagementClient
attr_reader :client
#
# Lists all of the existing custom domains within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<CustomDomain>] operation results.
#
def list_by_endpoint(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
first_page = list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers)
first_page.get_all_items
end
#
# Lists all of the existing custom domains within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @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_endpoint_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers).value!
end
#
# Lists all of the existing custom domains within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @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_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
fail ArgumentError, 'endpoint_name is nil' if endpoint_name.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'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 MsRest::HttpOperationError.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::ARM::CDN::Models::CustomDomainListResult.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
#
# Gets an exisitng custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [CustomDomain] operation results.
#
def get(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
response = get_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
response.body unless response.nil?
end
#
# Gets an exisitng custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @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, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
get_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
end
#
# Gets an exisitng custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @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, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'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 MsRest::HttpOperationError.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::ARM::CDN::Models::CustomDomain.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
#
# Creates a new custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_domain_properties [CustomDomainParameters] Properties required
# to create a new custom domain.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [CustomDomain] operation results.
#
def create(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
response = create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers).value!
response.body unless response.nil?
end
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_domain_properties [CustomDomainParameters] Properties required
# to create a new custom domain.
# @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_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
# Send request
promise = begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::ARM::CDN::Models::CustomDomain.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
#
# Deletes an existing custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [CustomDomain] operation results.
#
def delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
response = delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
response.body unless response.nil?
end
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @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 delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
# Send request
promise = begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::ARM::CDN::Models::CustomDomain.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
#
# Disable https delivery of the custom domain.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [CustomDomain] operation results.
#
def disable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
response = disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
response.body unless response.nil?
end
#
# Disable https delivery of the custom domain.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @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 disable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
end
#
# Disable https delivery of the custom domain.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @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 disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'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(: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 == 202 || status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.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 == 202
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::CDN::Models::CustomDomain.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
#
# Enable https delivery of the custom domain.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [CustomDomain] operation results.
#
def enable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
response = enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
response.body unless response.nil?
end
#
# Enable https delivery of the custom domain.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @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 enable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
end
#
# Enable https delivery of the custom domain.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @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 enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'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(: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 == 202 || status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.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 == 202
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::CDN::Models::CustomDomain.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
#
# Creates a new custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_domain_properties [CustomDomainParameters] Properties required
# to create a new custom domain.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [CustomDomain] operation results.
#
def begin_create(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
response = begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers).value!
response.body unless response.nil?
end
#
# Creates a new custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_domain_properties [CustomDomainParameters] Properties required
# to create a new custom domain.
# @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_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers).value!
end
#
# Creates a new custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_domain_properties [CustomDomainParameters] Properties required
# to create a new custom domain.
# @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_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
fail ArgumentError, 'custom_domain_properties is nil' if custom_domain_properties.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?
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Serialize Request
request_mapper = Azure::ARM::CDN::Models::CustomDomainParameters.mapper()
request_content = @client.serialize(request_mapper, custom_domain_properties)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id},
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 || status_code == 202
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.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::ARM::CDN::Models::CustomDomain.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::ARM::CDN::Models::CustomDomain.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 == 202
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::CDN::Models::CustomDomain.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
#
# Deletes an existing custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [CustomDomain] operation results.
#
def begin_delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
response = begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
response.body unless response.nil?
end
#
# Deletes an existing custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @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_delete_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
end
#
# Deletes an existing custom domain within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_domain_name [String] Name of the custom domain within an
# endpoint.
# @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_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'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(: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 == 202 || status_code == 204
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.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 == 202
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::CDN::Models::CustomDomain.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
#
# Lists all of the existing custom domains within an endpoint.
#
# @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 [CustomDomainListResult] operation results.
#
def list_by_endpoint_next(next_page_link, custom_headers = nil)
response = list_by_endpoint_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Lists all of the existing custom domains within an endpoint.
#
# @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_endpoint_next_with_http_info(next_page_link, custom_headers = nil)
list_by_endpoint_next_async(next_page_link, custom_headers).value!
end
#
# Lists all of the existing custom domains within an endpoint.
#
# @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_endpoint_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 MsRest::HttpOperationError.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::ARM::CDN::Models::CustomDomainListResult.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
#
# Lists all of the existing custom domains within an endpoint.
#
# @param resource_group_name [String] Name of the Resource group within the
# Azure subscription.
# @param profile_name [String] Name of the CDN profile which is unique within
# the resource group.
# @param endpoint_name [String] Name of the endpoint under the profile which is
# unique globally.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [CustomDomainListResult] which provide lazy access to pages of the
# response.
#
def list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
response = list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_endpoint_next_async(next_page_link, custom_headers)
end
page
end
end
end
end

Просмотреть файл

@ -1,214 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
#
# Use these APIs to manage Azure CDN resources through the Azure Resource
# Manager. You must make sure that requests made to these resources are
# secure.
#
class EdgeNodes
include MsRestAzure
#
# Creates and initializes a new instance of the EdgeNodes class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [CdnManagementClient] reference to the CdnManagementClient
attr_reader :client
#
# Lists all the edge nodes of a CDN service.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<EdgeNode>] operation results.
#
def list(custom_headers = nil)
first_page = list_as_lazy(custom_headers)
first_page.get_all_items
end
#
# Lists all the edge nodes of a CDN 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
#
# Lists all the edge nodes of a CDN 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.Cdn/edgenodes'
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 MsRest::HttpOperationError.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::ARM::CDN::Models::EdgenodeResult.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
#
# Lists all the edge nodes of a CDN service.
#
# @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 [EdgenodeResult] 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
#
# Lists all the edge nodes of a CDN service.
#
# @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
#
# Lists all the edge nodes of a CDN service.
#
# @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 MsRest::HttpOperationError.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::ARM::CDN::Models::EdgenodeResult.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
#
# Lists all the edge nodes of a CDN service.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [EdgenodeResult] 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
end
end

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,58 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Input of CheckNameAvailability API.
#
class CheckNameAvailabilityInput
include MsRestAzure
include MsRest::JSONable
# @return [String] The resource name to validate.
attr_accessor :name
# @return [String] The type of the resource whose name is to be
# validated. Default value: 'Microsoft.Cdn/Profiles/Endpoints' .
attr_accessor :type
#
# Mapper for CheckNameAvailabilityInput class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'CheckNameAvailabilityInput',
type: {
name: 'Composite',
class_name: 'CheckNameAvailabilityInput',
model_properties: {
name: {
required: true,
serialized_name: 'name',
type: {
name: 'String'
}
},
type: {
required: true,
is_constant: true,
serialized_name: 'type',
default_value: 'Microsoft.Cdn/Profiles/Endpoints',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,66 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Output of check name availability API.
#
class CheckNameAvailabilityOutput
include MsRestAzure
include MsRest::JSONable
# @return [Boolean] Indicates whether the name is available.
attr_accessor :name_available
# @return [String] The reason why the name is not available.
attr_accessor :reason
# @return [String] The detailed error message describing why the name is
# not available.
attr_accessor :message
#
# Mapper for CheckNameAvailabilityOutput class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'CheckNameAvailabilityOutput',
type: {
name: 'Composite',
class_name: 'CheckNameAvailabilityOutput',
model_properties: {
name_available: {
required: false,
serialized_name: 'nameAvailable',
type: {
name: 'Boolean'
}
},
reason: {
required: false,
serialized_name: 'reason',
type: {
name: 'String'
}
},
message: {
required: false,
serialized_name: 'message',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,55 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# CIDR Ip address
#
class CidrIpAddress
include MsRestAzure
include MsRest::JSONable
# @return [String] Ip adress itself.
attr_accessor :base_ip_address
# @return [Integer] The length of the prefix of the ip address.
attr_accessor :prefix_length
#
# Mapper for CidrIpAddress class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'cidrIpAddress',
type: {
name: 'Composite',
class_name: 'CidrIpAddress',
model_properties: {
base_ip_address: {
required: false,
serialized_name: 'baseIpAddress',
type: {
name: 'String'
}
},
prefix_length: {
required: false,
serialized_name: 'prefixLength',
type: {
name: 'Number'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,140 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Customer provided domain for branding purposes, e.g. www.consoto.com.
#
class CustomDomain < MsRestAzure::Resource
include MsRestAzure
include MsRest::JSONable
# @return [String] The host name of the custom domain. Must be a domain
# name.
attr_accessor :host_name
# @return [CustomDomainResourceState] Resource status of the custom
# domain. Possible values include: 'Creating', 'Active', 'Deleting'
attr_accessor :resource_state
# @return [CustomHttpsProvisioningState] Provisioning state of Custom
# Https of the custom domain. Possible values include: 'Enabling',
# 'Enabled', 'Disabling', 'Disabled', 'Failed'
attr_accessor :custom_https_provisioning_state
# @return [String] Special validation or data may be required when
# delivering CDN to some regions due to local compliance reasons. E.g.
# ICP license number of a custom domain is required to deliver content in
# China.
attr_accessor :validation_data
# @return [String] Provisioning status of the custom domain.
attr_accessor :provisioning_state
#
# Mapper for CustomDomain class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'CustomDomain',
type: {
name: 'Composite',
class_name: 'CustomDomain',
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: true,
serialized_name: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
host_name: {
required: true,
serialized_name: 'properties.hostName',
type: {
name: 'String'
}
},
resource_state: {
required: false,
read_only: true,
serialized_name: 'properties.resourceState',
type: {
name: 'String'
}
},
custom_https_provisioning_state: {
required: false,
read_only: true,
serialized_name: 'properties.customHttpsProvisioningState',
type: {
name: 'String'
}
},
validation_data: {
required: false,
serialized_name: 'properties.validationData',
type: {
name: 'String'
}
},
provisioning_state: {
required: false,
read_only: true,
serialized_name: 'properties.provisioningState',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,97 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Result of the request to list custom domains. It contains a list of
# custom domain objects and a URL link to get the next set of results.
#
class CustomDomainListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<CustomDomain>] List of CDN CustomDomains within an
# endpoint.
attr_accessor :value
# @return [String] URL to get the next set of custom domain objects if
# there are any.
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<CustomDomain>] 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 [CustomDomainListResult] 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 CustomDomainListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'CustomDomainListResult',
type: {
name: 'Composite',
class_name: 'CustomDomainListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'CustomDomainElementType',
type: {
name: 'Composite',
class_name: 'CustomDomain'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,47 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# The customDomain JSON object required for custom domain creation or
# update.
#
class CustomDomainParameters
include MsRestAzure
include MsRest::JSONable
# @return [String] The host name of the custom domain. Must be a domain
# name.
attr_accessor :host_name
#
# Mapper for CustomDomainParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'CustomDomainParameters',
type: {
name: 'Composite',
class_name: 'CustomDomainParameters',
model_properties: {
host_name: {
required: true,
serialized_name: 'properties.hostName',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,17 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Defines values for CustomDomainResourceState
#
module CustomDomainResourceState
Creating = "Creating"
Active = "Active"
Deleting = "Deleting"
end
end
end

Просмотреть файл

@ -1,19 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Defines values for CustomHttpsProvisioningState
#
module CustomHttpsProvisioningState
Enabling = "Enabling"
Enabled = "Enabled"
Disabling = "Disabling"
Disabled = "Disabled"
Failed = "Failed"
end
end
end

Просмотреть файл

@ -1,86 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Origin to be added when creating a CDN endpoint.
#
class DeepCreatedOrigin
include MsRestAzure
include MsRest::JSONable
# @return [String] Origin name
attr_accessor :name
# @return [String] The address of the origin. It can be a domain names,
# IPv4 address, or IPv6 address.
attr_accessor :host_name
# @return [Integer] The value of the HTTP port. Must be between 1 and
# 65535
attr_accessor :http_port
# @return [Integer] The value of the HTTPS port. Must be between 1 and
# 65535
attr_accessor :https_port
#
# Mapper for DeepCreatedOrigin class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'DeepCreatedOrigin',
type: {
name: 'Composite',
class_name: 'DeepCreatedOrigin',
model_properties: {
name: {
required: true,
serialized_name: 'name',
type: {
name: 'String'
}
},
host_name: {
required: true,
serialized_name: 'properties.hostName',
type: {
name: 'String'
}
},
http_port: {
required: false,
serialized_name: 'properties.httpPort',
constraints: {
InclusiveMaximum: 65535,
InclusiveMinimum: 1
},
type: {
name: 'Number'
}
},
https_port: {
required: false,
serialized_name: 'properties.httpsPort',
constraints: {
InclusiveMaximum: 65535,
InclusiveMinimum: 1
},
type: {
name: 'Number'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,98 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Edge node of CDN service.
#
class EdgeNode < MsRestAzure::Resource
include MsRestAzure
include MsRest::JSONable
# @return [Array<IpAddressGroup>] List of ip address groups.
attr_accessor :ip_address_groups
#
# Mapper for EdgeNode class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'EdgeNode',
type: {
name: 'Composite',
class_name: 'EdgeNode',
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: true,
serialized_name: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
ip_address_groups: {
required: true,
serialized_name: 'properties.ipAddressGroups',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'IpAddressGroupElementType',
type: {
name: 'Composite',
class_name: 'IpAddressGroup'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,96 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Result of the request to list CDN edgenodes. It contains a list of ip
# address group and a URL link to get the next set of results.
#
class EdgenodeResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<EdgeNode>] Edge node of CDN service.
attr_accessor :value
# @return [String] URL to get the next set of edgenode list results if
# there are any.
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<EdgeNode>] 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 [EdgenodeResult] 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 EdgenodeResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'EdgenodeResult',
type: {
name: 'Composite',
class_name: 'EdgenodeResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'EdgeNodeElementType',
type: {
name: 'Composite',
class_name: 'EdgeNode'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,260 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# CDN endpoint is the entity within a CDN profile containing configuration
# information such as origin, protocol, content caching and delivery
# behavior. The CDN endpoint uses the URL format
# <endpointname>.azureedge.net.
#
class Endpoint < MsRestAzure::Resource
include MsRestAzure
include MsRest::JSONable
# @return [String] The host header CDN sends along with content requests
# to origin. The default value is the host name of the origin.
attr_accessor :origin_host_header
# @return [String] The path used when CDN sends request to origin.
attr_accessor :origin_path
# @return [Array<String>] List of content types on which compression
# applies. The value should be a valid MIME type.
attr_accessor :content_types_to_compress
# @return [Boolean] Indicates whether content compression is enabled on
# CDN. Default value is false. If compression is enabled, content will be
# served as compressed if user requests for a compressed version. Content
# won't be compressed on CDN when requested content is smaller than 1
# byte or larger than 1 MB.
attr_accessor :is_compression_enabled
# @return [Boolean] Indicates whether HTTP traffic is allowed on the
# endpoint. Default value is true. At least one protocol (HTTP or HTTPS)
# must be allowed.
attr_accessor :is_http_allowed
# @return [Boolean] Indicates whether HTTPS traffic is allowed on the
# endpoint. Default value is true. At least one protocol (HTTP or HTTPS)
# must be allowed.
attr_accessor :is_https_allowed
# @return [QueryStringCachingBehavior] Defines the query string caching
# behavior. Possible values include: 'IgnoreQueryString',
# 'BypassCaching', 'UseQueryString', 'NotSet'
attr_accessor :query_string_caching_behavior
# @return [String] Customer can specify what scenario they want this CDN
# endpoint to optimize, e.g. Download, Media services. With this
# information we can apply scenario driven optimization.
attr_accessor :optimization_type
# @return [Array<GeoFilter>] List of rules defining user geo access
# within a CDN endpoint. Each geo filter defines an acess rule to a
# specified path or content, e.g. block APAC for path /pictures/
attr_accessor :geo_filters
# @return [String] The host name of the endpoint structured as
# {endpointName}.{DNSZone}, e.g. consoto.azureedge.net
attr_accessor :host_name
# @return [Array<DeepCreatedOrigin>] The source of the content being
# delivered via CDN.
attr_accessor :origins
# @return [EndpointResourceState] Resource status of the endpoint.
# Possible values include: 'Creating', 'Deleting', 'Running', 'Starting',
# 'Stopped', 'Stopping'
attr_accessor :resource_state
# @return [String] Provisioning status of the endpoint.
attr_accessor :provisioning_state
#
# Mapper for Endpoint class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'Endpoint',
type: {
name: 'Composite',
class_name: 'Endpoint',
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: true,
serialized_name: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
origin_host_header: {
required: false,
serialized_name: 'properties.originHostHeader',
type: {
name: 'String'
}
},
origin_path: {
required: false,
serialized_name: 'properties.originPath',
type: {
name: 'String'
}
},
content_types_to_compress: {
required: false,
serialized_name: 'properties.contentTypesToCompress',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
is_compression_enabled: {
required: false,
serialized_name: 'properties.isCompressionEnabled',
type: {
name: 'Boolean'
}
},
is_http_allowed: {
required: false,
serialized_name: 'properties.isHttpAllowed',
type: {
name: 'Boolean'
}
},
is_https_allowed: {
required: false,
serialized_name: 'properties.isHttpsAllowed',
type: {
name: 'Boolean'
}
},
query_string_caching_behavior: {
required: false,
serialized_name: 'properties.queryStringCachingBehavior',
type: {
name: 'Enum',
module: 'QueryStringCachingBehavior'
}
},
optimization_type: {
required: false,
serialized_name: 'properties.optimizationType',
type: {
name: 'String'
}
},
geo_filters: {
required: false,
serialized_name: 'properties.geoFilters',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'GeoFilterElementType',
type: {
name: 'Composite',
class_name: 'GeoFilter'
}
}
}
},
host_name: {
required: false,
read_only: true,
serialized_name: 'properties.hostName',
type: {
name: 'String'
}
},
origins: {
required: true,
serialized_name: 'properties.origins',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'DeepCreatedOriginElementType',
type: {
name: 'Composite',
class_name: 'DeepCreatedOrigin'
}
}
}
},
resource_state: {
required: false,
read_only: true,
serialized_name: 'properties.resourceState',
type: {
name: 'String'
}
},
provisioning_state: {
required: false,
read_only: true,
serialized_name: 'properties.provisioningState',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,96 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Result of the request to list endpoints. It contains a list of endpoint
# objects and a URL link to get the the next set of results.
#
class EndpointListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Endpoint>] List of CDN endpoints within a profile
attr_accessor :value
# @return [String] URL to get the next set of endpoint objects if there
# are any.
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<Endpoint>] 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 [EndpointListResult] 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 EndpointListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'EndpointListResult',
type: {
name: 'Composite',
class_name: 'EndpointListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'EndpointElementType',
type: {
name: 'Composite',
class_name: 'Endpoint'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,20 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Defines values for EndpointResourceState
#
module EndpointResourceState
Creating = "Creating"
Deleting = "Deleting"
Running = "Running"
Starting = "Starting"
Stopped = "Stopped"
Stopping = "Stopping"
end
end
end

Просмотреть файл

@ -1,174 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Properties required to create a new endpoint.
#
class EndpointUpdateParameters
include MsRestAzure
include MsRest::JSONable
# @return [Hash{String => String}] Endpoint tags.
attr_accessor :tags
# @return [String] The host header CDN sends along with content requests
# to origin. The default value is the host name of the origin.
attr_accessor :origin_host_header
# @return [String] The path used when CDN sends request to origin.
attr_accessor :origin_path
# @return [Array<String>] List of content types on which compression
# applies. The value should be a valid MIME type.
attr_accessor :content_types_to_compress
# @return [Boolean] Indicates whether content compression is enabled on
# CDN. Default value is false. If compression is enabled, content will be
# served as compressed if user requests for a compressed version. Content
# won't be compressed on CDN when requested content is smaller than 1
# byte or larger than 1 MB.
attr_accessor :is_compression_enabled
# @return [Boolean] Indicates whether HTTP traffic is allowed on the
# endpoint. Default value is true. At least one protocol (HTTP or HTTPS)
# must be allowed.
attr_accessor :is_http_allowed
# @return [Boolean] Indicates whether HTTPS traffic is allowed on the
# endpoint. Default value is true. At least one protocol (HTTP or HTTPS)
# must be allowed.
attr_accessor :is_https_allowed
# @return [QueryStringCachingBehavior] Defines the query string caching
# behavior. Possible values include: 'IgnoreQueryString',
# 'BypassCaching', 'UseQueryString', 'NotSet'
attr_accessor :query_string_caching_behavior
# @return [String] Customer can specify what scenario they want this CDN
# endpoint to optimize, e.g. Download, Media services. With this
# information we can apply scenario driven optimization.
attr_accessor :optimization_type
# @return [Array<GeoFilter>] List of rules defining user geo access
# within a CDN endpoint. Each geo filter defines an acess rule to a
# specified path or content, e.g. block APAC for path /pictures/
attr_accessor :geo_filters
#
# Mapper for EndpointUpdateParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'EndpointUpdateParameters',
type: {
name: 'Composite',
class_name: 'EndpointUpdateParameters',
model_properties: {
tags: {
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
origin_host_header: {
required: false,
serialized_name: 'properties.originHostHeader',
type: {
name: 'String'
}
},
origin_path: {
required: false,
serialized_name: 'properties.originPath',
type: {
name: 'String'
}
},
content_types_to_compress: {
required: false,
serialized_name: 'properties.contentTypesToCompress',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
is_compression_enabled: {
required: false,
serialized_name: 'properties.isCompressionEnabled',
type: {
name: 'Boolean'
}
},
is_http_allowed: {
required: false,
serialized_name: 'properties.isHttpAllowed',
type: {
name: 'Boolean'
}
},
is_https_allowed: {
required: false,
serialized_name: 'properties.isHttpsAllowed',
type: {
name: 'Boolean'
}
},
query_string_caching_behavior: {
required: false,
serialized_name: 'properties.queryStringCachingBehavior',
type: {
name: 'Enum',
module: 'QueryStringCachingBehavior'
}
},
optimization_type: {
required: false,
serialized_name: 'properties.optimizationType',
type: {
name: 'String'
}
},
geo_filters: {
required: false,
serialized_name: 'properties.geoFilters',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'GeoFilterElementType',
type: {
name: 'Composite',
class_name: 'GeoFilter'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,56 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Error reponse indicates CDN service is not able to process the incoming
# request. The reason is provided in the error message.
#
class ErrorResponse
include MsRestAzure
include MsRest::JSONable
# @return [String] Error code.
attr_accessor :code
# @return [String] Error message indicating why the operation failed.
attr_accessor :message
#
# Mapper for ErrorResponse class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ErrorResponse',
type: {
name: 'Composite',
class_name: 'ErrorResponse',
model_properties: {
code: {
required: false,
serialized_name: 'code',
type: {
name: 'String'
}
},
message: {
required: false,
serialized_name: 'message',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,76 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Rules defining user geo access within a CDN endpoint.
#
class GeoFilter
include MsRestAzure
include MsRest::JSONable
# @return [String] Relative path applicable to geo filter. (e.g.
# '/mypictures', '/mypicture/kitty.jpg', and etc.)
attr_accessor :relative_path
# @return [GeoFilterActions] Action of the geo filter, i.e. allow or
# block access. Possible values include: 'Block', 'Allow'
attr_accessor :action
# @return [Array<String>] Two letter country codes defining user country
# access in a geo filter, e.g. AU, MX, US.
attr_accessor :country_codes
#
# Mapper for GeoFilter class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'GeoFilter',
type: {
name: 'Composite',
class_name: 'GeoFilter',
model_properties: {
relative_path: {
required: true,
serialized_name: 'relativePath',
type: {
name: 'String'
}
},
action: {
required: true,
serialized_name: 'action',
type: {
name: 'Enum',
module: 'GeoFilterActions'
}
},
country_codes: {
required: true,
serialized_name: 'countryCodes',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,16 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Defines values for GeoFilterActions
#
module GeoFilterActions
Block = "Block"
Allow = "Allow"
end
end
end

Просмотреть файл

@ -1,81 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# CDN Ip address group
#
class IpAddressGroup
include MsRestAzure
include MsRest::JSONable
# @return [String] The delivery region of the ip address group
attr_accessor :delivery_region
# @return [Array<CidrIpAddress>] The list of ip v4 addresses.
attr_accessor :ipv4addresses
# @return [Array<CidrIpAddress>] The list of ip v6 addresses.
attr_accessor :ipv6addresses
#
# Mapper for IpAddressGroup class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'IpAddressGroup',
type: {
name: 'Composite',
class_name: 'IpAddressGroup',
model_properties: {
delivery_region: {
required: false,
serialized_name: 'deliveryRegion',
type: {
name: 'String'
}
},
ipv4addresses: {
required: false,
serialized_name: 'ipv4Addresses',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'CidrIpAddressElementType',
type: {
name: 'Composite',
class_name: 'CidrIpAddress'
}
}
}
},
ipv6addresses: {
required: false,
serialized_name: 'ipv6Addresses',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'CidrIpAddressElementType',
type: {
name: 'Composite',
class_name: 'CidrIpAddress'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,53 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Parameters required for content load.
#
class LoadParameters
include MsRestAzure
include MsRest::JSONable
# @return [Array<String>] The path to the content to be loaded. Path
# should be a relative file URL of the origin.
attr_accessor :content_paths
#
# Mapper for LoadParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'LoadParameters',
type: {
name: 'Composite',
class_name: 'LoadParameters',
model_properties: {
content_paths: {
required: true,
serialized_name: 'contentPaths',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,56 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# CDN REST API operation
#
class Operation
include MsRestAzure
include MsRest::JSONable
# @return [String] Operation name: {provider}/{resource}/{operation}
attr_accessor :name
# @return [OperationDisplay] The object that represents the operation.
attr_accessor :display
#
# 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,
serialized_name: 'name',
type: {
name: 'String'
}
},
display: {
required: false,
serialized_name: 'display',
type: {
name: 'Composite',
class_name: 'OperationDisplay'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,66 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# The object that represents the operation.
#
class OperationDisplay
include MsRestAzure
include MsRest::JSONable
# @return [String] Service provider: Microsoft.Cdn
attr_accessor :provider
# @return [String] Resource on which the operation is performed: Profile,
# endpoint, etc.
attr_accessor :resource
# @return [String] Operation type: Read, write, delete, etc.
attr_accessor :operation
#
# 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'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,97 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Result of the request to list CDN operations. It contains a list of
# operations and a URL link to get the next set of results.
#
class OperationListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Operation>] List of CDN operations supported by the CDN
# resource provider.
attr_accessor :value
# @return [String] URL to get the next set of operation list results if
# there are any.
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>] 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 [OperationListResult] 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 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

Просмотреть файл

@ -1,147 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# CDN origin is the source of the content being delivered via CDN. When the
# edge nodes represented by an endpoint do not have the requested content
# cached, they attempt to fetch it from one or more of the configured
# origins.
#
class Origin < MsRestAzure::Resource
include MsRestAzure
include MsRest::JSONable
# @return [String] The address of the origin. Domain names, IPv4
# addresses, and IPv6 addresses are supported.
attr_accessor :host_name
# @return [Integer] The value of the HTTP port. Must be between 1 and
# 65535.
attr_accessor :http_port
# @return [Integer] The value of the https port. Must be between 1 and
# 65535.
attr_accessor :https_port
# @return [OriginResourceState] Resource status of the origin. Possible
# values include: 'Creating', 'Active', 'Deleting'
attr_accessor :resource_state
# @return [String] Provisioning status of the origin.
attr_accessor :provisioning_state
#
# Mapper for Origin class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'Origin',
type: {
name: 'Composite',
class_name: 'Origin',
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: true,
serialized_name: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
host_name: {
required: true,
serialized_name: 'properties.hostName',
type: {
name: 'String'
}
},
http_port: {
required: false,
serialized_name: 'properties.httpPort',
constraints: {
InclusiveMaximum: 65535,
InclusiveMinimum: 1
},
type: {
name: 'Number'
}
},
https_port: {
required: false,
serialized_name: 'properties.httpsPort',
constraints: {
InclusiveMaximum: 65535,
InclusiveMinimum: 1
},
type: {
name: 'Number'
}
},
resource_state: {
required: false,
read_only: true,
serialized_name: 'properties.resourceState',
type: {
name: 'String'
}
},
provisioning_state: {
required: false,
read_only: true,
serialized_name: 'properties.provisioningState',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,96 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Result of the request to list origins. It contains a list of origin
# objects and a URL link to get the next set of results.
#
class OriginListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Origin>] List of CDN origins within an endpoint
attr_accessor :value
# @return [String] URL to get the next set of origin objects if there are
# any.
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<Origin>] 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 [OriginListResult] 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 OriginListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'OriginListResult',
type: {
name: 'Composite',
class_name: 'OriginListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'OriginElementType',
type: {
name: 'Composite',
class_name: 'Origin'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,17 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Defines values for OriginResourceState
#
module OriginResourceState
Creating = "Creating"
Active = "Active"
Deleting = "Deleting"
end
end
end

Просмотреть файл

@ -1,76 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Origin properties needed for origin creation or update.
#
class OriginUpdateParameters
include MsRestAzure
include MsRest::JSONable
# @return [String] The address of the origin. Domain names, IPv4
# addresses, and IPv6 addresses are supported.
attr_accessor :host_name
# @return [Integer] The value of the HTTP port. Must be between 1 and
# 65535.
attr_accessor :http_port
# @return [Integer] The value of the HTTPS port. Must be between 1 and
# 65535.
attr_accessor :https_port
#
# Mapper for OriginUpdateParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'OriginUpdateParameters',
type: {
name: 'Composite',
class_name: 'OriginUpdateParameters',
model_properties: {
host_name: {
required: false,
serialized_name: 'properties.hostName',
type: {
name: 'String'
}
},
http_port: {
required: false,
serialized_name: 'properties.httpPort',
constraints: {
InclusiveMaximum: 65535,
InclusiveMinimum: 1
},
type: {
name: 'Number'
}
},
https_port: {
required: false,
serialized_name: 'properties.httpsPort',
constraints: {
InclusiveMaximum: 65535,
InclusiveMinimum: 1
},
type: {
name: 'Number'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,118 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# CDN profile represents the top level resource and the entry point into
# the CDN API. This allows users to set up a logical grouping of endpoints
# in addition to creating shared configuration settings and selecting
# pricing tiers and providers.
#
class Profile < MsRestAzure::Resource
include MsRestAzure
include MsRest::JSONable
# @return [Sku] The pricing tier (defines a CDN provider, feature list
# and rate) of the CDN profile.
attr_accessor :sku
# @return [ProfileResourceState] Resource status of the profile. Possible
# values include: 'Creating', 'Active', 'Deleting', 'Disabled'
attr_accessor :resource_state
# @return [String] Provisioning status of the profile.
attr_accessor :provisioning_state
#
# Mapper for Profile class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'Profile',
type: {
name: 'Composite',
class_name: 'Profile',
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: true,
serialized_name: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
sku: {
required: true,
serialized_name: 'sku',
type: {
name: 'Composite',
class_name: 'Sku'
}
},
resource_state: {
required: false,
read_only: true,
serialized_name: 'properties.resourceState',
type: {
name: 'String'
}
},
provisioning_state: {
required: false,
read_only: true,
serialized_name: 'properties.provisioningState',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,96 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Result of the request to list profiles. It contains a list of profile
# objects and a URL link to get the the next set of results.
#
class ProfileListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Profile>] List of CDN profiles within a resource group.
attr_accessor :value
# @return [String] URL to get the next set of profile objects if there
# are any.
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<Profile>] 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 [ProfileListResult] 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 ProfileListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ProfileListResult',
type: {
name: 'Composite',
class_name: 'ProfileListResult',
model_properties: {
value: {
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'ProfileElementType',
type: {
name: 'Composite',
class_name: 'Profile'
}
}
}
},
next_link: {
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,18 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Defines values for ProfileResourceState
#
module ProfileResourceState
Creating = "Creating"
Active = "Active"
Deleting = "Deleting"
Disabled = "Disabled"
end
end
end

Просмотреть файл

@ -1,52 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Properties required to update a profile.
#
class ProfileUpdateParameters
include MsRestAzure
include MsRest::JSONable
# @return [Hash{String => String}] Profile tags
attr_accessor :tags
#
# Mapper for ProfileUpdateParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ProfileUpdateParameters',
type: {
name: 'Composite',
class_name: 'ProfileUpdateParameters',
model_properties: {
tags: {
required: true,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,53 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Parameters required for content purge.
#
class PurgeParameters
include MsRestAzure
include MsRest::JSONable
# @return [Array<String>] The path to the content to be purged. Can
# describe a file path or a wild card directory.
attr_accessor :content_paths
#
# Mapper for PurgeParameters class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'PurgeParameters',
type: {
name: 'Composite',
class_name: 'PurgeParameters',
model_properties: {
content_paths: {
required: true,
serialized_name: 'contentPaths',
type: {
name: 'Sequence',
element: {
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -1,18 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Defines values for QueryStringCachingBehavior
#
module QueryStringCachingBehavior
IgnoreQueryString = "IgnoreQueryString"
BypassCaching = "BypassCaching"
UseQueryString = "UseQueryString"
NotSet = "NotSet"
end
end
end

Просмотреть файл

@ -1,15 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Defines values for ResourceType
#
module ResourceType
MicrosoftCdnProfilesEndpoints = "Microsoft.Cdn/Profiles/Endpoints"
end
end
end

Просмотреть файл

@ -1,75 +0,0 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ARM::CDN
module Models
#
# Output of check resource usage API.
#
class ResourceUsage
include MsRestAzure
include MsRest::JSONable
# @return [String] Resource type of the usages.
attr_accessor :resource_type
# @return [String] Unit of the usage. e.g. Count.
attr_accessor :unit
# @return [Integer] Actual value of the resource type.
attr_accessor :current_value
# @return [Integer] Quota of the resource type.
attr_accessor :limit
#
# Mapper for ResourceUsage class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
required: false,
serialized_name: 'ResourceUsage',
type: {
name: 'Composite',
class_name: 'ResourceUsage',
model_properties: {
resource_type: {
required: false,
serialized_name: 'resourceType',
type: {
name: 'String'
}
},
unit: {
required: false,
serialized_name: 'unit',
type: {
name: 'String'
}
},
current_value: {
required: false,
serialized_name: 'currentValue',
type: {
name: 'Number'
}
},
limit: {
required: false,
serialized_name: 'limit',
type: {
name: 'Number'
}
}
}
}
}
end
end
end
end

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше