apcera 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/apcera.gemspec +31 -0
  3. data/lib/apcera/api/default_api.rb +128 -0
  4. data/lib/apcera/api/instances_api.rb +280 -0
  5. data/lib/apcera/api/jobs_api.rb +1428 -0
  6. data/lib/apcera/api/logs_api.rb +120 -0
  7. data/lib/apcera/api/metrics_api.rb +280 -0
  8. data/lib/apcera/api/packages_api.rb +541 -0
  9. data/lib/apcera/api/providers_api.rb +175 -0
  10. data/lib/apcera/api/rules_api.rb +228 -0
  11. data/lib/apcera/api/services_and_bindings_api.rb +278 -0
  12. data/lib/apcera/api/staging_pipelines_api.rb +281 -0
  13. data/lib/apcera/api/utilities_api.rb +327 -0
  14. data/lib/apcera/api_client.rb +294 -0
  15. data/lib/apcera/api_error.rb +24 -0
  16. data/lib/apcera/configuration.rb +173 -0
  17. data/lib/apcera/models/apc_version_object.rb +37 -0
  18. data/lib/apcera/models/api_error.rb +143 -0
  19. data/lib/apcera/models/audit_log_item.rb +117 -0
  20. data/lib/apcera/models/audit_log_item_old.rb +85 -0
  21. data/lib/apcera/models/base_object.rb +96 -0
  22. data/lib/apcera/models/binding.rb +137 -0
  23. data/lib/apcera/models/create_docker_job_request.rb +197 -0
  24. data/lib/apcera/models/create_docker_job_response.rb +37 -0
  25. data/lib/apcera/models/dependency.rb +53 -0
  26. data/lib/apcera/models/dependency_resolve.rb +45 -0
  27. data/lib/apcera/models/docker_origin.rb +63 -0
  28. data/lib/apcera/models/drain.rb +61 -0
  29. data/lib/apcera/models/drain_config.rb +53 -0
  30. data/lib/apcera/models/file_listing.rb +45 -0
  31. data/lib/apcera/models/info.rb +53 -0
  32. data/lib/apcera/models/instance_manager.rb +105 -0
  33. data/lib/apcera/models/instance_state.rb +117 -0
  34. data/lib/apcera/models/instances.rb +109 -0
  35. data/lib/apcera/models/job.rb +243 -0
  36. data/lib/apcera/models/job_health.rb +63 -0
  37. data/lib/apcera/models/job_preferences.rb +37 -0
  38. data/lib/apcera/models/log.rb +53 -0
  39. data/lib/apcera/models/metric_series.rb +49 -0
  40. data/lib/apcera/models/metric_series_hash.rb +29 -0
  41. data/lib/apcera/models/metrics.rb +49 -0
  42. data/lib/apcera/models/namespace.rb +37 -0
  43. data/lib/apcera/models/package.rb +183 -0
  44. data/lib/apcera/models/package_depends_request.rb +47 -0
  45. data/lib/apcera/models/package_info.rb +69 -0
  46. data/lib/apcera/models/package_resource.rb +61 -0
  47. data/lib/apcera/models/policy_error.rb +63 -0
  48. data/lib/apcera/models/port.rb +55 -0
  49. data/lib/apcera/models/process.rb +37 -0
  50. data/lib/apcera/models/process_object.rb +115 -0
  51. data/lib/apcera/models/provide.rb +53 -0
  52. data/lib/apcera/models/provider.rb +85 -0
  53. data/lib/apcera/models/resource.rb +69 -0
  54. data/lib/apcera/models/restart_config.rb +53 -0
  55. data/lib/apcera/models/rollout_config.rb +69 -0
  56. data/lib/apcera/models/route.rb +53 -0
  57. data/lib/apcera/models/rule.rb +101 -0
  58. data/lib/apcera/models/runtime.rb +47 -0
  59. data/lib/apcera/models/semi_pipe_rule.rb +101 -0
  60. data/lib/apcera/models/semi_pipe_rule_action.rb +37 -0
  61. data/lib/apcera/models/stager_job.rb +37 -0
  62. data/lib/apcera/models/staging_pipeline.rb +103 -0
  63. data/lib/apcera/models/sub_task.rb +61 -0
  64. data/lib/apcera/models/task.rb +87 -0
  65. data/lib/apcera/models/task_event.rb +113 -0
  66. data/lib/apcera/models/task_progress.rb +45 -0
  67. data/lib/apcera/models/unbind_parameter_object.rb +53 -0
  68. data/lib/apcera/models/unlink_parameter_object.rb +53 -0
  69. data/lib/apcera/version.rb +3 -0
  70. data/lib/apcera.rb +90 -0
  71. metadata +293 -0
