Class: Fog::ContainerInfra::OpenStack::Mock

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/fog/container_infra/openstack.rb', line 80

def initialize(options = {})
  @openstack_username = options[:openstack_username]
  @openstack_tenant   = options[:openstack_tenant]
  @openstack_auth_uri = URI.parse(options[:openstack_auth_url])

  @auth_token = Fog::Mock.random_base64(64)
  @auth_token_expiration = (Time.now.utc + 86400).iso8601

  management_url = URI.parse(options[:openstack_auth_url])
  management_url.port = 9511
  management_url.path = '/v1'
  @openstack_management_url = management_url.to_s

  @data ||= {:users => {}}
  unless @data[:users].find { |u| u['name'] == options[:openstack_username] }
    id = Fog::Mock.random_numbers(6).to_s
    @data[:users][id] = {
      'id'       => id,
      'name'     => options[:openstack_username],
      'email'    => "#{options[:openstack_username]}@mock.com",
      'tenantId' => Fog::Mock.random_numbers(6).to_s,
      'enabled'  => true
    }
  end
end

Class Method Details

.dataObject



67
68
69
70
71
72
73
74
# File 'lib/fog/container_infra/openstack.rb', line 67

def self.data
  @data ||= Hash.new do |hash, key|
    hash[key] = {
      :users   => {},
      :tenants => {}
    }
  end
end

.resetObject



76
77
78
# File 'lib/fog/container_infra/openstack.rb', line 76

def self.reset
  @data = nil
end

Instance Method Details

#create_bay(_params) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/fog/container_infra/openstack/requests/create_bay.rb', line 16

def create_bay(_params)
  response = Excon::Response.new
  response.status = 202
  response.body = {
    "uuid" => "746e779a-751a-456b-a3e9-c883d734946f"
  }
  response
end

#create_bay_model(_params) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fog/container_infra/openstack/requests/create_bay_model.rb', line 16

def create_bay_model(_params)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "insecure_registry"     => nil,
    "http_proxy"            => "http://10.164.177.169:8080",
    "updated_at"            => nil,
    "floating_ip_enabled"   => true,
    "fixed_subnet"          => nil,
    "master_flavor_id"      => nil,
    "uuid"                  => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
    "no_proxy"              => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
    "https_proxy"           => "http://10.164.177.169:8080",
    "tls_disabled"          => false,
    "keypair_id"            => "kp",
    "public"                => false,
    "labels"                => {},
    "docker_volume_size"    => 3,
    "server_type"           => "vm",
    "external_network_id"   => "public",
    "cluster_distro"        => "fedora-atomic",
    "image_id"              => "fedora-atomic-latest",
    "volume_driver"         => "cinder",
    "registry_enabled"      => false,
    "docker_storage_driver" => "devicemapper",
    "apiserver_port"        => nil,
    "name"                  => "k8s-bm2",
    "created_at"            => "2016-08-29T02:08:08+00:00",
    "network_driver"        => "flannel",
    "fixed_network"         => nil,
    "coe"                   => "kubernetes",
    "flavor_id"             => "m1.small",
    "master_lb_enabled"     => true,
    "dns_nameserver"        => "8.8.8.8"
  }
  response
end

#create_certificate(_params) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/fog/container_infra/openstack/requests/create_certificate.rb', line 16

def create_certificate(_params)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "pem"          => "-----BEGIN CERTIFICATE-----\nMIIDxDCCAqygAwIBAgIRALgUbIjdKUy8lqErJmCxVfkwDQYJKoZIhvcNAQELBQAw\n-----END CERTIFICATE-----\n",
    "bay_uuid"     => "0b4b766f-1500-44b3-9804-5a6e12fe6df4",
    "csr"          => "-----BEGIN CERTIFICATE REQUEST-----\nMIIEfzCCAmcCAQAwFDESMBAGA1UEAxMJWW91ciBOYW1lMIICIjANBgkqhkiG9w0B\n-----END CERTIFICATE REQUEST-----\n"
  }
  response
end

#create_cluster(_params) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/fog/container_infra/openstack/requests/create_cluster.rb', line 16

def create_cluster(_params)
  response = Excon::Response.new
  response.status = 202
  response.body = {
    "uuid" => "746e779a-751a-456b-a3e9-c883d734946f"
  }
  response
end

#create_cluster_template(_params) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fog/container_infra/openstack/requests/create_cluster_template.rb', line 16

