Class: Vipr

Overview

The base class for the gem. Every subsequent method relies on creating an object from this class

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ViprVirtualDataCenter

#get_vdc, #get_vdc_secretkey, #get_vdcs

Methods included from ViprVirtualArray

#get_varray, #get_varray_acl, #get_varray_attributes, #get_varray_autotier_policy, #get_varray_connectivity, #get_varray_networks, #get_varray_storage_pools, #get_varray_storage_ports, #get_varray_virtual_pools, #get_varrays, #search_varrays

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 ViprTenant

#get_subtenants, #get_tenant, #get_tenant_projects, #get_tenants

Methods included from ViprStorageTier

#get_storage_tier, #get_storage_tiers

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, #check_storage_system_id_post, #get_storage_provider, #get_storage_provider_storage_system, #get_storage_provider_storage_systems, #get_storage_provider_tasks, #get_storage_providers, #get_storage_system, #get_storage_system_auto_tier_policy, #get_storage_system_storage_pools, #get_storage_system_storage_ports, #get_storage_system_unmanaged_filesystems, #get_storage_system_unmanaged_volumes, #get_storage_systems, #storage_provider_payload, #storage_system_deactivate, #storage_system_deregister, #storage_system_discover, #storage_system_payload, #storage_system_register

Methods included from ViprStoragePort

#check_storage_port_id_post, #get_storage_port, #get_storage_ports, #storage_port_deactivate, #storage_port_deregister

Methods included from ViprStoragePool

#check_storage_pool_id_post, #get_storage_pool, #get_storage_pool_resources, #get_storage_pool_storage_tiers, #get_storage_pools, #storage_pool_deactivate, #storage_pool_deregister

Methods included from ViprServiceCatalog

#get_all_sc_services, #get_sc_category_categories, #get_sc_category_categories_services, #get_sc_category_root, #get_sc_service, #order_service, #post_order_service

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 ViprFileVirtualPool

#check_file_vpool_id_post, #file_vpool_deactivate, #get_file_vpool, #get_file_vpool_acl, #get_file_vpool_refresh_matched_pools, #get_file_vpool_storage_pools, #get_file_vpools

Methods included from ViprBlockVirtualPool

#block_vpool_deactivate, #check_block_vpool_id_post, #get_block_vpool, #get_block_vpool_acl, #get_block_vpool_refresh_matched_pools, #get_block_vpool_storage_pools, #get_block_vpools

Methods included from ViprAutoTier

#get_auto_tier_policies, #get_auto_tier_policy, #get_auto_tier_policy_storage_tiers

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

Note:

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.

Examples:

New Vipruby Object

base_url = 'vipr.mydomain.com'
user_name = 'root'
password = 'mypw'
verify_cert = false
vipr = Vipr.new(base_url,user_name,password,verify_cert)

Parameters:

  • base_url (String)

    The IP address or FQDN of the ViPR appliance. Do not include ‘https’ or port numbers

  • user_name (String)

    Username used to log into ViPR

  • password (String)

    Password used to log into ViPR

  • verify_cert (Boolean)

    Should the cert be SSL verified? Setting it to false will work for development purposes. Should be set to true for production



58
59
60
61
62
63
# File 'lib/vipruby/vipr.rb', line 58

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_tokenObject

required params used for almost every single method



35
36
37
# File 'lib/vipruby/vipr.rb', line 35

def auth_token
  @auth_token
end

#base_urlObject

required params used for almost every single method



35
36
37
# File 'lib/vipruby/vipr.rb', line 35

def base_url
  @base_url
end

#tenant_uidObject

required params used for almost every single method



35
36
37
# File 'lib/vipruby/vipr.rb', line 35

def tenant_uid
  @tenant_uid
end

#verify_certObject

required params used for almost every single method



35
36
37
# File 'lib/vipruby/vipr.rb', line 35

def verify_cert
  @verify_cert
end