Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Container registry release #1007

Merged
merged 3 commits into from Sep 28, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -19,6 +19,7 @@ gem 'azure_mgmt_cdn', path: 'management/azure_mgmt_cdn'
gem 'azure_mgmt_cognitive_services', path: 'management/azure_mgmt_cognitive_services'
gem 'azure_mgmt_commerce', path: 'management/azure_mgmt_commerce'
gem 'azure_mgmt_compute', path: 'management/azure_mgmt_compute'
gem 'azure_mgmt_container_registry', path: 'management/azure_mgmt_container_registry'
gem 'azure_mgmt_datalake_analytics', path: 'management/azure_mgmt_datalake_analytics'
gem 'azure_mgmt_datalake_store', path: 'management/azure_mgmt_datalake_store'
gem 'azure_mgmt_devtestlabs', path: 'management/azure_mgmt_devtestlabs'
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -14,6 +14,7 @@ Additional info on Azure deployment models [https://azure.microsoft.com/en-us/do
* [Cognitive Services](https://rubygems.org/gems/azure_mgmt_cognitive_services) Azure Cognitive Services Account management
* [Commerce](https://rubygems.org/gems/azure_mgmt_commerce) Azure Commerce Usage aggregates & Rate card management
* [Compute](https://rubygems.org/gems/azure_mgmt_compute) Virtual Machines, Images, Extensions, Availability Sets, etc...
* [Container Registry](https://rubygems.org/gems/azure_mgmt_container_registry) Registries, Credentials, Replications, etc...
* [Datalake Analytics](https://rubygems.org/gems/azure_mgmt_datalake_analytics) Azure Datalake Analytics Account, Catalog and Job management
* [Datalake Store](https://rubygems.org/gems/azure_mgmt_datalake_store) Azure Datalake Store Account and FileSystem management
* [DevTest Labs](https://rubygems.org/gems/azure_mgmt_devtestlabs) Azure DevTest Labs LabOperations, ArtifactSourceOperations, ArtifactOperations, CostOperations etc...
Expand Down
5 changes: 5 additions & 0 deletions Rakefile
Expand Up @@ -169,6 +169,11 @@ REGEN_METADATA = {
ns: 'Azure::ARM::Compute',
version: version
},
azure_mgmt_container_registry: {
spec_uri: 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/current/specification/containerregistry/resource-manager/readme.md',
ns: 'Azure::ARM::ContainerRegistry',
version: version
},
azure_mgmt_datalake_analytics: {
spec_uri: 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/current/specification/datalake-analytics/resource-manager/readme.md',
ns: 'Azure::ARM::DataLakeAnalytics',
Expand Down
1 change: 1 addition & 0 deletions azure_sdk/azure_sdk.gemspec
Expand Up @@ -37,6 +37,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'azure_mgmt_cognitive_services', "~>#{version}"
spec.add_runtime_dependency 'azure_mgmt_commerce', "~>#{version}"
spec.add_runtime_dependency 'azure_mgmt_compute', "~>#{version}"
spec.add_runtime_dependency 'azure_mgmt_container_registry', "~>#{version}"
spec.add_runtime_dependency 'azure_mgmt_datalake_analytics', "~>#{version}"
spec.add_runtime_dependency 'azure_mgmt_datalake_store', "~>#{version}"
spec.add_runtime_dependency 'azure_mgmt_devtestlabs', "~>#{version}"
Expand Down
2 changes: 2 additions & 0 deletions azure_sdk/lib/azure_sdk/client.rb
Expand Up @@ -8,6 +8,7 @@
require 'azure_mgmt_cognitive_services'
require 'azure_mgmt_commerce'
require 'azure_mgmt_compute'
require 'azure_mgmt_container_registry'
require 'azure_mgmt_datalake_analytics'
require 'azure_mgmt_datalake_store'
require 'azure_mgmt_devtestlabs'
Expand Down Expand Up @@ -53,6 +54,7 @@ class Client
:cognitive_services => 'Azure::ARM::CognitiveServices::CognitiveServicesManagementClient',
:commerce => 'Azure::ARM::Commerce::UsageManagementClient',
:compute => 'Azure::ARM::Compute::ComputeManagementClient',
:container_registry => 'Azure::ARM::ContainerRegistry::ContainerRegistry::ContainerRegistryManagementClient',
:datalake_analytics => 'Azure::ARM::DataLakeAnalytics::DataLakeAnalyticsAccountManagementClient',
:datalake_store => 'Azure::ARM::DataLakeStore::DataLakeStoreAccountManagementClient',
:devtestlabs => 'Azure::ARM::DevTestLabs::DevTestLabsClient',
Expand Down
3 changes: 3 additions & 0 deletions management/azure_mgmt_container_registry/.rspec
@@ -0,0 +1,3 @@
--require spec_helper
--color
--format documentation
21 changes: 21 additions & 0 deletions management/azure_mgmt_container_registry/LICENSE.txt
@@ -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.
5 changes: 5 additions & 0 deletions management/azure_mgmt_container_registry/Rakefile
@@ -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,34 @@
# 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 'generated/azure_mgmt_container_registry/module_definition'
require 'generated/azure_mgmt_container_registry/version'

Gem::Specification.new do |spec|
spec.name = 'azure_mgmt_container_registry'
spec.version = Azure::ARM::ContainerRegistry::VERSION
spec.authors = 'Microsoft Corporation'
spec.email = 'azrubyteam@microsoft.com'
spec.description = 'Microsoft Azure Container Registry Management Client Library for Ruby'
spec.summary = 'Official Ruby client library to consume Microsoft Azure Container Registry Management services.'
spec.homepage = 'https://aka.ms/azure-sdk-for-ruby'
spec.license = 'MIT'

spec.files = Dir["LICENSE.txt", "lib/**/*"]
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.9.0'
end
@@ -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 'generated/azure_mgmt_container_registry'
@@ -0,0 +1,72 @@
# 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 'generated/azure_mgmt_container_registry/module_definition'
require 'ms_rest_azure'

module Azure::ARM::ContainerRegistry
autoload :Registries, 'generated/azure_mgmt_container_registry/registries.rb'
autoload :Operations, 'generated/azure_mgmt_container_registry/operations.rb'
autoload :Replications, 'generated/azure_mgmt_container_registry/replications.rb'
autoload :Webhooks, 'generated/azure_mgmt_container_registry/webhooks.rb'
autoload :ContainerRegistryManagementClient, 'generated/azure_mgmt_container_registry/container_registry_management_client.rb'

module Models
autoload :ReplicationUpdateParameters, 'generated/azure_mgmt_container_registry/models/replication_update_parameters.rb'
autoload :ReplicationListResult, 'generated/azure_mgmt_container_registry/models/replication_list_result.rb'
autoload :RegistryNameStatus, 'generated/azure_mgmt_container_registry/models/registry_name_status.rb'
autoload :OperationDisplayDefinition, 'generated/azure_mgmt_container_registry/models/operation_display_definition.rb'
autoload :OperationDefinition, 'generated/azure_mgmt_container_registry/models/operation_definition.rb'
autoload :Sku, 'generated/azure_mgmt_container_registry/models/sku.rb'
autoload :WebhookCreateParameters, 'generated/azure_mgmt_container_registry/models/webhook_create_parameters.rb'
autoload :StorageAccountProperties, 'generated/azure_mgmt_container_registry/models/storage_account_properties.rb'
autoload :WebhookUpdateParameters, 'generated/azure_mgmt_container_registry/models/webhook_update_parameters.rb'
autoload :RegistryUpdateParameters, 'generated/azure_mgmt_container_registry/models/registry_update_parameters.rb'
autoload :WebhookListResult, 'generated/azure_mgmt_container_registry/models/webhook_list_result.rb'
autoload :RegistryPassword, 'generated/azure_mgmt_container_registry/models/registry_password.rb'
autoload :EventInfo, 'generated/azure_mgmt_container_registry/models/event_info.rb'
autoload :RegenerateCredentialParameters, 'generated/azure_mgmt_container_registry/models/regenerate_credential_parameters.rb'
autoload :CallbackConfig, 'generated/azure_mgmt_container_registry/models/callback_config.rb'
autoload :RegistryUsageListResult, 'generated/azure_mgmt_container_registry/models/registry_usage_list_result.rb'
autoload :Target, 'generated/azure_mgmt_container_registry/models/target.rb'
autoload :RegistryNameCheckRequest, 'generated/azure_mgmt_container_registry/models/registry_name_check_request.rb'
autoload :Request, 'generated/azure_mgmt_container_registry/models/request.rb'
autoload :Status, 'generated/azure_mgmt_container_registry/models/status.rb'
autoload :Actor, 'generated/azure_mgmt_container_registry/models/actor.rb'
autoload :RegistryListResult, 'generated/azure_mgmt_container_registry/models/registry_list_result.rb'
autoload :Source, 'generated/azure_mgmt_container_registry/models/source.rb'
autoload :RegistryUsage, 'generated/azure_mgmt_container_registry/models/registry_usage.rb'
autoload :EventContent, 'generated/azure_mgmt_container_registry/models/event_content.rb'
autoload :OperationListResult, 'generated/azure_mgmt_container_registry/models/operation_list_result.rb'
autoload :EventRequestMessage, 'generated/azure_mgmt_container_registry/models/event_request_message.rb'
autoload :RegistryListCredentialsResult, 'generated/azure_mgmt_container_registry/models/registry_list_credentials_result.rb'
autoload :EventResponseMessage, 'generated/azure_mgmt_container_registry/models/event_response_message.rb'
autoload :EventListResult, 'generated/azure_mgmt_container_registry/models/event_list_result.rb'
autoload :Registry, 'generated/azure_mgmt_container_registry/models/registry.rb'
autoload :Replication, 'generated/azure_mgmt_container_registry/models/replication.rb'
autoload :Webhook, 'generated/azure_mgmt_container_registry/models/webhook.rb'
autoload :Event, 'generated/azure_mgmt_container_registry/models/event.rb'
autoload :SkuName, 'generated/azure_mgmt_container_registry/models/sku_name.rb'
autoload :SkuTier, 'generated/azure_mgmt_container_registry/models/sku_tier.rb'
autoload :ProvisioningState, 'generated/azure_mgmt_container_registry/models/provisioning_state.rb'
autoload :PasswordName, 'generated/azure_mgmt_container_registry/models/password_name.rb'
autoload :RegistryUsageUnit, 'generated/azure_mgmt_container_registry/models/registry_usage_unit.rb'
autoload :WebhookStatus, 'generated/azure_mgmt_container_registry/models/webhook_status.rb'
autoload :WebhookAction, 'generated/azure_mgmt_container_registry/models/webhook_action.rb'
end
end
@@ -0,0 +1,141 @@
# 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::ARM::ContainerRegistry
#
# A service client - single point of access to the REST API.
#
class ContainerRegistryManagementClient < 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 Microsoft Azure subscription ID.
attr_accessor :subscription_id

# @return [String] The client API version.
attr_reader :api_version

# @return [String] Gets or sets the preferred language for the response.
attr_accessor :accept_language

# @return [Integer] Gets or sets the retry timeout in seconds for Long
# Running Operations. Default value is 30.
attr_accessor :long_running_operation_retry_timeout

# @return [Boolean] When set to true a unique x-ms-client-request-id value
# is generated and included in each request. Default is true.
attr_accessor :generate_client_request_id

# @return [Registries] registries
attr_reader :registries

# @return [Operations] operations
attr_reader :operations

# @return [Replications] replications
attr_reader :replications

# @return [Webhooks] webhooks
attr_reader :webhooks

#
# Creates initializes a new instance of the ContainerRegistryManagementClient 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

@registries = Registries.new(self)
@operations = Operations.new(self)
@replications = Replications.new(self)
@webhooks = Webhooks.new(self)
@api_version = '2017-10-01'
@accept_language = 'en-US'
@long_running_operation_retry_timeout = 30
@generate_client_request_id = true
add_telemetry
end

#
# Makes a request and returns the body of the response.
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
# @param path [String] the path, relative to {base_url}.
# @param options [Hash{String=>String}] specifying any request options like :body.
# @return [Hash{String=>String}] containing the body of the response.
# Example:
#
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
# path = "/path"
# options = {
# body: request_content,
# query_params: {'api-version' => '2016-02-01'}
# }
# result = @client.make_request(:put, path, options)
#
def make_request(method, path, options = {})
result = make_request_with_http_info(method, path, options)
result.body unless result.nil?
end

#
# Makes a request and returns the operation response.
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
# @param path [String] the path, relative to {base_url}.
# @param options [Hash{String=>String}] specifying any request options like :body.
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
#
def make_request_with_http_info(method, path, options = {})
result = make_request_async(method, path, options).value!
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
result
end

#
# Makes a request asynchronously.
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
# @param path [String] the path, relative to {base_url}.
# @param options [Hash{String=>String}] specifying any request options like :body.
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def make_request_async(method, path, options = {})
fail ArgumentError, 'method is nil' if method.nil?
fail ArgumentError, 'path is nil' if path.nil?

request_url = options[:base_url] || @base_url

request_headers = @request_headers
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
options.merge!({headers: request_headers.merge(options[:headers] || {})})
options.merge!({credentials: @credentials}) unless @credentials.nil?

super(request_url, method, path, options)
end


private
#
# Adds telemetry information.
#
def add_telemetry
sdk_information = 'azure_mgmt_container_registry'
if defined? Azure::ARM::ContainerRegistry::VERSION
sdk_information = "#{sdk_information}/#{Azure::ARM::ContainerRegistry::VERSION}"
end
add_user_agent_information(sdk_information)
end
end
end