Class: Azure::ServiceFabric::Profiles::Latest::Mgmt::ServiceFabricManagementClass

Inherits:
Object
  • Object
show all
Defined in:
lib/profiles/latest/modules/servicefabric_profile_module.rb

Overview

ServiceFabricManagementClass

Direct Known Subclasses

Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ServiceFabricManagementClass

Returns a new instance of ServiceFabricManagementClass.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 87

def initialize(options = {})
  if options.is_a?(Hash) && options.length == 0
    @options = setup_default_options
  else
    @options = options
  end

  reset!(options)

  @configurable = self
  @base_url = options[:base_url].nil? ? nil:options[:base_url]
  @options = options[:options].nil? ? nil:options[:options]

  @client_0 = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::ServiceFabricManagementClient.new(configurable.credentials, base_url, options)
  if(@client_0.respond_to?(:subscription_id))
    @client_0.subscription_id = configurable.subscription_id
  end
  add_telemetry(@client_0)
  @application_type = @client_0.application_type
  @version = @client_0.version
  @application = @client_0.application
  @service = @client_0.service

  @client_1 = Azure::ServiceFabric::Mgmt::V2018_02_01::ServiceFabricManagementClient.new(configurable.credentials, base_url, options)
  if(@client_1.respond_to?(:subscription_id))
    @client_1.subscription_id = configurable.subscription_id
  end
  add_telemetry(@client_1)
  @clusters = @client_1.clusters
  @cluster_versions = @client_1.cluster_versions
  @operations = @client_1.operations

  @model_classes = ModelClasses.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



127
128
129
130
131
132
133
134
135
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 127

def method_missing(method, *args)
  if @client_1.respond_to?method
    @client_1.send(method, *args)
  elsif @client_0.respond_to?method
    @client_0.send(method, *args)
  else
    super
  end
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def application
  @application
end

#application_typeObject (readonly)

Returns the value of attribute application_type.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def application_type
  @application_type
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def base_url
  @base_url
end

#cluster_versionsObject (readonly)

Returns the value of attribute cluster_versions.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def cluster_versions
  @cluster_versions
end

#clustersObject (readonly)

Returns the value of attribute clusters.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def clusters
  @clusters
end

#configurableObject (readonly)

Returns the value of attribute configurable.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def configurable
  @configurable
end

#model_classesObject (readonly)

Returns the value of attribute model_classes.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def model_classes
  @model_classes
end

#operationsObject (readonly)

Returns the value of attribute operations.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def operations
  @operations
end

#optionsObject (readonly)

Returns the value of attribute options.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def options
  @options
end

#serviceObject (readonly)

Returns the value of attribute service.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def service
  @service
end

#versionObject (readonly)

Returns the value of attribute version.



85
86
87
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 85

def version
  @version
end

Instance Method Details

#add_telemetry(client) ⇒ Object



122
123
124
125
# File 'lib/profiles/latest/modules/servicefabric_profile_module.rb', line 122

def add_telemetry(client)
  profile_information = 'Profiles/Latest/ServiceFabric/Mgmt'
  client.add_user_agent_information(profile_information)
end