def create_cluster_template(_params)
  response = Excon::Response.new
  response.status = 201
  response.body = {
    "insecure_registry"     => nil,
    "http_proxy"            => "http://10.164.177.169:8080",
    "updated_at"            => nil,
    "floating_ip_enabled"   => true,
    "fixed_subnet"          => nil,
    "master_flavor_id"      => nil,
    "uuid"                  => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
    "no_proxy"              => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
    "https_proxy"           => "http://10.164.177.169:8080",
    "tls_disabled"          => false,
    "keypair_id"            => "kp",
    "public"                => false,
    "labels"                => {},
    "docker_volume_size"    => 3,
    "server_type"           => "vm",
    "external_network_id"   => "public",
    "cluster_distro"        => "fedora-atomic",
    "image_id"              => "fedora-atomic-latest",
    "volume_driver"         => "cinder",
    "registry_enabled"      => false,
    "docker_storage_driver" => "devicemapper",
    "apiserver_port"        => nil,
    "name"                  => "k8s-bm2",
    "created_at"            => "2016-08-29T02:08:08+00:00",
    "network_driver"        => "flannel",
    "fixed_network"         => nil,
    "coe"                   => "kubernetes",
    "flavor_id"             => "m1.small",
    "master_lb_enabled"     => true,
    "dns_nameserver"        => "8.8.8.8"
  }
  response
end

#credentialsObject



114
115
116
117
118
119
# File 'lib/fog/container_infra/openstack.rb', line 114

def credentials
  {:provider                 => 'openstack',
   :openstack_auth_url       => @openstack_auth_uri.to_s,
   :openstack_auth_token     => @auth_token,
   :openstack_management_url => @openstack_management_url}
end

#dataObject



106
107
108
# File 'lib/fog/container_infra/openstack.rb', line 106

def data
  self.class.data[@openstack_username]
end

#delete_bay(_uuid_or_name) ⇒ Object



15
16
17
18
19
20
# File 'lib/fog/container_infra/openstack/requests/delete_bay.rb', line 15

def delete_bay(_uuid_or_name)
  response = Excon::Response.new
  response.status = 204
  response.body = {}
  response
end

#delete_bay_model(_uuid_or_name) ⇒ Object



15
16
17
18
19
20
# File 'lib/fog/container_infra/openstack/requests/delete_bay_model.rb', line 15

def delete_bay_model(_uuid_or_name)
  response = Excon::Response.new
  response.status = 204
  response.body = {}
  response
end

#delete_cluster(_uuid_or_name) ⇒ Object



15
16
17
18
19
20
# File 'lib/fog/container_infra/openstack/requests/delete_cluster.rb', line 15

def delete_cluster(_uuid_or_name)
  response = Excon::Response.new
  response.status = 204
  response.body = {}
  response
end

#delete_cluster_template(_uuid_or_name) ⇒ Object



15
16
17
18
19
20
# File 'lib/fog/container_infra/openstack/requests/delete_cluster_template.rb', line 15

def delete_cluster_template(_uuid_or_name)
  response = Excon::Response.new
  response.status = 204
  response.body = {}
  response
end

#get_bay(_uuid_or_name) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/fog/container_infra/openstack/requests/get_bay.rb', line 15

def get_bay(_uuid_or_name)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "status"             => "CREATE_COMPLETE",
    "uuid"               => "746e779a-751a-456b-a3e9-c883d734946f",
    "stack_id"           => "9c6f1169-7300-4d08-a444-d2be38758719",
    "created_at"         => "2016-08-29T06:51:31+00:00",
    "api_address"        => "https://172.24.4.6:6443",
    "discovery_url"      => "https://discovery.etcd.io/cbeb580da58915809d59ee69348a84f3",
    "updated_at"         => "2016-08-29T06:53:24+00:00",
    "master_count"       => 1,
    "coe_version"        => "v1.2.0",
    "baymodel_id"        => "0562d357-8641-4759-8fed-8173f02c9633",
    "master_addresses"   => ["172.24.4.6"],
    "node_count"         => 1,
    "node_addresses"     => ["172.24.4.13"],
    "status_reason"      => "Stack CREATE completed successfully",
    "bay_create_timeout" => 60,
    "name"               => "k8s",
    "links"              => [
      {
         "href" => "http://10.164.180.104:9511/v1/bays/746e779a-751a-456b-a3e9-c883d734946f",
         "rel"  => "self"
      },
      {
         "href" => "http://10.164.180.104:9511/bays/746e779a-751a-456b-a3e9-c883d734946f",
         "rel"  => "bookmark"
      }
    ]
  }
  response
end

#get_bay_model(_uuid_or_name) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fog/container_infra/openstack/requests/get_bay_model.rb', line 15

