Class: Fog::OpenStack::ContainerInfra::Real

Inherits:
Object
  • Object
show all
Includes:
Fog::OpenStack::Core
Defined in:
lib/fog/openstack/container_infra.rb,
lib/fog/openstack/container_infra/requests/get_bay.rb,
lib/fog/openstack/container_infra/requests/list_bays.rb,
lib/fog/openstack/container_infra/requests/create_bay.rb,
lib/fog/openstack/container_infra/requests/delete_bay.rb,
lib/fog/openstack/container_infra/requests/update_bay.rb,
lib/fog/openstack/container_infra/requests/get_cluster.rb,
lib/fog/openstack/container_infra/requests/get_bay_model.rb,
lib/fog/openstack/container_infra/requests/list_clusters.rb,
lib/fog/openstack/container_infra/requests/create_cluster.rb,
lib/fog/openstack/container_infra/requests/delete_cluster.rb,
lib/fog/openstack/container_infra/requests/update_cluster.rb,
lib/fog/openstack/container_infra/requests/get_certificate.rb,
lib/fog/openstack/container_infra/requests/list_bay_models.rb,
lib/fog/openstack/container_infra/requests/create_bay_model.rb,
lib/fog/openstack/container_infra/requests/delete_bay_model.rb,
lib/fog/openstack/container_infra/requests/update_bay_model.rb,
lib/fog/openstack/container_infra/requests/create_certificate.rb,
lib/fog/openstack/container_infra/requests/get_cluster_template.rb,
lib/fog/openstack/container_infra/requests/list_cluster_templates.rb,
lib/fog/openstack/container_infra/requests/create_cluster_template.rb,
lib/fog/openstack/container_infra/requests/delete_cluster_template.rb,
lib/fog/openstack/container_infra/requests/update_cluster_template.rb

Instance Attribute Summary

Attributes included from Fog::OpenStack::Core

#auth_token, #auth_token_expiration, #current_tenant, #current_user, #current_user_id, #openstack_application_credential_id, #openstack_application_credential_secret, #openstack_cache_ttl, #openstack_domain_id, #openstack_domain_name, #openstack_identity_api_version, #openstack_project_domain, #openstack_project_domain_id, #openstack_project_id, #openstack_user_domain, #openstack_user_domain_id, #unscoped_token

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Fog::OpenStack::Core

#credentials, #initialize, #reload

Class Method Details

.not_found_classObject



125
126
127
# File 'lib/fog/openstack/container_infra.rb', line 125

def self.not_found_class
  Fog::OpenStack::ContainerInfra::NotFound
end

Instance Method Details

#create_bay(params) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/container_infra/requests/create_bay.rb', line 5

def create_bay(params)
  request(
    :expects => [202, 201, 200],
    :method  => 'POST',
    :path    => "bays",
    :body    => Fog::JSON.encode(params)
  )
end

#create_bay_model(params) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/container_infra/requests/create_bay_model.rb', line 5

def create_bay_model(params)
  request(
    :expects => [201, 200],
    :method  => 'POST',
    :path    => "baymodels",
    :body    => Fog::JSON.encode(params)
  )
end

#create_certificate(params) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/container_infra/requests/create_certificate.rb', line 5

def create_certificate(params)
  request(
    :expects => [201, 200],
    :method  => 'POST',
    :path    => "certificates",
    :body    => Fog::JSON.encode(params)
  )
end

#create_cluster(params) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/container_infra/requests/create_cluster.rb', line 5

def create_cluster(params)
  request(
    :expects => [202, 201, 200],
    :method  => 'POST',
    :path    => "clusters",
    :body    => Fog::JSON.encode(params)
  )
end

#create_cluster_template(params) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/container_infra/requests/create_cluster_template.rb', line 5

def create_cluster_template(params)
  request(
    :expects => [201, 200],
    :method  => 'POST',
    :path    => "clustertemplates",
    :body    => Fog::JSON.encode(params)
  )
end

#default_path_prefixObject



129
130
131
# File 'lib/fog/openstack/container_infra.rb', line 129

def default_path_prefix
  'v1'
end

#default_service_typeObject



133
134
135
# File 'lib/fog/openstack/container_infra.rb', line 133

def default_service_type
  %w[container-infra]
end

#delete_bay(uuid_or_name) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/delete_bay.rb', line 5

def delete_bay(uuid_or_name)
  request(
    :expects => [204],
    :method  => 'DELETE',
    :path    => "bays/#{uuid_or_name}"
  )
end

