fog-openstack 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/examples/container_infra/basics.rb +61 -0
  4. data/examples/identity/basics_v3.rb +83 -0
  5. data/lib/fog/container_infra/openstack.rb +163 -0
  6. data/lib/fog/container_infra/openstack/models/base.rb +19 -0
  7. data/lib/fog/container_infra/openstack/models/bay.rb +56 -0
  8. data/lib/fog/container_infra/openstack/models/bay_model.rb +62 -0
  9. data/lib/fog/container_infra/openstack/models/bay_models.rb +23 -0
  10. data/lib/fog/container_infra/openstack/models/bays.rb +23 -0
  11. data/lib/fog/container_infra/openstack/models/certificate.rb +20 -0
  12. data/lib/fog/container_infra/openstack/models/certificates.rb +25 -0
  13. data/lib/fog/container_infra/openstack/models/cluster.rb +56 -0
  14. data/lib/fog/container_infra/openstack/models/cluster_template.rb +61 -0
  15. data/lib/fog/container_infra/openstack/models/cluster_templates.rb +24 -0
  16. data/lib/fog/container_infra/openstack/models/clusters.rb +24 -0
  17. data/lib/fog/container_infra/openstack/requests/create_bay.rb +27 -0
  18. data/lib/fog/container_infra/openstack/requests/create_bay_model.rb +56 -0
  19. data/lib/fog/container_infra/openstack/requests/create_certificate.rb +29 -0
  20. data/lib/fog/container_infra/openstack/requests/create_cluster.rb +27 -0
  21. data/lib/fog/container_infra/openstack/requests/create_cluster_template.rb +56 -0
  22. data/lib/fog/container_infra/openstack/requests/delete_bay.rb +24 -0
  23. data/lib/fog/container_infra/openstack/requests/delete_bay_model.rb +24 -0
  24. data/lib/fog/container_infra/openstack/requests/delete_cluster.rb +24 -0
  25. data/lib/fog/container_infra/openstack/requests/delete_cluster_template.rb +24 -0
  26. data/lib/fog/container_infra/openstack/requests/get_bay.rb +51 -0
  27. data/lib/fog/container_infra/openstack/requests/get_bay_model.rb +55 -0
  28. data/lib/fog/container_infra/openstack/requests/get_certificate.rb +27 -0
  29. data/lib/fog/container_infra/openstack/requests/get_cluster.rb +41 -0
  30. data/lib/fog/container_infra/openstack/requests/get_cluster_template.rb +55 -0
  31. data/lib/fog/container_infra/openstack/requests/list_bay_models.rb +69 -0
  32. data/lib/fog/container_infra/openstack/requests/list_bays.rb +55 -0
  33. data/lib/fog/container_infra/openstack/requests/list_cluster_templates.rb +59 -0
  34. data/lib/fog/container_infra/openstack/requests/list_clusters.rb +37 -0
  35. data/lib/fog/container_infra/openstack/requests/update_bay.rb +27 -0
  36. data/lib/fog/container_infra/openstack/requests/update_bay_model.rb +56 -0
  37. data/lib/fog/container_infra/openstack/requests/update_cluster.rb +27 -0
  38. data/lib/fog/container_infra/openstack/requests/update_cluster_template.rb +56 -0
  39. data/lib/fog/key_manager/openstack.rb +103 -0
  40. data/lib/fog/key_manager/openstack/models/container.rb +44 -0
  41. data/lib/fog/key_manager/openstack/models/containers.rb +25 -0
  42. data/lib/fog/key_manager/openstack/models/secret.rb +53 -0
  43. data/lib/fog/key_manager/openstack/models/secrets.rb +25 -0
  44. data/lib/fog/key_manager/openstack/requests/create_container.rb +19 -0
  45. data/lib/fog/key_manager/openstack/requests/create_secret.rb +19 -0
  46. data/lib/fog/key_manager/openstack/requests/delete_container.rb +18 -0
  47. data/lib/fog/key_manager/openstack/requests/delete_secret.rb +18 -0
  48. data/lib/fog/key_manager/openstack/requests/get_container.rb +18 -0
  49. data/lib/fog/key_manager/openstack/requests/get_secret.rb +18 -0
  50. data/lib/fog/key_manager/openstack/requests/get_secret_metadata.rb +18 -0
  51. data/lib/fog/key_manager/openstack/requests/get_secret_payload.rb +21 -0
  52. data/lib/fog/key_manager/openstack/requests/list_containers.rb +19 -0
  53. data/lib/fog/key_manager/openstack/requests/list_secrets.rb +19 -0
  54. data/lib/fog/network/openstack.rb +50 -1
  55. data/lib/fog/network/openstack/requests/create_lbaas_healthmonitor.rb +57 -0
  56. data/lib/fog/network/openstack/requests/create_lbaas_listener.rb +55 -0
  57. data/lib/fog/network/openstack/requests/create_lbaas_loadbalancer.rb +52 -0
  58. data/lib/fog/network/openstack/requests/create_lbaas_pool.rb +53 -0
  59. data/lib/fog/network/openstack/requests/create_lbaas_pool_member.rb +49 -0
  60. data/lib/fog/network/openstack/requests/delete_lbaas_healthmonitor.rb +28 -0
  61. data/lib/fog/network/openstack/requests/delete_lbaas_listener.rb +28 -0
  62. data/lib/fog/network/openstack/requests/delete_lbaas_loadbalancer.rb +28 -0
  63. data/lib/fog/network/openstack/requests/delete_lbaas_pool.rb +28 -0
  64. data/lib/fog/network/openstack/requests/delete_lbaas_pool_member.rb +28 -0
  65. data/lib/fog/network/openstack/requests/get_lbaas_healthmonitor.rb +28 -0
  66. data/lib/fog/network/openstack/requests/get_lbaas_listener.rb +28 -0
  67. data/lib/fog/network/openstack/requests/get_lbaas_loadbalancer.rb +28 -0
  68. data/lib/fog/network/openstack/requests/get_lbaas_pool.rb +28 -0
  69. data/lib/fog/network/openstack/requests/get_lbaas_pool_member.rb +28 -0
  70. data/lib/fog/network/openstack/requests/list_lbaas_healthmonitors.rb +25 -0
  71. data/lib/fog/network/openstack/requests/list_lbaas_listeners.rb +25 -0
  72. data/lib/fog/network/openstack/requests/list_lbaas_loadbalancers.rb +25 -0
  73. data/lib/fog/network/openstack/requests/list_lbaas_pool_members.rb +25 -0
  74. data/lib/fog/network/openstack/requests/list_lbaas_pools.rb +25 -0
  75. data/lib/fog/network/openstack/requests/update_lbaas_healthmonitor.rb +43 -0
  76. data/lib/fog/network/openstack/requests/update_lbaas_listener.rb +45 -0
  77. data/lib/fog/network/openstack/requests/update_lbaas_loadbalancer.rb +41 -0
  78. data/lib/fog/network/openstack/requests/update_lbaas_pool.rb +40 -0
  79. data/lib/fog/network/openstack/requests/update_lbaas_pool_member.rb +39 -0
  80. data/lib/fog/openstack.rb +10 -0
  81. data/lib/fog/openstack/version.rb +7 -1
  82. metadata +78 -2
