foreman_google 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +619 -0
  3. data/README.md +33 -0
  4. data/Rakefile +47 -0
  5. data/app/controllers/concerns/foreman_google/temporary_prepend_path.rb +16 -0
  6. data/app/models/foreman_google/gce.rb +119 -0
  7. data/app/models/foreman_google/google_compute.rb +127 -0
  8. data/config/routes.rb +2 -0
  9. data/lib/foreman_google/engine.rb +42 -0
  10. data/lib/foreman_google/google_compute_adapter.rb +91 -0
  11. data/lib/foreman_google/version.rb +3 -0
  12. data/lib/foreman_google.rb +4 -0
  13. data/lib/tasks/foreman_google_tasks.rake +31 -0
  14. data/locale/Makefile +60 -0
  15. data/locale/en/foreman_google.po +19 -0
  16. data/locale/foreman_google.pot +19 -0
  17. data/locale/gemspec.rb +2 -0
  18. data/package.json +44 -0
  19. data/test/factories/gce.rb +28 -0
  20. data/test/fixtures/images_centos_cloud.json +11 -0
  21. data/test/fixtures/images_coastal.json +12 -0
  22. data/test/fixtures/images_deprecated.json +17 -0
  23. data/test/fixtures/images_nothing_found.json +5 -0
  24. data/test/fixtures/instance.json +105 -0
  25. data/test/fixtures/instance_start.json +14 -0
  26. data/test/fixtures/instance_stop.json +14 -0
  27. data/test/fixtures/machine_types.json +12 -0
  28. data/test/fixtures/networks.json +11 -0
  29. data/test/fixtures/zones.json +1750 -0
  30. data/test/models/foreman_google/gce_test.rb +31 -0
  31. data/test/models/foreman_google/google_compute_test.rb +155 -0
  32. data/test/test_google_helper.rb +24 -0
  33. data/test/unit/foreman_google/google_compute_adapter_test.rb +126 -0
  34. data/webpack/global_index.js +17 -0
  35. data/webpack/global_test_setup.js +11 -0
  36. data/webpack/index.js +7 -0
  37. data/webpack/src/Extends/index.js +15 -0
  38. data/webpack/src/Router/routes.js +5 -0
  39. data/webpack/src/reducers.js +7 -0
  40. data/webpack/test_setup.js +17 -0
  41. metadata +127 -0
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "projects/coastal-haven-123456/global/images",
3
+ "items": [
4
+ {
5
+ "id": "1",
6
+ "name": "coastal-image",
7
+ "kind": "compute#image"
8
+ }
9
+ ],
10
+ "selfLink": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/global/images",
11
+ "kind": "compute#imageList"
12
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "id": "projects/deprecated/global/images",
3
+ "items": [
4
+ {
5
+ "id": "0",
6
+ "name": "deprecated-image",
7
+ "deprecated": {
8
+ "state": "DEPRECATED",
9
+ "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20150226"
10
+ },
11
+ "status": "READY",
12
+ "kind": "compute#image"
13
+ }
14
+ ],
15
+ "selfLink": "https://www.googleapis.com/compute/v1/projects/deprecated/global/images",
16
+ "kind": "compute#imageList"
17
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "id": "projects/project-id/global/images",
3
+ "selfLink": "https://www.googleapis.com/compute/v1/projects/project-id/global/images",
4
+ "kind": "compute#imageList"
5
+ }
@@ -0,0 +1,105 @@
1
+ {
2
+ "kind": "compute#instance",
3
+ "id": "123456789",
4
+ "creationTimestamp": "2022-03-17T04:48:59.109-07:00",
5
+ "name": "instance-1",
6
+ "description": "",
7
+ "tags": {
8
+ "fingerprint": "42WmSpB8rSM="
9
+ },
10
+ "machineType": "https://www.googleapis.com/compute/v1/projectscoastal-haven-123456zones/us-east1-b/machineTypes/e2-micro",
11
+ "status": "RUNNING",
12
+ "zone": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b",
13
+ "canIpForward": false,
14
+ "networkInterfaces": [
15
+ {
16
+ "kind": "compute#networkInterface",
17
+ "network": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/global/networks/default",
18
+ "subnetwork": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/regions/us-west1/subnetworks/default",
19
+ "networkIP": "10.138.0.2",
20
+ "name": "nic0",
21
+ "accessConfigs": [
22
+ {
23
+ "kind": "compute#accessConfig",
24
+ "type": "ONE_TO_ONE_NAT",
25
+ "name": "External NAT",
26
+ "natIP": "104.199.116.69",
27
+ "networkTier": "PREMIUM"
28
+ }
29
+ ],
30
+ "fingerprint": "KAwWKldPVHg=",
31
+ "stackType": "IPV4_ONLY"
32
+ }
33
+ ],
34
+ "disks": [
35
+ {
36
+ "kind": "compute#attachedDisk",
37
+ "type": "PERSISTENT",
38
+ "mode": "READ_WRITE",
39
+ "source": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b/disks/instance-1",
40
+ "deviceName": "instance-1",
41
+ "index": 0,
42
+ "boot": true,
43
+ "autoDelete": true,
44
+ "licenses": [
45
+ "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-10-buster"
46
+ ],
47
+ "interface": "SCSI",
48
+ "guestOsFeatures": [
49
+ {
50
+ "type": "UEFI_COMPATIBLE"
51
+ },
52
+ {
53
+ "type": "VIRTIO_SCSI_MULTIQUEUE"
54
+ }
55
+ ],
56
+ "diskSizeGb": "10"
57
+ }
58
+ ],
59
+ "metadata": {
60
+ "kind": "compute#metadata",
61
+ "fingerprint": "VZF9fhZvgFg="
62
+ },
63
+ "serviceAccounts": [
64
+ {
65
+ "email": "123456789012-compute@developer.gserviceaccount.com",
66
+ "scopes": [
67
+ "https://www.googleapis.com/auth/devstorage.read_only",
68
+ "https://www.googleapis.com/auth/logging.write",
69
+ "https://www.googleapis.com/auth/monitoring.write",
70
+ "https://www.googleapis.com/auth/servicecontrol",
71
+ "https://www.googleapis.com/auth/service.management.readonly",
72
+ "https://www.googleapis.com/auth/trace.append"
73
+ ]
74
+ }
75
+ ],
76
+ "selfLink": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b/instances/instance-1",
77
+ "scheduling": {
78
+ "onHostMaintenance": "MIGRATE",
79
+ "automaticRestart": true,
80
+ "preemptible": false
81
+ },
82
+ "cpuPlatform": "Intel Broadwell",
83
+ "labelFingerprint": "42WmSpB8rSM=",
84
+ "startRestricted": false,
85
+ "deletionProtection": false,
86
+ "reservationAffinity": {
87
+ "consumeReservationType": "ANY_RESERVATION"
88
+ },
89
+ "displayDevice": {
90
+ "enableDisplay": false
91
+ },
92
+ "shieldedInstanceConfig": {
93
+ "enableSecureBoot": false,
94
+ "enableVtpm": true,
95
+ "enableIntegrityMonitoring": true
96
+ },
97
+ "shieldedInstanceIntegrityPolicy": {
98
+ "updateAutoLearnPolicy": true
99
+ },
100
+ "confidentialInstanceConfig": {
101
+ "enableConfidentialCompute": false
102
+ },
103
+ "fingerprint": "Kv-Ch7SC0Jg=",
104
+ "lastStartTimestamp": "2022-03-17T04:49:05.444-07:00"
105
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "kind": "compute#operation",
3
+ "id": "3478345788283068852",
4
+ "name": "operation-1648041819075-5dae2a33373d1-4c57a8bc-28a972b2",
5
+ "zone": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b",
6
+ "operationType": "start",
7
+ "targetLink": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b/instances/instance_name",
8
+ "targetId": "1660895424539093850",
9
+ "status": "RUNNING",
10
+ "progress": 0,
11
+ "insertTime": "2022-03-23T06:23:39.732-07:00",
12
+ "startTime": "2022-03-23T06:23:39.761-07:00",
13
+ "selfLink": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b/operations/operation-1648041819075-5dae2a33373d1-4c57a8bc-28a972b2"
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "kind": "compute#operation",
3
+ "id": "684938830361827073",
4
+ "name": "operation-1648044526108-5dae3448d80de-fba26341-5bd0d0d9",
5
+ "zone": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b",
6
+ "operationType": "stop",
7
+ "targetLink": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b/instances/instance_name",
8
+ "targetId": "791542246520823784",
9
+ "status": "RUNNING",
10
+ "progress": 0,
11
+ "insertTime": "2022-03-23T07:08:46.398-07:00",
12
+ "startTime": "2022-03-23T07:08:46.417-07:00",
13
+ "selfLink": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b/operations/operation-1648044526108-5dae3448d80de-fba26341-5bd0d0d9"
14
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "projects/coastal-haven-123456/zones/us-east1-b/machineTypes",
3
+ "items": [
4
+ {
5
+ "id": "0",
6
+ "name": "machine_type_001",
7
+ "kind": "compute#machineType"
8
+ }
9
+ ],
10
+ "selfLink": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/zones/us-east1-b/machineTypes",
11
+ "kind": "compute#machineTypeList"
12
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "projects/coastal-haven-123456/global/networks",
3
+ "items": [
4
+ {
5
+ "id": "0",
6
+ "name": "default"
7
+ }
8
+ ],
9
+ "selfLink": "https://www.googleapis.com/compute/v1/projects/coastal-haven-123456/global/networks",
10
+ "kind": "compute#networkList"
11
+ }