def get_bay_model(_uuid_or_name)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "insecure_registry"     => nil,
    "http_proxy"            => "http://10.164.177.169:8080",
    "updated_at"            => nil,
    "floating_ip_enabled"   => true,
    "fixed_subnet"          => nil,
    "master_flavor_id"      => nil,
    "uuid"                  => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
    "no_proxy"              => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
    "https_proxy"           => "http://10.164.177.169:8080",
    "tls_disabled"          => false,
    "keypair_id"            => "kp",
    "public"                => false,
    "labels"                => {},
    "docker_volume_size"    => 3,
    "server_type"           => "vm",
    "external_network_id"   => "public",
    "cluster_distro"        => "fedora-atomic",
    "image_id"              => "fedora-atomic-latest",
    "volume_driver"         => "cinder",
    "registry_enabled"      => false,
    "docker_storage_driver" => "devicemapper",
    "apiserver_port"        => nil,
    "name"                  => "k8s-bm2",
    "created_at"            => "2016-08-29T02:08:08+00:00",
    "network_driver"        => "flannel",
    "fixed_network"         => nil,
    "coe"                   => "kubernetes",
    "flavor_id"             => "m1.small",
    "master_lb_enabled"     => true,
    "dns_nameserver"        => "8.8.8.8"
  }
  response
end

#get_certificate(_bay_uuid) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/fog/container_infra/openstack/requests/get_certificate.rb', line 15

def get_certificate(_bay_uuid)
  response = Excon::Response.new
  response.status = 200
    response.body = {
      "pem"      => "-----BEGIN CERTIFICATE-----\nMIICzDCCAbSgAwIBAgIQOOkVcEN7TNa9E80GoUs4xDANBgkqhkiG9w0BAQsFADAO\n-----END CERTIFICATE-----\n",
      "bay_uuid" => "0b4b766f-1500-44b3-9804-5a6e12fe6df4"
    }
  response
end

#get_cluster(_uuid_or_name) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fog/container_infra/openstack/requests/get_cluster.rb', line 15

def get_cluster(_uuid_or_name)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "status"              => "CREATE_COMPLETE",
    "uuid"                => "746e779a-751a-456b-a3e9-c883d734946f",
    "stack_id"            => "9c6f1169-7300-4d08-a444-d2be38758719",
    "created_at"          => "2016-08-29T06:51:31+00:00",
    "api_address"         => "https://172.24.4.6:6443",
    "discovery_url"       => "https://discovery.etcd.io/cbeb580da58915809d59ee69348a84f3",
    "updated_at"          => "2016-08-29T06:53:24+00:00",
    "master_count"        => 1,
    "coe_version"         => "v1.2.0",
    "cluster_template_id" => "0562d357-8641-4759-8fed-8173f02c9633",
    "master_addresses"    => ["172.24.4.6"],
    "node_count"          => 1,
    "node_addresses"      => ["172.24.4.13"],
    "status_reason"       => "Stack CREATE completed successfully",
    "create_timeout"      => 60,
    "name"                => "k8s"
  }
  response
end

#get_cluster_template(_uuid_or_name) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fog/container_infra/openstack/requests/get_cluster_template.rb', line 15

def get_cluster_template(_uuid_or_name)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "insecure_registry"     => nil,
    "http_proxy"            => "http://10.164.177.169:8080",
    "updated_at"            => nil,
    "floating_ip_enabled"   => true,
    "fixed_subnet"          => nil,
    "master_flavor_id"      => nil,
    "uuid"                  => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
    "no_proxy"              => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
    "https_proxy"           => "http://10.164.177.169:8080",
    "tls_disabled"          => false,
    "keypair_id"            => "kp",
    "public"                => false,
    "labels"                => {},
    "docker_volume_size"    => 3,
    "server_type"           => "vm",
    "external_network_id"   => "public",
    "cluster_distro"        => "fedora-atomic",
    "image_id"              => "fedora-atomic-latest",
    "volume_driver"         => "cinder",
    "registry_enabled"      => false,
    "docker_storage_driver" => "devicemapper",
    "apiserver_port"        => nil,
    "name"                  => "k8s-bm2",
    "created_at"            => "2016-08-29T02:08:08+00:00",
    "network_driver"        => "flannel",
    "fixed_network"         => nil,
    "coe"                   => "kubernetes",
    "flavor_id"             => "m1.small",
    "master_lb_enabled"     => true,
    "dns_nameserver"        => "8.8.8.8"
  }
  response
end