@@ -0,0 +1,24 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def delete_bay(uuid_or_name)
6
+ request(
7
+ :expects => [204],
8
+ :method => 'DELETE',
9
+ :path => "bays/#{uuid_or_name}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def delete_bay(_uuid_or_name)
16
+ response = Excon::Response.new
17
+ response.status = 204
18
+ response.body = {}
19
+ response
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def delete_bay_model(uuid_or_name)
6
+ request(
7
+ :expects => [204],
8
+ :method => 'DELETE',
9
+ :path => "baymodels/#{uuid_or_name}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def delete_bay_model(_uuid_or_name)
16
+ response = Excon::Response.new
17
+ response.status = 204
18
+ response.body = {}
19
+ response
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def delete_cluster(uuid_or_name)
6
+ request(
7
+ :expects => [204],
8
+ :method => 'DELETE',
9
+ :path => "clusters/#{uuid_or_name}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def delete_cluster(_uuid_or_name)
16
+ response = Excon::Response.new
17
+ response.status = 204
18
+ response.body = {}
19
+ response
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def delete_cluster_template(uuid_or_name)
6
+ request(
7
+ :expects => [204],
8
+ :method => 'DELETE',
9
+ :path => "clustertemplates/#{uuid_or_name}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def delete_cluster_template(_uuid_or_name)
16
+ response = Excon::Response.new
17
+ response.status = 204
18
+ response.body = {}
19
+ response
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,51 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def get_bay(uuid_or_name)
6
+ request(
7
+ :expects => [200],
8
+ :method => 'GET',
9
+ :path => "bays/#{uuid_or_name}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def get_bay(_uuid_or_name)
16
+ response = Excon::Response.new
17
+ response.status = 200
18
+ response.body = {
19
+ "status" => "CREATE_COMPLETE",
20
+ "uuid" => "746e779a-751a-456b-a3e9-c883d734946f",
21
+ "stack_id" => "9c6f1169-7300-4d08-a444-d2be38758719",
22
+ "created_at" => "2016-08-29T06:51:31+00:00",
23
+ "api_address" => "https://172.24.4.6:6443",
24
+ "discovery_url" => "https://discovery.etcd.io/cbeb580da58915809d59ee69348a84f3",
25
+ "updated_at" => "2016-08-29T06:53:24+00:00",
26
+ "master_count" => 1,
27
+ "coe_version" => "v1.2.0",
28
+ "baymodel_id" => "0562d357-8641-4759-8fed-8173f02c9633",
29
+ "master_addresses" => ["172.24.4.6"],
30
+ "node_count" => 1,
31
+ "node_addresses" => ["172.24.4.13"],
32
+ "status_reason" => "Stack CREATE completed successfully",
33
+ "bay_create_timeout" => 60,
34
+ "name" => "k8s",
35
+ "links" => [
36
+ {
37
+ "href" => "http://10.164.180.104:9511/v1/bays/746e779a-751a-456b-a3e9-c883d734946f",
38
+ "rel" => "self"
39
+ },
40
+ {
41
+ "href" => "http://10.164.180.104:9511/bays/746e779a-751a-456b-a3e9-c883d734946f",
42
+ "rel" => "bookmark"
43
+ }
44
+ ]
45
+ }
46
+ response
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,55 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def get_bay_model(uuid_or_name)
6
+ request(
7
+ :expects => [200],
8
+ :method => 'GET',
9
+ :path => "baymodels/#{uuid_or_name}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def get_bay_model(_uuid_or_name)
16
+ response = Excon::Response.new
17
+ response.status = 200
18
+ response.body = {
19
+ "insecure_registry" => nil,
20
+ "http_proxy" => "http://10.164.177.169:8080",
21
+ "updated_at" => nil,
22
+ "floating_ip_enabled" => true,
23
+ "fixed_subnet" => nil,
24
+ "master_flavor_id" => nil,
25
+ "uuid" => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
26
+ "no_proxy" => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
27
+ "https_proxy" => "http://10.164.177.169:8080",
28
+ "tls_disabled" => false,
29
+ "keypair_id" => "kp",
30
+ "public" => false,
31
+ "labels" => {},
32
+ "docker_volume_size" => 3,
33
+ "server_type" => "vm",
34
+ "external_network_id" => "public",
35
+ "cluster_distro" => "fedora-atomic",
36
+ "image_id" => "fedora-atomic-latest",
37
+ "volume_driver" => "cinder",
38
+ "registry_enabled" => false,
39
+ "docker_storage_driver" => "devicemapper",
40
+ "apiserver_port" => nil,
41
+ "name" => "k8s-bm2",
42
+ "created_at" => "2016-08-29T02:08:08+00:00",
43
+ "network_driver" => "flannel",
44
+ "fixed_network" => nil,
45
+ "coe" => "kubernetes",
46
+ "flavor_id" => "m1.small",
47
+ "master_lb_enabled" => true,
48
+ "dns_nameserver" => "8.8.8.8"
49
+ }
50
+ response
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,27 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def get_certificate(bay_uuid)
6
+ request(
7
+ :expects => [200],
8
+ :method => 'GET',
9
+ :path => "certificates/#{cluster_uuid}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def get_certificate(_bay_uuid)
16
+ response = Excon::Response.new
17
+ response.status = 200
18
+ response.body = {
19
+ "pem" => "-----BEGIN CERTIFICATE-----\nMIICzDCCAbSgAwIBAgIQOOkVcEN7TNa9E80GoUs4xDANBgkqhkiG9w0BAQsFADAO\n-----END CERTIFICATE-----\n",
20
+ "bay_uuid" => "0b4b766f-1500-44b3-9804-5a6e12fe6df4"
21
+ }
22
+ response
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,41 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def get_cluster(uuid_or_name)
6
+ request(
7
+ :expects => [200],
8
+ :method => 'GET',
9
+ :path => "clusters/#{uuid_or_name}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def get_cluster(_uuid_or_name)
16
+ response = Excon::Response.new
17
+ response.status = 200
18
+ response.body = {
19
+ "status" => "CREATE_COMPLETE",
20
+ "uuid" => "746e779a-751a-456b-a3e9-c883d734946f",
21
+ "stack_id" => "9c6f1169-7300-4d08-a444-d2be38758719",
22
+ "created_at" => "2016-08-29T06:51:31+00:00",
23
+ "api_address" => "https://172.24.4.6:6443",
24
+ "discovery_url" => "https://discovery.etcd.io/cbeb580da58915809d59ee69348a84f3",
25
+ "updated_at" => "2016-08-29T06:53:24+00:00",
26
+ "master_count" => 1,
27
+ "coe_version" => "v1.2.0",
28
+ "cluster_template_id" => "0562d357-8641-4759-8fed-8173f02c9633",
29
+ "master_addresses" => ["172.24.4.6"],
30
+ "node_count" => 1,
31
+ "node_addresses" => ["172.24.4.13"],
32
+ "status_reason" => "Stack CREATE completed successfully",
33
+ "create_timeout" => 60,
34
+ "name" => "k8s"
35
+ }
36
+ response
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,55 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def get_cluster_template(uuid_or_name)
6
+ request(
7
+ :expects => [200],
8
+ :method => 'GET',
9
+ :path => "clustertemplates/#{uuid_or_name}"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def get_cluster_template(_uuid_or_name)
16
+ response = Excon::Response.new
17
+ response.status = 200
18
+ response.body = {
19
+ "insecure_registry" => nil,
20
+ "http_proxy" => "http://10.164.177.169:8080",
21
+ "updated_at" => nil,
22
+ "floating_ip_enabled" => true,
23
+ "fixed_subnet" => nil,
24
+ "master_flavor_id" => nil,
25
+ "uuid" => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
26
+ "no_proxy" => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
27
+ "https_proxy" => "http://10.164.177.169:8080",
28
+ "tls_disabled" => false,
29
+ "keypair_id" => "kp",
30
+ "public" => false,
31
+ "labels" => {},
32
+ "docker_volume_size" => 3,
33
+ "server_type" => "vm",
34
+ "external_network_id" => "public",
35
+ "cluster_distro" => "fedora-atomic",
36
+ "image_id" => "fedora-atomic-latest",
37
+ "volume_driver" => "cinder",
38
+ "registry_enabled" => false,
39
+ "docker_storage_driver" => "devicemapper",
40
+ "apiserver_port" => nil,
41
+ "name" => "k8s-bm2",
42
+ "created_at" => "2016-08-29T02:08:08+00:00",
43
+ "network_driver" => "flannel",
44
+ "fixed_network" => nil,
45
+ "coe" => "kubernetes",
46
+ "flavor_id" => "m1.small",
47
+ "master_lb_enabled" => true,
48
+ "dns_nameserver" => "8.8.8.8"
49
+ }
50
+ response
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,69 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def list_bay_models
6
+ request(
7
+ :expects => [200],
8
+ :method => 'GET',
9
+ :path => "baymodels/detail"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def list_bay_models
16
+ response = Excon::Response.new
17
+ response.status = 200
18
+ response.body = {
19
+ "baymodels" => [
20
+ {
21
+ "insecure_registry" => nil,
22
+ "http_proxy" => "http://10.164.177.169:8080",
23
+ "updated_at" => nil,
24
+ "floating_ip_enabled" => true,
25
+ "fixed_subnet" => nil,
26
+ "master_flavor_id" => nil,
27
+ "uuid" => "085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
28
+ "no_proxy" => "10.0.0.0/8,172.0.0.0/8,192.0.0.0/8,localhost",
29
+ "https_proxy" => "http://10.164.177.169:8080",
30
+ "tls_disabled" => false,
31
+ "keypair_id" => "kp",
32
+ "public" => false,
33
+ "labels" => {},
34
+ "docker_volume_size" => 3,
35
+ "server_type" => "vm",
36
+ "external_network_id" => "public",
37
+ "cluster_distro" => "fedora-atomic",
38
+ "image_id" => "fedora-atomic-latest",
39
+ "volume_driver" => "cinder",
40
+ "registry_enabled" => false,
41
+ "docker_storage_driver" => "devicemapper",
42
+ "apiserver_port" => nil,
43
+ "name" => "k8s-bm2",
44
+ "created_at" => "2016-08-29T02:08:08+00:00",
45
+ "network_driver" => "flannel",
46
+ "fixed_network" => nil,
47
+ "coe" => "kubernetes",
48
+ "flavor_id" => "m1.small",
49
+ "master_lb_enabled" => true,
50
+ "dns_nameserver" => "8.8.8.8",
51
+ "links" => [
52
+ {
53
+ "href" => "http://10.164.180.104:9511/v1/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
54
+ "rel" => "self"
55
+ },
56
+ {
57
+ "href" => "http://10.164.180.104:9511/baymodels/085e1c4d-4f68-4bfd-8462-74b9e14e4f39",
58
+ "rel" => "bookmark"
59
+ }
60
+ ]
61
+ }
62
+ ]
63
+ }
64
+ response
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,55 @@
1
+ module Fog
2
+ module ContainerInfra
3
+ class OpenStack
4
+ class Real
5
+ def list_bays
6
+ request(
7
+ :expects => [200],
8
+ :method => 'GET',
9
+ :path => "bays/detail"
10
+ )
11
+ end
12
+ end
13
+
14
+ class Mock
15
+ def list_bays
16
+ response = Excon::Response.new
17
+ response.status = 200
18
+ response.body = {
19
+ "bays" => [
20
+ {
21
+ "status" => "CREATE_COMPLETE",
22
+ "uuid" => "746e779a-751a-456b-a3e9-c883d734946f",
23
+ "stack_id" => "9c6f1169-7300-4d08-a444-d2be38758719",
24
+ "created_at" => "2016-08-29T06:51:31+00:00",
25
+ "api_address" => "https://172.24.4.6:6443",
26
+ "discovery_url" => "https://discovery.etcd.io/cbeb580da58915809d59ee69348a84f3",
27
+ "updated_at" => "2016-08-29T06:53:24+00:00",
28
+ "master_count" => 1,
29
+ "coe_version" => "v1.2.0",
30
+ "baymodel_id" => "0562d357-8641-4759-8fed-8173f02c9633",
31
+ "master_addresses" => ["172.24.4.6"],
32
+ "node_count" => 1,
33
+ "node_addresses" => ["172.24.4.13"],
34
+ "status_reason" => "Stack CREATE completed successfully",
35
+ "bay_create_timeout" => 60,
36
+ "name" => "k8s",
37
+ "links" => [
38
+ {
39
+ "href" => "http://10.164.180.104:9511/v1/bays/746e779a-751a-456b-a3e9-c883d734946f",
40
+ "rel" => "self"
41
+ },
42
+ {
43
+ "href" => "http://10.164.180.104:9511/bays/746e779a-751a-456b-a3e9-c883d734946f",
44
+ "rel" => "bookmark"
45
+ }
46
+ ]
47
+ }
48
+ ]
49
+ }
50
+ response
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end