@@ -0,0 +1,103 @@
1
+ module Apcera
2
+ #
3
+ class StagingPipeline < BaseObject
4
+ attr_accessor :created_at, :created_by, :fqn, :name, :stagers, :updated_at, :updated_by, :uuid, :version_id
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ # The date and time when the staging pipeline was created.
10
+ :'created_at' => :'created_at',
11
+
12
+ # Principal name of the user who created the staging pipeline.
13
+ :'created_by' => :'created_by',
14
+
15
+ # Staging pipeline&#39;s FQN.
16
+ :'fqn' => :'fqn',
17
+
18
+ # Staging pipeline&#39;s local name.
19
+ :'name' => :'name',
20
+
21
+ # The list of jobs that will be cloned in order to make the specific stager instances.
22
+ :'stagers' => :'stagers',
23
+
24
+ # The date and time when the staging pipeline was most recently updated.
25
+ :'updated_at' => :'updated_at',
26
+
27
+ # Principal name of the user who last updated the staging pipeline.
28
+ :'updated_by' => :'updated_by',
29
+
30
+ # Staging pipeline&#39;s unique identifier.
31
+ :'uuid' => :'uuid',
32
+
33
+ # Staging pipeline&#39;s auto-incremented version number.
34
+ :'version_id' => :'version_id'
35
+
36
+ }
37
+ end
38
+
39
+ # attribute type
40
+ def self.swagger_types
41
+ {
42
+ :'created_at' => :'DateTime',
43
+ :'created_by' => :'String',
44
+ :'fqn' => :'String',
45
+ :'name' => :'String',
46
+ :'stagers' => :'Array<StagerJob>',
47
+ :'updated_at' => :'DateTime',
48
+ :'updated_by' => :'String',
49
+ :'uuid' => :'String',
50
+ :'version_id' => :'String'
51
+
52
+ }
53
+ end
54
+
55
+ def initialize(attributes = {})
56
+ return if !attributes.is_a?(Hash) || attributes.empty?
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
60
+
61
+
62
+ if attributes[:'created_at']
63
+ self.created_at = attributes[:'created_at']
64
+ end
65
+
66
+ if attributes[:'created_by']
67
+ self.created_by = attributes[:'created_by']
68
+ end
69
+
70
+ if attributes[:'fqn']
71
+ self.fqn = attributes[:'fqn']
72
+ end
73
+
74
+ if attributes[:'name']
75
+ self.name = attributes[:'name']
76
+ end
77
+
78
+ if attributes[:'stagers']
79
+ if (value = attributes[:'stagers']).is_a?(Array)
80
+ self.stagers = value
81
+ end
82
+ end
83
+
84
+ if attributes[:'updated_at']
85
+ self.updated_at = attributes[:'updated_at']
86
+ end
87
+
88
+ if attributes[:'updated_by']
89
+ self.updated_by = attributes[:'updated_by']
90
+ end
91
+
92
+ if attributes[:'uuid']
93
+ self.uuid = attributes[:'uuid']
94
+ end
95
+
96
+ if attributes[:'version_id']
97
+ self.version_id = attributes[:'version_id']
98
+ end
99
+
100
+ end
101
+
102
+ end
103
+ end
@@ -0,0 +1,61 @@
1
+ module Apcera
2
+ #
3
+ class SubTask < BaseObject
4
+ attr_accessor :index, :name, :progress, :total
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ # The index of this subtask among all subtasks.
10
+ :'index' => :'index',
11
+
12
+ # A human-readable description of this subtask.
13
+ :'name' => :'name',
14
+
15
+ # Indicates how far along this unit of work is.
16
+ :'progress' => :'progress',
17
+
18
+ # The total number of subtasks in the current stage.
19
+ :'total' => :'total'
20
+
21
+ }
22
+ end
23
+
24
+ # attribute type
25
+ def self.swagger_types
26
+ {
27
+ :'index' => :'Integer',
28
+ :'name' => :'String',
29
+ :'progress' => :'TaskProgress',
30
+ :'total' => :'Integer'
31
+
32
+ }
33
+ end
34
+
35
+ def initialize(attributes = {})
36
+ return if !attributes.is_a?(Hash) || attributes.empty?
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
40
+
41
+
42
+ if attributes[:'index']
43
+ self.index = attributes[:'index']
44
+ end
45
+
46
+ if attributes[:'name']
47
+ self.name = attributes[:'name']
48
+ end
49
+
50
+ if attributes[:'progress']
51
+ self.progress = attributes[:'progress']
52
+ end
53
+
54
+ if attributes[:'total']
55
+ self.total = attributes[:'total']
56
+ end
57
+
58
+ end
59
+
60
+ end
61
+ end
@@ -0,0 +1,87 @@
1
+ module Apcera
2
+ #
3
+ class Task < BaseObject
4
+ attr_accessor :errored, :events, :state, :time_completed, :time_started, :uuid
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ # Describes the error for a Task that has encountered an error.
10
+ :'errored' => :'errored',
11
+
12
+ # List of all TaskEvents that have been published for this particular task.
13
+ :'events' => :'events',
14
+
15
+ # The Task&#39;s current state. Can be `running`, `stopped` or `complete`.
16
+ :'state' => :'state',
17
+
18
+ # Indicates the time when the task completed. Stored as a UNIX timestamp with nanosecond precision.
19
+ :'time_completed' => :'time_completed',
20
+
21
+ # Indicates the time when the task was started. Stored as a UNIX timestamp with nanosecond precision.
22
+ :'time_started' => :'time_started',
23
+
24
+ # The task&#39;s unique identifier.
25
+ :'uuid' => :'uuid'
26
+
27
+ }
28
+ end
29
+
30
+ # attribute type
31
+ def self.swagger_types
32
+ {
33
+ :'errored' => :'String',
34
+ :'events' => :'Array<TaskEvent>',
35
+ :'state' => :'String',
36
+ :'time_completed' => :'Integer',
37
+ :'time_started' => :'Integer',
38
+ :'uuid' => :'String'
39
+
40
+ }
41
+ end
42
+
43
+ def initialize(attributes = {})
44
+ return if !attributes.is_a?(Hash) || attributes.empty?
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
48
+
49
+
50
+ if attributes[:'errored']
51
+ self.errored = attributes[:'errored']
52
+ end
53
+
54
+ if attributes[:'events']
55
+ if (value = attributes[:'events']).is_a?(Array)
56
+ self.events = value
57
+ end
58
+ end
59
+
60
+ if attributes[:'state']
61
+ self.state = attributes[:'state']
62
+ end
63
+
64
+ if attributes[:'time_completed']
65
+ self.time_completed = attributes[:'time_completed']
66
+ end
67
+
68
+ if attributes[:'time_started']
69
+ self.time_started = attributes[:'time_started']
70
+ end
71
+
72
+ if attributes[:'uuid']
73
+ self.uuid = attributes[:'uuid']
74
+ end
75
+
76
+ end
77
+
78
+ def state=(state)
79
+ allowed_values = ["running", "stopped", "complete"]
80
+ if state && !allowed_values.include?(state)
81
+ fail "invalid value for 'state', must be one of #{allowed_values}"
82
+ end
83
+ @state = state
84
+ end
85
+
86
+ end
87
+ end
@@ -0,0 +1,113 @@
1
+ module Apcera
2
+ #
3
+ class TaskEvent < BaseObject
4
+ attr_accessor :payload, :stage, :subtask, :tags, :task_event_type, :task_uuid, :thread, :time, :uuid
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ # Extra information about the TaskEvent.
10
+ :'payload' => :'payload',
11
+
12
+ # A logical grouping of subtasks. A stage could be \&quot;Creating Job\&quot; or \&quot;Downloading Packages\&quot;.
13
+ :'stage' => :'stage',
14
+
15
+ # A description of the sub-task that this TaskEvent describes.
16
+ :'subtask' => :'subtask',
17
+
18
+ # An list of tags that provide a hint about what is being tracked.
19
+ :'tags' => :'tags',
20
+
21
+ # The type of message this TaskEvent contains.
22
+ :'task_event_type' => :'task_event_type',
23
+
24
+ # UUID of the Task that stores this event.
25
+ :'task_uuid' => :'task_uuid',
26
+
27
+ # Represents a logically independent procedure within a Task. For instance, a thread could be \&quot;job1\&quot; or \&quot;job2\&quot;, or \&quot;Link job1 and job2\&quot;.
28
+ :'thread' => :'thread',
29
+
30
+ # Time in UNIX nanoseconds immediately before the TaskEvent gets announced on NATS.
31
+ :'time' => :'time',
32
+
33
+ # UUID of the Task that stores this event.
34
+ :'uuid' => :'uuid'
35
+
36
+ }
37
+ end
38
+
39
+ # attribute type
40
+ def self.swagger_types
41
+ {
42
+ :'payload' => :'Hash<String, String>',
43
+ :'stage' => :'String',
44
+ :'subtask' => :'SubTask',
45
+ :'tags' => :'Array<String>',
46
+ :'task_event_type' => :'String',
47
+ :'task_uuid' => :'String',
48
+ :'thread' => :'String',
49
+ :'time' => :'Integer',
50
+ :'uuid' => :'String'
51
+
52
+ }
53
+ end
54
+
55
+ def initialize(attributes = {})
56
+ return if !attributes.is_a?(Hash) || attributes.empty?
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
60
+
61
+
62
+ if attributes[:'payload']
63
+ if (value = attributes[:'payload']).is_a?(Array)
64
+ self.payload = value
65
+ end
66
+ end
67
+
68
+ if attributes[:'stage']
69
+ self.stage = attributes[:'stage']
70
+ end
71
+
72
+ if attributes[:'subtask']
73
+ self.subtask = attributes[:'subtask']
74
+ end
75
+
76
+ if attributes[:'tags']
77
+ if (value = attributes[:'tags']).is_a?(Array)
78
+ self.tags = value
79
+ end
80
+ end
81
+
82
+ if attributes[:'task_event_type']
83
+ self.task_event_type = attributes[:'task_event_type']
84
+ end
85
+
86
+ if attributes[:'task_uuid']
87
+ self.task_uuid = attributes[:'task_uuid']
88
+ end
89
+
90
+ if attributes[:'thread']
91
+ self.thread = attributes[:'thread']
92
+ end
93
+
94
+ if attributes[:'time']
95
+ self.time = attributes[:'time']
96
+ end
97
+
98
+ if attributes[:'uuid']
99
+ self.uuid = attributes[:'uuid']
100
+ end
101
+
102
+ end
103
+
104
+ def task_event_type=(task_event_type)
105
+ allowed_values = ["event", "error", "eos", "disconnect", "cancel"]
106
+ if task_event_type && !allowed_values.include?(task_event_type)
107
+ fail "invalid value for 'task_event_type', must be one of #{allowed_values}"
108
+ end
109
+ @task_event_type = task_event_type
110
+ end
111
+
112
+ end
113
+ end
@@ -0,0 +1,45 @@
1
+ module Apcera
2
+ #
3
+ class TaskProgress < BaseObject
4
+ attr_accessor :current, :progress
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ # Current progress.
10
+ :'current' => :'current',
11
+
12
+ # Total amount of work to be done.
13
+ :'progress' => :'progress'
14
+
15
+ }
16
+ end
17
+
18
+ # attribute type
19
+ def self.swagger_types
20
+ {
21
+ :'current' => :'Float',
22
+ :'progress' => :'Float'
23
+
24
+ }
25
+ end
26
+
27
+ def initialize(attributes = {})
28
+ return if !attributes.is_a?(Hash) || attributes.empty?
29
+
30
+ # convert string to symbol for hash key
31
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
32
+
33
+
34
+ if attributes[:'current']
35
+ self.current = attributes[:'current']
36
+ end
37
+
38
+ if attributes[:'progress']
39
+ self.progress = attributes[:'progress']
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,53 @@
1
+ module Apcera
2
+ #
3
+ class UnbindParameterObject < BaseObject
4
+ attr_accessor :force, :job, :service
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ # If `true`, forces the binding to be removed and ignores errors from the backing service. Can be useful if the service is no longer available or is experiencing failures.
10
+ :'force' => :'force',
11
+
12
+ # Fully-qualified name of the job to unbind from the service specified by the `service` parameter.
13
+ :'job' => :'job',
14
+
15
+ # Fully-qualified name of the service to unbind from the job specified by the `job` parameter.
16
+ :'service' => :'service'
17
+
18
+ }
19
+ end
20
+
21
+ # attribute type
22
+ def self.swagger_types
23
+ {
24
+ :'force' => :'BOOLEAN',
25
+ :'job' => :'String',
26
+ :'service' => :'String'
27
+
28
+ }
29
+ end
30
+
31
+ def initialize(attributes = {})
32
+ return if !attributes.is_a?(Hash) || attributes.empty?
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
36
+
37
+
38
+ if attributes[:'force']
39
+ self.force = attributes[:'force']
40
+ end
41
+
42
+ if attributes[:'job']
43
+ self.job = attributes[:'job']
44
+ end
45
+
46
+ if attributes[:'service']
47
+ self.service = attributes[:'service']
48
+ end
49
+
50
+ end
51
+
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ module Apcera
2
+ #
3
+ class UnlinkParameterObject < BaseObject
4
+ attr_accessor :from_job, :port, :to_job
5
+ # attribute mapping from ruby-style variable name to JSON key
6
+ def self.attribute_map
7
+ {
8
+
9
+ # FQN of the job being linked from.
10
+ :'from_job' => :'from_job',
11
+
12
+ # The port on the target job to link to.
13
+ :'port' => :'port',
14
+
15
+ # FQN of the target job.
16
+ :'to_job' => :'to_job'
17
+
18
+ }
19
+ end
20
+
21
+ # attribute type
22
+ def self.swagger_types
23
+ {
24
+ :'from_job' => :'String',
25
+ :'port' => :'Integer',
26
+ :'to_job' => :'String'
27
+
28
+ }
29
+ end
30
+
31
+ def initialize(attributes = {})
32
+ return if !attributes.is_a?(Hash) || attributes.empty?
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
36
+
37
+
38
+ if attributes[:'from_job']
39
+ self.from_job = attributes[:'from_job']
40
+ end
41
+
42
+ if attributes[:'port']
43
+ self.port = attributes[:'port']
44
+ end
45
+
46
+ if attributes[:'to_job']
47
+ self.to_job = attributes[:'to_job']
48
+ end
49
+
50
+ end
51
+
52
+ end
53
+ end
@@ -0,0 +1,3 @@
1
+ module Apcera
2
+ VERSION = "0.1.1"
3
+ end
data/lib/apcera.rb ADDED
@@ -0,0 +1,90 @@
1
+ # Common files
2
+ require 'apcera/api_client'
3
+ require 'apcera/api_error'
4
+ require 'apcera/version'
5
+ require 'apcera/configuration'
6
+
7
+ # Models
8
+ require 'apcera/models/base_object'
9
+ require 'apcera/models/apc_version_object'
10
+ require 'apcera/models/api_error'
11
+ require 'apcera/models/audit_log_item'
12
+ require 'apcera/models/audit_log_item_old'
13
+ require 'apcera/models/binding'
14
+ require 'apcera/models/create_docker_job_request'
15
+ require 'apcera/models/create_docker_job_response'
16
+ require 'apcera/models/dependency'
17
+ require 'apcera/models/dependency_resolve'
18
+ require 'apcera/models/docker_origin'
19
+ require 'apcera/models/drain'
20
+ require 'apcera/models/drain_config'
21
+ require 'apcera/models/file_listing'
22
+ require 'apcera/models/info'
23
+ require 'apcera/models/instance_manager'
24
+ require 'apcera/models/instance_state'
25
+ require 'apcera/models/instances'
26
+ require 'apcera/models/job'
27
+ require 'apcera/models/job_health'
28
+ require 'apcera/models/job_preferences'
29
+ require 'apcera/models/log'
30
+ require 'apcera/models/metric_series'
31
+ require 'apcera/models/metric_series_hash'
32
+ require 'apcera/models/metrics'
33
+ require 'apcera/models/namespace'
34
+ require 'apcera/models/package'
35
+ require 'apcera/models/package_depends_request'
36
+ require 'apcera/models/package_info'
37
+ require 'apcera/models/package_resource'
38
+ require 'apcera/models/policy_error'
39
+ require 'apcera/models/port'
40
+ require 'apcera/models/process'
41
+ require 'apcera/models/process_object'
42
+ require 'apcera/models/provide'
43
+ require 'apcera/models/provider'
44
+ require 'apcera/models/resource'
45
+ require 'apcera/models/restart_config'
46
+ require 'apcera/models/rollout_config'
47
+ require 'apcera/models/route'
48
+ require 'apcera/models/rule'
49
+ require 'apcera/models/runtime'
50
+ require 'apcera/models/semi_pipe_rule'
51
+ require 'apcera/models/semi_pipe_rule_action'
52
+ require 'apcera/models/stager_job'
53
+ require 'apcera/models/staging_pipeline'
54
+ require 'apcera/models/sub_task'
55
+ require 'apcera/models/task'
56
+ require 'apcera/models/task_event'
57
+ require 'apcera/models/task_progress'
58
+ require 'apcera/models/unbind_parameter_object'
59
+ require 'apcera/models/unlink_parameter_object'
60
+
61
+ # APIs
62
+ require 'apcera/api/instances_api'
63
+ require 'apcera/api/utilities_api'
64
+ require 'apcera/api/metrics_api'
65
+ require 'apcera/api/jobs_api'
66
+ require 'apcera/api/packages_api'
67
+ require 'apcera/api/services_and_bindings_api'
68
+ require 'apcera/api/logs_api'
69
+ require 'apcera/api/providers_api'
70
+ require 'apcera/api/default_api'
71
+ require 'apcera/api/rules_api'
72
+ require 'apcera/api/staging_pipelines_api'
73
+
74
+ module Apcera
75
+ class << self
76
+ # Configure sdk using block.
77
+ # Apcera.configure do |config|
78
+ # config.username = "xxx"
79
+ # config.password = "xxx"
80
+ # end
81
+ # If no block given, return the configuration singleton instance.
82
+ def configure
83
+ if block_given?
84
+ yield Configuration.instance
85
+ else
86
+ Configuration.instance
87
+ end
88
+ end
89
+ end
90
+ end