#list_bay_modelsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/fog/container_infra/openstack/requests/list_bay_models.rb', line 15

def list_bay_models
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "baymodels" => [
      {
        "insecure_registry"     => nil,
        "http_proxy"            => "http://10.164.177.169:8080",
        "updated_at"            => nil,
        "floating_ip_enabled"   => true,
        "fixed_subnet"          => nil,
        "master_flavor_id"      => nil,
        "uuid"                  => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
        "no_proxy"              => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
        "https_proxy"           => "http://10.164.177.169:8080",
        "tls_disabled"          => false,
        "keypair_id"            => "kp",
        "public"                => false,
        "labels"                => {},
        "docker_volume_size"    => 3,
        "server_type"           => "vm",
        "external_network_id"   => "public",
        "cluster_distro"        => "fedora-atomic",
        "image_id"              => "fedora-atomic-latest",
        "volume_driver"         => "cinder",
        "registry_enabled"      => false,
        "docker_storage_driver" => "devicemapper",
        "apiserver_port"        => nil,
        "name"                  => "k8s-bm2",
        "created_at"            => "2016-08-29T02:08:08+00:00",
        "network_driver"        => "flannel",
        "fixed_network"         => nil,
        "coe"                   => "kubernetes",
        "flavor_id"             => "m1.small",
        "master_lb_enabled"     => true,
        "dns_nameserver"        => "8.8.8.8",
        "links" => [
          {
             "href" => "http://10.164.180.104:9511/v1/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
             "rel"  => "self"
          },
          {
             "href" => "http://10.164.180.104:9511/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
             "rel"  => "bookmark"
          }
        ]
      }
    ]
  }
  response
end

#list_baysObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fog/container_infra/openstack/requests/list_bays.rb', line 15

def list_bays
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "bays" => [
      {
        "status"             => "CREATE_COMPLETE",
        "uuid"               => "746e779a-751a-456b-a3e9-c883d734946f",
        "stack_id"           => "9c6f1169-7300-4d08-a444-d2be38758719",
        "created_at"         => "2016-08-29T06:51:31+00:00",
        "api_address"        => "https://172.24.4.6:6443",
        "discovery_url"      => "https://discovery.etcd.io/cbeb580da58915809d59ee69348a84f3",
        "updated_at"         => "2016-08-29T06:53:24+00:00",
        "master_count"       => 1,
        "coe_version"        => "v1.2.0",
        "baymodel_id"        => "0562d357-8641-4759-8fed-8173f02c9633",
        "master_addresses"   => ["172.24.4.6"],
        "node_count"         => 1,
        "node_addresses"     => ["172.24.4.13"],
        "status_reason"      => "Stack CREATE completed successfully",
        "bay_create_timeout" => 60,
        "name"               => "k8s",
        "links"              => [
          {
             "href" => "http://10.164.180.104:9511/v1/bays/746e779a-751a-456b-a3e9-c883d734946f",
             "rel"  => "self"
          },
          {
             "href" => "http://10.164.180.104:9511/bays/746e779a-751a-456b-a3e9-c883d734946f",
             "rel"  => "bookmark"
          }
        ]
      }
    ]
  }
  response
end

#list_cluster_templatesObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/fog/container_infra/openstack/requests/list_cluster_templates.rb', line 15

def list_cluster_templates
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "clustertemplates" => [
      {
        "insecure_registry"     => nil,
        "http_proxy"            => "http://10.164.177.169:8080",
        "updated_at"            => nil,
        "floating_ip_enabled"   => true,
        "fixed_subnet"          => nil,
        "master_flavor_id"      => nil,
        "uuid"                  => "0562d357-8641-4759-8fed-8173f02c9633",
        "no_proxy"              => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
        "https_proxy"           => "http://10.164.177.169:8080",
        "tls_disabled"          => false,
        "keypair_id"            => "kp",
        "public"                => false,
        "labels"                => {},
        "docker_volume_size"    => 3,
        "server_type"           => "vm",
        "external_network_id"   => "public",
        "cluster_distro"        => "fedora-atomic",
        "image_id"              => "fedora-atomic-latest",
        "volume_driver"         => "cinder",
        "registry_enabled"      => false,
        "docker_storage_driver" => "devicemapper",
        "apiserver_port"        => nil,
        "name"                  => "k8s-bm",
        "created_at"            => "2016-08-26T09:34:41+00:00",
        "network_driver"        => "flannel",
        "fixed_network"         => nil,
        "coe"                   => "kubernetes",
        "flavor_id"             => "m1.small",
        "master_lb_enabled"     => false,
        "dns_nameserver"        => "8.8.8.8"
      }
    ]
  }
  response