#delete_bay_model(uuid_or_name) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/delete_bay_model.rb', line 5

def delete_bay_model(uuid_or_name)
  request(
    :expects => [204],
    :method  => 'DELETE',
    :path    => "baymodels/#{uuid_or_name}"
  )
end

#delete_cluster(uuid_or_name) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/delete_cluster.rb', line 5

def delete_cluster(uuid_or_name)
  request(
    :expects => [204],
    :method  => 'DELETE',
    :path    => "clusters/#{uuid_or_name}"
  )
end

#delete_cluster_template(uuid_or_name) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/delete_cluster_template.rb', line 5

def delete_cluster_template(uuid_or_name)
  request(
    :expects => [204],
    :method  => 'DELETE',
    :path    => "clustertemplates/#{uuid_or_name}"
  )
end

#get_bay(uuid_or_name) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/get_bay.rb', line 5

def get_bay(uuid_or_name)
  request(
    :expects => [200],
    :method  => 'GET',
    :path    => "bays/#{uuid_or_name}"
  )
end

#get_bay_model(uuid_or_name) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/get_bay_model.rb', line 5

def get_bay_model(uuid_or_name)
  request(
    :expects => [200],
    :method  => 'GET',
    :path    => "baymodels/#{uuid_or_name}"
  )
end

#get_certificate(bay_uuid) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/get_certificate.rb', line 5

def get_certificate(bay_uuid)
  request(
    :expects => [200],
    :method  => 'GET',
    :path    => "certificates/#{cluster_uuid}"
  )
end

#get_cluster(uuid_or_name) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/get_cluster.rb', line 5

def get_cluster(uuid_or_name)
  request(
    :expects => [200],
    :method  => 'GET',
    :path    => "clusters/#{uuid_or_name}"
  )
end

#get_cluster_template(uuid_or_name) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/get_cluster_template.rb', line 5

def get_cluster_template(uuid_or_name)
  request(
    :expects => [200],
    :method  => 'GET',
    :path    => "clustertemplates/#{uuid_or_name}"
  )
end

#list_bay_modelsObject



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/list_bay_models.rb', line 5

def list_bay_models
  request(
    :expects => [200],
    :method  => 'GET',
    :path    => "baymodels/detail"
  )
end

#list_baysObject



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/list_bays.rb', line 5

def list_bays
  request(
    :expects => [200],
    :method  => 'GET',
    :path    => "bays/detail"
  )
end

#list_cluster_templatesObject



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/list_cluster_templates.rb', line 5

def list_cluster_templates
  request(
    :expects => [200],
    :method  => 'GET',
    :path    => "clustertemplates/detail"
  )
end

#list_clustersObject



5
6
7
8
9
10
11
# File 'lib/fog/openstack/container_infra/requests/list_clusters.rb', line 5

def list_clusters
  request(
    :expects => [200],
    :method  => 'GET',
    :path    => "clusters/detail"
  )
end

#request(options = {}) ⇒ Object



137
138
139
140
# File 'lib/fog/openstack/container_infra.rb', line 137

def request(options = {})
  options[:headers] = {'OpenStack-API-Version' => "container-infra #{SUPPORTED_MICROVERSION}"}
  super(options)
end

#update_bay(uuid_or_name, params) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/container_infra/requests/update_bay.rb', line 5

def update_bay(uuid_or_name, params)
  request(
    :expects => [202, 200],
    :method  => 'PATCH',
    :path    => "bays/#{uuid_or_name}",
    :body    => Fog::JSON.encode(params)
  )
end

#update_bay_model(uuid_or_name, params) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/container_infra/requests/update_bay_model.rb', line 5

def update_bay_model(uuid_or_name, params)
  request(
    :expects => [200],
    :method  => 'PATCH',
    :path    => "baymodels/#{uuid_or_name}",
    :body    => Fog::JSON.encode(params)
  )
end

#update_cluster(uuid_or_name, params) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/container_infra/requests/update_cluster.rb', line 5

def update_cluster(uuid_or_name, params)
  request(
    :expects => [202, 200],
    :method  => 'PATCH',
    :path    => "clusters/#{uuid_or_name}",
    :body    => Fog::JSON.encode(params)
  )
end

#update_cluster_template(uuid_or_name, params) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fog/openstack/container_infra/requests/update_cluster_template.rb', line 5

def update_cluster_template(uuid_or_name, params)
  request(
    :expects => [200],
    :method  => 'PATCH',
    :path    => "clustertemplates/#{uuid_or_name}",
    :body    => Fog::JSON.encode(params)
  )
end