Class: Vipr
- Inherits:
-
Object
- Object
- Vipr
- Includes:
- ViprBase, ViprHost, ViprStorageSystem, ViprVcenter
- Defined in:
- lib/vipruby/vipr.rb
Overview
The base class for the gem. Every subsequent method relies on creating an object from this class
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
required params used for almost every single method.
-
#base_url ⇒ Object
required params used for almost every single method.
-
#tenant_uid ⇒ Object
required params used for almost every single method.
-
#verify_cert ⇒ Object
required params used for almost every single method.
Instance Method Summary collapse
-
#initialize(base_url, user_name, password, verify_cert) ⇒ Object
constructor
Initializes a Vipr object that all methods can follow.
Methods included from ViprHost
#add_host, #add_host_initiator, #check_host_get, #check_host_post, #check_host_post_initiator, #deactivate_host, #find_host_object, #generate_host_post_json, #generate_initiators_json, #get_all_hosts, #get_host, #host_exists?
Methods included from ViprStorageSystem
#add_emc_block, #add_emc_file, #add_hitachi, #add_isilon, #add_netapp, #add_scaleio, #add_third_party_block, #add_vplex, #check_storage_provider_payload, #storage_provider_payload, #storage_system_payload
Methods included from ViprVcenter
#add_vcenter, #check_vcenter, #check_vcenter_object_hash, #check_vcenter_post, #delete_vcenter, #find_vcenter_object, #get_all_vcenters, #get_vcenter, #get_vcenter_clusters, #get_vcenter_datacenters, #get_vcenter_hosts
Methods included from ViprBase
#generate_base_url, #get_auth_token, #get_tenant_uid, #login, #rest_get, #rest_post, #to_boolean
Constructor Details
#initialize(base_url, user_name, password, verify_cert) ⇒ Object
Every POST call requires a Tenant UID to create an object. This variable gets the current logged in tenant information. Nothing else needs to be done if there is a single tenant configured for ViPR If resources need to be added to specific tenants, this variable must be overwritten by specifying the tenant_uid
Initializes a Vipr object that all methods can follow.
38 39 40 41 42 43 |
# File 'lib/vipruby/vipr.rb', line 38 def initialize(base_url,user_name,password,verify_cert) @base_url = generate_base_url(base_url) @verify_cert = to_boolean(verify_cert) @auth_token = get_auth_token(user_name,password) @tenant_uid = get_tenant_uid['id'] end |
Instance Attribute Details
#auth_token ⇒ Object
required params used for almost every single method
15 16 17 |
# File 'lib/vipruby/vipr.rb', line 15 def auth_token @auth_token end |
#base_url ⇒ Object
required params used for almost every single method
15 16 17 |
# File 'lib/vipruby/vipr.rb', line 15 def base_url @base_url end |
#tenant_uid ⇒ Object
required params used for almost every single method
15 16 17 |
# File 'lib/vipruby/vipr.rb', line 15 def tenant_uid @tenant_uid end |
#verify_cert ⇒ Object
required params used for almost every single method
15 16 17 |
# File 'lib/vipruby/vipr.rb', line 15 def verify_cert @verify_cert end |