зеркало из
1
0
Форкнуть 0

Merge pull request #1186 from veronicagg/msi-gem

Preparing release for new gem azure_mgmt_msi
This commit is contained in:
Veronica Giaudrone 2017-12-14 14:25:45 -08:00 коммит произвёл GitHub
Родитель e7bfbc5c67 741f79dc8a
Коммит 6d9093dcc4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
34 изменённых файлов: 2046 добавлений и 2 удалений

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

@ -1,3 +1,7 @@
## 2017.12.14 - Azure ARM MSI gem release version 0.15.2
* Adding new gem for azure_mgmt_msi, generated SDK using [Autorest.2.0.4215](https://www.npmjs.com/package/autorest) (core) and Autorest Ruby 3.1.26.
## 2017.12.12 - Azure ARM Storage release version 0.15.2
* Updated azure_mgmt_storage to include latest API version 2017-10-01, sdk using [Autorest.2.0.4215](https://www.npmjs.com/package/autorest) (core) and Autorest Ruby 3.1.26.

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

@ -1,5 +1,5 @@
{
"management": [
"azure_mgmt_storage"
"azure_mgmt_msi"
]
}

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

@ -36,6 +36,7 @@
"azure_mgmt_media_services": "0.15.1",
"azure_mgmt_mobile_engagement": "0.15.1",
"azure_mgmt_monitor": "0.15.1",
"azure_mgmt_msi": "0.15.2",
"azure_mgmt_network": "0.15.1",
"azure_mgmt_notification_hubs": "0.15.1",
"azure_mgmt_operational_insights": "0.15.1",

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

@ -45,6 +45,7 @@ gem 'azure_mgmt_marketplace_ordering', path: 'management/azure_mgmt_marketp
gem 'azure_mgmt_media_services', path: 'management/azure_mgmt_media_services'
gem 'azure_mgmt_mobile_engagement', path: 'management/azure_mgmt_mobile_engagement'
gem 'azure_mgmt_monitor', path: 'management/azure_mgmt_monitor'
gem 'azure_mgmt_msi', path: 'management/azure_mgmt_msi'
gem 'azure_mgmt_network', path: 'management/azure_mgmt_network'
gem 'azure_mgmt_notification_hubs', path: 'management/azure_mgmt_notification_hubs'
gem 'azure_mgmt_operational_insights', path: 'management/azure_mgmt_operational_insights'

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

@ -32,6 +32,7 @@ Additional info on Azure deployment models [https://azure.microsoft.com/en-us/do
* [Machine Learning](https://rubygems.org/gems/azure_mgmt_machine_learning) Azure Machine Learning web services management
* [Media Services](https://rubygems.org/gems/azure_mgmt_media_services) Media Services resource management APIs
* [Mobile Engagement](https://rubygems.org/gems/azure_mgmt_mobile_engagement) Azure Mobile Engagement's Apps, App Collections, Devices management APIs
* [Managed Service Identity](https://rubygems.org/gems/azure_mgmt_msi) Create, update, list user assigned identities.
* [Network](https://rubygems.org/gems/azure_mgmt_network) Load Balancers, Network Gateways, Security Groups, etc...
* [Notification Hubs](https://rubygems.org/gems/azure_mgmt_notification_hubs) Notification Hubs management
* [Policy](https://rubygems.org/gems/azure_mgmt_policy) Policy Assignment & Policy definition operations

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

@ -36,6 +36,7 @@ require 'latest/modules/marketplaceordering_profile_module'
require 'latest/modules/mediaservices_profile_module'
require 'latest/modules/mobileengagement_profile_module'
require 'latest/modules/monitor_profile_module'
require 'latest/modules/managedserviceidentity_profile_module'
require 'latest/modules/network_profile_module'
require 'latest/modules/notificationhubs_profile_module'
require 'latest/modules/operationalinsights_profile_module'
@ -68,7 +69,7 @@ module Azure::Profiles::Latest::Mgmt
class Client
include MsRestAzure::Common::Configurable
attr_reader :analysis_services, :authorization, :automation, :batch, :billing, :cdn, :cognitive_services, :commerce, :compute, :consumption, :container_instance, :container_registry, :container_service, :customer_insights, :data_lake_analytics, :data_lake_store, :dev_test_labs, :dns, :event_grid, :event_hub, :features, :graph, :iot_hub, :key_vault, :links, :locks, :logic, :machine_learning, :managed_applications, :marketplace_ordering, :media_services, :mobile_engagement, :monitor, :network, :notification_hubs, :operational_insights, :policy, :power_bi_embedded, :recovery_services, :recovery_services_backup, :recovery_services_site_recovery, :redis, :relay, :resources, :resources_management, :scheduler, :search, :server_management, :service_bus, :service_fabric, :sql, :stor_simple8000_series, :storage, :stream_analytics, :subscriptions, :traffic_manager, :web
attr_reader :analysis_services, :authorization, :automation, :batch, :billing, :cdn, :cognitive_services, :commerce, :compute, :consumption, :container_instance, :container_registry, :container_service, :customer_insights, :data_lake_analytics, :data_lake_store, :dev_test_labs, :dns, :event_grid, :event_hub, :features, :graph, :iot_hub, :key_vault, :links, :locks, :logic, :machine_learning, :managed_applications, :marketplace_ordering, :media_services, :mobile_engagement, :monitor, :managed_service_identity, :network, :notification_hubs, :operational_insights, :policy, :power_bi_embedded, :recovery_services, :recovery_services_backup, :recovery_services_site_recovery, :redis, :relay, :resources, :resources_management, :scheduler, :search, :server_management, :service_bus, :service_fabric, :sql, :stor_simple8000_series, :storage, :stream_analytics, :subscriptions, :traffic_manager, :web
def initialize(options = {})
if options.is_a?(Hash) && options.length == 0
@ -112,6 +113,7 @@ module Azure::Profiles::Latest::Mgmt
@media_services = Azure::Profiles::Latest::MediaServices::Mgmt::MediaServicesClass.new(self)
@mobile_engagement = Azure::Profiles::Latest::MobileEngagement::Mgmt::MobileEngagementClass.new(self)
@monitor = Azure::Profiles::Latest::Monitor::Mgmt::MonitorClass.new(self)
@managed_service_identity = Azure::Profiles::Latest::ManagedServiceIdentity::Mgmt::ManagedServiceIdentityClass.new(self)
@network = Azure::Profiles::Latest::Network::Mgmt::NetworkClass.new(self)
@notification_hubs = Azure::Profiles::Latest::NotificationHubs::Mgmt::NotificationHubsClass.new(self)
@operational_insights = Azure::Profiles::Latest::OperationalInsights::Mgmt::OperationalInsightsClass.new(self)

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

@ -72,6 +72,8 @@ module Azure::Profiles::Latest::MobileEngagement end
module Azure::Profiles::Latest::MobileEngagement::Mgmt end
module Azure::Profiles::Latest::Monitor end
module Azure::Profiles::Latest::Monitor::Mgmt end
module Azure::Profiles::Latest::ManagedServiceIdentity end
module Azure::Profiles::Latest::ManagedServiceIdentity::Mgmt end
module Azure::Profiles::Latest::Network end
module Azure::Profiles::Latest::Network::Mgmt end
module Azure::Profiles::Latest::NotificationHubs end

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

@ -0,0 +1,62 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'azure_mgmt_msi'
module Azure::Profiles::Latest
module ManagedServiceIdentity::Mgmt
Operations = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Operations
UserAssignedIdentities = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::UserAssignedIdentities
module Models
Identity = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity
OperationDisplay = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationDisplay
Operation = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Operation
UserAssignedIdentitiesListResult = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult
OperationListResult = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationListResult
UserAssignedIdentities = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentities
end
#
# ManagedServiceIdentity
#
class ManagedServiceIdentityClass
attr_reader :operations, :user_assigned_identities, :configurable, :base_url, :options, :model_classes
def initialize(configurable, base_url=nil, options=nil)
@configurable, @base_url, @options = configurable, base_url, options
client_0 = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::ManagedServiceIdentityClient.new(configurable.credentials, base_url, options)
if(client_0.respond_to?(:subscription_id))
client_0.subscription_id = configurable.subscription_id
end
@operations = client_0.operations
@user_assigned_identities = client_0.user_assigned_identities
@model_classes = ModelClasses.new
end
class ModelClasses
def identity
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity
end
def operation_display
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationDisplay
end
def operation
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Operation
end
def user_assigned_identities_list_result
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult
end
def operation_list_result
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationListResult
end
def user_assigned_identities
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentities
end
end
end
end
end

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

@ -388,6 +388,13 @@
"namespace": "Azure::Monitor::Mgmt::V2015_04_01"
}
},
"azure_mgmt_msi": {
"azure_mgmt_msi_2015_08_31_preview": {
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/13291dd9244584a66de3c53cc1a85998efd288b3/specification/msi/resource-manager/readme.md",
"namespace": "Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview",
"tag": "package-2015-08-31-preview"
}
},
"azure_mgmt_network": {
"azure_mgmt_network_2017_09_01": {
"input-file": [

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

@ -169,6 +169,11 @@
"namespace": "Azure::Monitor::Mgmt",
"module_require": "azure_mgmt_monitor"
},
"Microsoft.ManagedServiceIdentity": {
"path": "management/azure_mgmt_msi",
"namespace": "Azure::ManagedServiceIdentity::Mgmt",
"module_require": "azure_mgmt_msi"
},
"Microsoft.Network": {
"path": "management/azure_mgmt_network",
"namespace": "Azure::Network::Mgmt",

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

@ -0,0 +1,3 @@
--require spec_helper
--color
--format documentation

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

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

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

@ -0,0 +1,5 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require "bundler/gem_tasks"

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

@ -0,0 +1,42 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require '../azure_mgmt_msi/lib/module_definition'
require '../azure_mgmt_msi/lib/version'
Gem::Specification.new do |spec|
spec.name = 'azure_mgmt_msi'
spec.version = Azure::ManagedServiceIdentity::Mgmt::VERSION
spec.authors = 'Microsoft Corporation'
spec.email = 'azrubyteam@microsoft.com'
spec.description = 'Microsoft Azure Managed Service Identity Library for Ruby'
spec.summary = 'Official Ruby client library to consume Microsoft Azure Managed Service Identity services.'
spec.homepage = 'https://aka.ms/azure-sdk-for-ruby'
spec.license = 'MIT'
spec.metadata = {
'bug_tracker_uri' => 'https://github.com/Azure/azure-sdk-for-ruby/issues',
'changelog_uri' => 'https://github.com/Azure/azure-sdk-for-ruby/blob/master/ChangeLog.md',
'documentation_uri' => 'https://azure.microsoft.com/en-us/develop/ruby/',
'homepage_uri' => 'https://aka.ms/azure-sdk-for-ruby',
'source_code_uri' => 'https://github.com/Azure/azure-sdk-for-ruby/tree/master/management/azure_mgmt_msi'
}
spec.files = Dir["LICENSE.txt", "lib/**/*"]
spec.files.reject! { |fn| fn.include? "build.json" }
spec.bindir = 'bin'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 2.0.0'
spec.add_development_dependency 'bundler', '~> 1.9'
spec.add_development_dependency 'rake', '~> 10'
spec.add_development_dependency 'rspec', '~> 3'
spec.add_development_dependency 'dotenv', '~> 2'
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.10.0'
end

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

@ -0,0 +1,35 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
require 'uri'
require 'cgi'
require 'date'
require 'json'
require 'base64'
require 'erb'
require 'securerandom'
require 'time'
require 'timeliness'
require 'faraday'
require 'faraday-cookie_jar'
require 'concurrent'
require 'ms_rest'
require '2015-08-31-preview/generated/azure_mgmt_msi/module_definition'
require 'ms_rest_azure'
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
autoload :Operations, '2015-08-31-preview/generated/azure_mgmt_msi/operations.rb'
autoload :UserAssignedIdentities, '2015-08-31-preview/generated/azure_mgmt_msi/user_assigned_identities.rb'
autoload :ManagedServiceIdentityClient, '2015-08-31-preview/generated/azure_mgmt_msi/managed_service_identity_client.rb'
module Models
autoload :Identity, '2015-08-31-preview/generated/azure_mgmt_msi/models/identity.rb'
autoload :OperationDisplay, '2015-08-31-preview/generated/azure_mgmt_msi/models/operation_display.rb'
autoload :Operation, '2015-08-31-preview/generated/azure_mgmt_msi/models/operation.rb'
autoload :UserAssignedIdentitiesListResult, '2015-08-31-preview/generated/azure_mgmt_msi/models/user_assigned_identities_list_result.rb'
autoload :OperationListResult, '2015-08-31-preview/generated/azure_mgmt_msi/models/operation_list_result.rb'
autoload :UserAssignedIdentities, '2015-08-31-preview/generated/azure_mgmt_msi/models/user_assigned_identities.rb'
end
end

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

@ -0,0 +1,132 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
#
# A service client - single point of access to the REST API.
#
class ManagedServiceIdentityClient < 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 Subscription to which the identity
# belongs.
attr_accessor :subscription_id
# @return [String] Version of API to invoke.
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 [Operations] operations
attr_reader :operations
# @return [UserAssignedIdentities] user_assigned_identities
attr_reader :user_assigned_identities
#
# Creates initializes a new instance of the ManagedServiceIdentityClient 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
@operations = Operations.new(self)
@user_assigned_identities = UserAssignedIdentities.new(self)
@api_version = '2015-08-31-preview'
@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_msi'
sdk_information = "#{sdk_information}/0.15.2"
add_user_agent_information(sdk_information)
end
end
end

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

@ -0,0 +1,154 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
module Models
#
# Describes an identity resource.
#
class Identity
include MsRestAzure
# @return [String] The id of the created identity.
attr_accessor :id
# @return [String] The name of the created identity.
attr_accessor :name
# @return [String] The Azure region where the identity lives.
attr_accessor :location
# @return [Hash{String => String}] Resource tags
attr_accessor :tags
# @return The id of the tenant which the identity belongs to.
attr_accessor :tenant_id
# @return The id of the service principal object associated with the
# created identity.
attr_accessor :principal_id
# @return The id of the app associated with the identity. This is a
# random generated UUID by MSI.
attr_accessor :client_id
# @return [String] The ManagedServiceIdentity DataPlane URL that can be
# queried to obtain the identity credentials.
attr_accessor :client_secret_url
# @return [UserAssignedIdentities] The type of resource i.e.
# Microsoft.ManagedIdentity/userAssignedIdentities. Possible values
# include: 'Microsoft.ManagedIdentity/userAssignedIdentities'
attr_accessor :type
#
# Mapper for Identity class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'Identity',
type: {
name: 'Composite',
class_name: 'Identity',
model_properties: {
id: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'id',
type: {
name: 'String'
}
},
name: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'name',
type: {
name: 'String'
}
},
location: {
client_side_validation: true,
required: false,
serialized_name: 'location',
type: {
name: 'String'
}
},
tags: {
client_side_validation: true,
required: false,
serialized_name: 'tags',
type: {
name: 'Dictionary',
value: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
tenant_id: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'properties.tenantId',
type: {
name: 'String'
}
},
principal_id: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'properties.principalId',
type: {
name: 'String'
}
},
client_id: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'properties.clientId',
type: {
name: 'String'
}
},
client_secret_url: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'properties.clientSecretUrl',
type: {
name: 'String'
}
},
type: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

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

@ -0,0 +1,62 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
module Models
#
# Microsoft.ManagedIdentity Operation.
# Operation supported by the Microsoft.ManagedIdentity REST API.
#
class Operation
include MsRestAzure
# @return [String] Operation Name. The name of the REST Operation. This
# is of the format {provider}/{resource}/{operation}.
attr_accessor :name
# @return [OperationDisplay] Operation Display. The object that describes
# the operation.
attr_accessor :display
#
# Mapper for Operation class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'Operation',
type: {
name: 'Composite',
class_name: 'Operation',
model_properties: {
name: {
client_side_validation: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
display: {
client_side_validation: true,
required: false,
serialized_name: 'display',
type: {
name: 'Composite',
class_name: 'OperationDisplay'
}
}
}
}
}
end
end
end
end

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

@ -0,0 +1,84 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
module Models
#
# Operation Display.
# The object that describes the operation.
#
class OperationDisplay
include MsRestAzure
# @return [String] Resource Provider Name. Friendly name of the resource
# provider.
attr_accessor :provider
# @return [String] Operation Type. The type of operation. For example:
# read, write, delete.
attr_accessor :operation
# @return [String] Resource Type. The resource type on which the
# operation is performed.
attr_accessor :resource
# @return [String] Operation description. A description of the operation.
attr_accessor :description
#
# Mapper for OperationDisplay class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'OperationDisplay',
type: {
name: 'Composite',
class_name: 'OperationDisplay',
model_properties: {
provider: {
client_side_validation: true,
required: false,
serialized_name: 'provider',
type: {
name: 'String'
}
},
operation: {
client_side_validation: true,
required: false,
serialized_name: 'operation',
type: {
name: 'String'
}
},
resource: {
client_side_validation: true,
required: false,
serialized_name: 'resource',
type: {
name: 'String'
}
},
description: {
client_side_validation: true,
required: false,
serialized_name: 'description',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

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

@ -0,0 +1,100 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
module Models
#
# A list of operations supported by Microsoft.ManagedIdentity Resource
# Provider.
#
class OperationListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Operation>] A list of operations supported by
# Microsoft.ManagedIdentity Resource Provider.
attr_accessor :value
# @return [String] The url to get the next page of results, if 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()
{
client_side_validation: true,
required: false,
serialized_name: 'OperationListResult',
type: {
name: 'Composite',
class_name: 'OperationListResult',
model_properties: {
value: {
client_side_validation: true,
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'OperationElementType',
type: {
name: 'Composite',
class_name: 'Operation'
}
}
}
},
next_link: {
client_side_validation: true,
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

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

@ -0,0 +1,15 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
module Models
#
# Defines values for UserAssignedIdentities
#
module UserAssignedIdentities
MicrosoftManagedIdentityuserAssignedIdentities = "Microsoft.ManagedIdentity/userAssignedIdentities"
end
end
end

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

@ -0,0 +1,99 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
module Models
#
# Values returned by the List operation.
#
class UserAssignedIdentitiesListResult
include MsRestAzure
include MsRest::JSONable
# @return [Array<Identity>] The collection of userAssignedIdentities
# returned by the listing operation.
attr_accessor :value
# @return [String] The url to get the next page of results, if 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<Identity>] 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 [UserAssignedIdentitiesListResult] 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 UserAssignedIdentitiesListResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UserAssignedIdentitiesListResult',
type: {
name: 'Composite',
class_name: 'UserAssignedIdentitiesListResult',
model_properties: {
value: {
client_side_validation: true,
required: false,
serialized_name: 'value',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'IdentityElementType',
type: {
name: 'Composite',
class_name: 'Identity'
}
}
}
},
next_link: {
client_side_validation: true,
required: false,
serialized_name: 'nextLink',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

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

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

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

@ -0,0 +1,213 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
#
# The Managed Service Identity Client.
#
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 [ManagedServiceIdentityClient] reference to the ManagedServiceIdentityClient
attr_reader :client
#
# Lists available operations for the Microsoft.ManagedIdentity 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.ManagedIdentity 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.ManagedIdentity 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.ManagedIdentity/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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationListResult.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Lists available operations for the Microsoft.ManagedIdentity 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.ManagedIdentity 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.ManagedIdentity 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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationListResult.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Lists available operations for the Microsoft.ManagedIdentity 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

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

@ -0,0 +1,832 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview
#
# The Managed Service Identity Client.
#
class UserAssignedIdentities
include MsRestAzure
#
# Creates and initializes a new instance of the UserAssignedIdentities class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [ManagedServiceIdentityClient] reference to the ManagedServiceIdentityClient
attr_reader :client
#
# Lists all the userAssignedIdentities available under the specified
# subscription.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<Identity>] operation results.
#
def list_by_subscription(custom_headers = nil)
first_page = list_by_subscription_as_lazy(custom_headers)
first_page.get_all_items
end
#
# Lists all the userAssignedIdentities available under the specified
# 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_by_subscription_with_http_info(custom_headers = nil)
list_by_subscription_async(custom_headers).value!
end
#
# Lists all the userAssignedIdentities available under the specified
# 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_by_subscription_async(custom_headers = nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ManagedIdentity/userAssignedIdentities'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult.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 userAssignedIdentities available under the specified
# ResourceGroup.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Array<Identity>] operation results.
#
def list_by_resource_group(resource_group_name, custom_headers = nil)
first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
first_page.get_all_items
end
#
# Lists all the userAssignedIdentities available under the specified
# ResourceGroup.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
list_by_resource_group_async(resource_group_name, custom_headers).value!
end
#
# Lists all the userAssignedIdentities available under the specified
# ResourceGroup.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_resource_group_async(resource_group_name, custom_headers = nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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.ManagedIdentity/userAssignedIdentities'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Create or update an identity in the specified subscription and resource
# group.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @param parameters [Identity] Parameters to create or update the identity
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Identity] operation results.
#
def create_or_update(resource_group_name, resource_name, parameters, custom_headers = nil)
response = create_or_update_async(resource_group_name, resource_name, parameters, custom_headers).value!
response.body unless response.nil?
end
#
# Create or update an identity in the specified subscription and resource
# group.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @param parameters [Identity] Parameters to create or update the identity
# @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(resource_group_name, resource_name, parameters, custom_headers = nil)
create_or_update_async(resource_group_name, resource_name, parameters, custom_headers).value!
end
#
# Create or update an identity in the specified subscription and resource
# group.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @param parameters [Identity] Parameters to create or update the identity
# @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(resource_group_name, resource_name, parameters, custom_headers = nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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, 'parameters is nil' if parameters.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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.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.ManagedIdentity/userAssignedIdentities/{resourceName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
query_params: {'api-version' => @client.api_version},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:put, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200 || status_code == 201
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.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
#
# Update an identity in the specified subscription and resource group.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @param parameters [Identity] Parameters to update the identity
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Identity] operation results.
#
def update(resource_group_name, resource_name, parameters, custom_headers = nil)
response = update_async(resource_group_name, resource_name, parameters, custom_headers).value!
response.body unless response.nil?
end
#
# Update an identity in the specified subscription and resource group.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @param parameters [Identity] Parameters to update the identity
# @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, resource_name, parameters, custom_headers = nil)
update_async(resource_group_name, resource_name, parameters, custom_headers).value!
end
#
# Update an identity in the specified subscription and resource group.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @param parameters [Identity] Parameters to update the identity
# @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, resource_name, parameters, custom_headers = nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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, 'parameters is nil' if parameters.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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.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.ManagedIdentity/userAssignedIdentities/{resourceName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
query_params: {'api-version' => @client.api_version},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:patch, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.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 the identity.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Identity] operation results.
#
def get(resource_group_name, resource_name, custom_headers = nil)
response = get_async(resource_group_name, resource_name, custom_headers).value!
response.body unless response.nil?
end
#
# Gets the identity.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @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, resource_name, custom_headers = nil)
get_async(resource_group_name, resource_name, custom_headers).value!
end
#
# Gets the identity.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @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, resource_name, custom_headers = nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'resource_name is nil' if resource_name.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.ManagedIdentity/userAssignedIdentities/{resourceName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity.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 the identity.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def delete(resource_group_name, resource_name, custom_headers = nil)
response = delete_async(resource_group_name, resource_name, custom_headers).value!
nil
end
#
# Deletes the identity.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @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, resource_name, custom_headers = nil)
delete_async(resource_group_name, resource_name, custom_headers).value!
end
#
# Deletes the identity.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param resource_name [String] The name of the identity resource.
# @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, resource_name, custom_headers = nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
fail ArgumentError, 'resource_name is nil' if resource_name.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.ManagedIdentity/userAssignedIdentities/{resourceName}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:delete, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200 || status_code == 204
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result
end
promise.execute
end
#
# Lists all the userAssignedIdentities available under the specified
# 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 [UserAssignedIdentitiesListResult] operation results.
#
def list_by_subscription_next(next_page_link, custom_headers = nil)
response = list_by_subscription_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Lists all the userAssignedIdentities available under the specified
# 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_by_subscription_next_with_http_info(next_page_link, custom_headers = nil)
list_by_subscription_next_async(next_page_link, custom_headers).value!
end
#
# Lists all the userAssignedIdentities available under the specified
# 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_by_subscription_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::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult.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 userAssignedIdentities available under the specified
# ResourceGroup.
#
# @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 [UserAssignedIdentitiesListResult] operation results.
#
def list_by_resource_group_next(next_page_link, custom_headers = nil)
response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
response.body unless response.nil?
end
#
# Lists all the userAssignedIdentities available under the specified
# ResourceGroup.
#
# @param next_page_link [String] The NextLink from the previous successful call
# to List operation.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
list_by_resource_group_next_async(next_page_link, custom_headers).value!
end
#
# Lists all the userAssignedIdentities available under the specified
# ResourceGroup.
#
# @param next_page_link [String] The NextLink from the previous successful call
# to List operation.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
request_headers = {}
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = '{nextLink}'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
skip_encoding_path_params: {'nextLink' => next_page_link},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult.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 userAssignedIdentities available under the specified
# subscription.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [UserAssignedIdentitiesListResult] which provide lazy access to pages
# of the response.
#
def list_by_subscription_as_lazy(custom_headers = nil)
response = list_by_subscription_async(custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_subscription_next_async(next_page_link, custom_headers)
end
page
end
end
#
# Lists all the userAssignedIdentities available under the specified
# ResourceGroup.
#
# @param resource_group_name [String] The name of the Resource Group to which
# the identity belongs.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [UserAssignedIdentitiesListResult] which provide lazy access to pages
# of the response.
#
def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
response = list_by_resource_group_async(resource_group_name, custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_resource_group_next_async(next_page_link, custom_headers)
end
page
end
end
end
end

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

@ -0,0 +1,6 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require '2015-08-31-preview/generated/azure_mgmt_msi'
require 'profiles/latest/managedserviceidentity_latest_profile_client'

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

@ -0,0 +1,9 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
module Azure end
module Azure::ManagedServiceIdentity end
module Azure::ManagedServiceIdentity::Mgmt end

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

@ -0,0 +1,21 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'profiles/latest/managedserviceidentity_module_definition'
require 'profiles/latest/modules/managedserviceidentity_profile_module'
module Azure::ManagedServiceIdentity::Profiles::Latest::Mgmt
#
# Client class for the Latest profile SDK.
#
class Client < ManagedServiceIdentityClass
include MsRestAzure::Common::Configurable
def initialize(options = {})
super(options)
end
end
end

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

@ -0,0 +1,9 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
module Azure end
module Azure::ManagedServiceIdentity end
module Azure::ManagedServiceIdentity::Profiles end
module Azure::ManagedServiceIdentity::Profiles::Latest end
module Azure::ManagedServiceIdentity::Profiles::Latest::Mgmt end

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

@ -0,0 +1,68 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'azure_mgmt_msi'
module Azure::ManagedServiceIdentity::Profiles::Latest::Mgmt
Operations = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Operations
UserAssignedIdentities = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::UserAssignedIdentities
module Models
Identity = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity
OperationDisplay = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationDisplay
Operation = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Operation
UserAssignedIdentitiesListResult = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult
OperationListResult = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationListResult
UserAssignedIdentities = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentities
end
#
# ManagedServiceIdentity
#
class ManagedServiceIdentityClass
attr_reader :operations, :user_assigned_identities, :configurable, :base_url, :options, :model_classes
def initialize(options = {})
if options.is_a?(Hash) && options.length == 0
@options = setup_default_options
else
@options = options
end
reset!(options)
@configurable, @base_url, @options = self, nil, nil
client_0 = Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::ManagedServiceIdentityClient.new(configurable.credentials, base_url, options)
if(client_0.respond_to?(:subscription_id))
client_0.subscription_id = configurable.subscription_id
end
@operations = client_0.operations
@user_assigned_identities = client_0.user_assigned_identities
@model_classes = ModelClasses.new
end
class ModelClasses
def identity
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Identity
end
def operation_display
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationDisplay
end
def operation
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::Operation
end
def user_assigned_identities_list_result
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentitiesListResult
end
def operation_list_result
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::OperationListResult
end
def user_assigned_identities
Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview::Models::UserAssignedIdentities
end
end
end
end

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

@ -0,0 +1,7 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
module Azure::ManagedServiceIdentity::Mgmt
VERSION = '0.15.2'
end

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

@ -0,0 +1,6 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'dotenv'
Dotenv.load(File.join(File.dirname(__FILE__), '../../../.env'))

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

@ -139,6 +139,9 @@
"2017-04-01": ["*"],
"2017-05-01-preview": ["*"]
},
"Microsoft.ManagedServiceIdentity": {
"2015-08-31-preview": ["*"]
},
"Microsoft.Network": {
"2017-09-01": ["*"]
},
@ -668,6 +671,18 @@
"individual_gem_profile": true
}
],
"azure_mgmt_msi": [
{
"name": "Latest",
"resourceTypes": {
"Microsoft.ManagedServiceIdentity" : {
"2015-08-31-preview": ["*"]
}
},
"output_dir": "management/azure_mgmt_msi/lib/profiles",
"individual_gem_profile": true
}
],
"azure_mgmt_network": [
{
"name": "V2017_03_09",

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

@ -728,6 +728,18 @@
"generated_relative_base_directory": "2015-04-01",
"build_dir": "management/azure_mgmt_monitor/lib/2015-04-01"
},
"azure_mgmt_msi_2015_08_31_preview": {
"markdown": "specification/msi/resource-manager/readme.md",
"autorest_options": {
"namespace": "Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview",
"package-version": "0.15.2",
"package-name": "azure_mgmt_msi",
"tag": "package-2015-08-31-preview"
},
"output_dir": "management/azure_mgmt_msi/lib/2015-08-31-preview",
"generated_relative_base_directory": "2015-08-31-preview",
"build_dir": "management/azure_mgmt_msi/lib/2015-08-31-preview"
},
"azure_mgmt_network_2017_09_01": {
"autorest_options": {
"namespace": "Azure::Network::Mgmt::V2017_09_01",