Class: Azure::Armrest::SubscriptionService
- Inherits:
-
ArmrestService
- Object
- ArmrestService
- Azure::Armrest::SubscriptionService
- Defined in:
- lib/azure/armrest/subscription_service.rb
Instance Attribute Summary
Attributes inherited from ArmrestService
#api_version, #armrest_configuration, #base_url, #provider, #service_name
Instance Method Summary collapse
-
#get(subscription_id) ⇒ Object
Returns a Subscription object for the given
subscription_id
. -
#initialize(configuration, options = {}) ⇒ SubscriptionService
constructor
This overrides the typical constructor for an ArmrestService subclass because it does not have a service name or a provider.
-
#list ⇒ Object
Returns a list of Subscription objects for the current tenant, one for each subscription ID.
Methods inherited from ArmrestService
configure, #get_provider, #get_subscription, #list_locations, #list_resource_groups, #list_resources, #list_subscriptions, #locations, #poll, #tags, #tenants, #wait
Constructor Details
#initialize(configuration, options = {}) ⇒ SubscriptionService
This overrides the typical constructor for an ArmrestService subclass because it does not have a service name or a provider.
6 7 8 9 |
# File 'lib/azure/armrest/subscription_service.rb', line 6 def initialize(configuration, = {}) @armrest_configuration = configuration @api_version = [:api_version] || '2016-06-01' end |
Instance Method Details
#get(subscription_id) ⇒ Object
Returns a Subscription object for the given subscription_id
.
22 23 24 25 26 |
# File 'lib/azure/armrest/subscription_service.rb', line 22 def get(subscription_id) url = File.join(subscriptions_url, subscription_id) + "?api-version=#{api_version}" response = rest_get(url) Azure::Armrest::Subscription.new(response) end |
#list ⇒ Object
Returns a list of Subscription objects for the current tenant, one for each subscription ID.
14 15 16 17 18 |
# File 'lib/azure/armrest/subscription_service.rb', line 14 def list url = subscriptions_url + "?api-version=#{api_version}" response = rest_get(url) Azure::Armrest::ArmrestCollection.create_from_response(response, Azure::Armrest::Subscription) end |