end

#list_clustersObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fog/container_infra/openstack/requests/list_clusters.rb', line 15

def list_clusters
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "clusters" => [
      {
        "status"              => "CREATE_IN_PROGRESS",
        "cluster_template_id" => "0562d357-8641-4759-8fed-8173f02c9633",
        "uuid"                => "731387cf-a92b-4c36-981e-3271d63e5597",
        "stack_id"            => "31c1ee6c-081e-4f39-9f0f-f1d87a7defa1",
        "master_count"        => 1,
        "create_timeout"      => 60,
        "node_count"          => 1,
        "name"                => "k8s"
      }
    ]
  }
  response
end

#reset_dataObject



110
111
112
# File 'lib/fog/container_infra/openstack.rb', line 110

def reset_data
  self.class.data.delete(@openstack_username)
end

#update_bay(_uuid_or_name, _params) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/fog/container_infra/openstack/requests/update_bay.rb', line 16

def update_bay(_uuid_or_name, _params)
  response = Excon::Response.new
  response.status = 202
  response.body = {
    "uuid" => "746e779a-751a-456b-a3e9-c883d734946f"
  }
  response
end

#update_bay_model(_uuid_or_name, _params) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fog/container_infra/openstack/requests/update_bay_model.rb', line 16

def update_bay_model(_uuid_or_name, _params)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "insecure_registry"     => nil,
    "http_proxy"            => "http://10.164.177.169:8080",
    "updated_at"            => nil,
    "floating_ip_enabled"   => true,
    "fixed_subnet"          => nil,
    "master_flavor_id"      => nil,
    "uuid"                  => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
    "no_proxy"              => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
    "https_proxy"           => "http://10.164.177.169:8080",
    "tls_disabled"          => false,
    "keypair_id"            => "kp",
    "public"                => false,
    "labels"                => {},
    "docker_volume_size"    => 3,
    "server_type"           => "vm",
    "external_network_id"   => "public",
    "cluster_distro"        => "fedora-atomic",
    "image_id"              => "fedora-atomic-latest",
    "volume_driver"         => "cinder",
    "registry_enabled"      => false,
    "docker_storage_driver" => "devicemapper",
    "apiserver_port"        => nil,
    "name"                  => "rename-test-bay-model",
    "created_at"            => "2016-08-29T02:08:08+00:00",
    "network_driver"        => "flannel",
    "fixed_network"         => nil,
    "coe"                   => "kubernetes",
    "flavor_id"             => "m1.small",
    "master_lb_enabled"     => true,
    "dns_nameserver"        => "8.8.8.8",
  }
  response
end

#update_cluster(_uuid_or_name, _params) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/fog/container_infra/openstack/requests/update_cluster.rb', line 16

def update_cluster(_uuid_or_name, _params)
  response = Excon::Response.new
  response.status = 202
  response.body = {
    "uuid" => "746e779a-751a-456b-a3e9-c883d734946f"
  }
  response
end

#update_cluster_template(_uuid_or_name, _params) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fog/container_infra/openstack/requests/update_cluster_template.rb', line 16

def update_cluster_template(_uuid_or_name, _params)
  response = Excon::Response.new
  response.status = 200
  response.body = {
    "insecure_registry"     => nil,
    "http_proxy"            => "http://10.164.177.169:8080",
    "updated_at"            => nil,
    "floating_ip_enabled"   => true,
    "fixed_subnet"          => nil,
    "master_flavor_id"      => nil,
    "uuid"                  => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
    "no_proxy"              => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
    "https_proxy"           => "http://10.164.177.169:8080",
    "tls_disabled"          => false,
    "keypair_id"            => "kp",
    "public"                => false,
    "labels"                => {},
    "docker_volume_size"    => 3,
    "server_type"           => "vm",
    "external_network_id"   => "public",
    "cluster_distro"        => "fedora-atomic",
    "image_id"              => "fedora-atomic-latest",
    "volume_driver"         => "cinder",
    "registry_enabled"      => false,
    "docker_storage_driver" => "devicemapper",
    "apiserver_port"        => nil,
    "name"                  => "rename-test-cluster-template",
    "created_at"            => "2016-08-29T02:08:08+00:00",
    "network_driver"        => "flannel",
    "fixed_network"         => nil,
    "coe"                   => "kubernetes",
    "flavor_id"             => "m1.small",
    "master_lb_enabled"     => true,
    "dns_nameserver"        => "8.8.8.8"
  }
  response
end