diff --git a/Makefile b/Makefile index 87685a0..89e609b 100644 --- a/Makefile +++ b/Makefile @@ -48,18 +48,19 @@ deb_%: clean docker_build_% itest_%: deb_% @echo "Built package for $*" -gen-paasta-api: +openapi-codegen: rm -rf pkg/paastaapi mkdir -p pkg/paastaapi - rm swagger.json - curl -o swagger.json https://raw.githubusercontent.com/Yelp/paasta/master/paasta_tools/api/api_docs/swagger.json - docker run \ - --rm -it \ - --user "$$(id -u):$$(id -g)" \ - -e GOPATH=$$HOME/go:/go \ - -v $$HOME:$$HOME \ - -w $$(pwd) quay.io/goswagger/swagger \ - generate client -f ./swagger.json -t pkg/paastaapi + rm -f oapi.yaml + curl -o oapi.yaml https://raw.githubusercontent.com/Yelp/paasta/oapi/paasta_tools/api/api_docs/oapi.yaml + docker run --rm -i --user `id -u`:`id -g` -v `pwd`:/src \ + openapitools/openapi-generator-cli generate \ + -i /src/oapi.yaml \ + -g go-experimental \ + --package-name paastaapi \ + --additional-properties=apiDocs=false,modelDocs=false,modelTests=false \ + -o /src/pkg/paastaapi + find pkg/paastaapi -type f ! -name *.go -delete @echo "Due to bug in goswagger you may need to add an import for paastaapi/client/operations" @echo "in pkg/paastaapi/client/paasta_client.go, run 'go build ./...' to check." @echo diff --git a/go.mod b/go.mod index d118d67..03c1fba 100644 --- a/go.mod +++ b/go.mod @@ -4,11 +4,6 @@ require ( github.com/dlespiau/kube-test-harness v0.0.0-20190930170435-ec3f93e1a754 github.com/fatih/structs v1.1.0 github.com/go-logr/zapr v0.1.1 // indirect - github.com/go-openapi/errors v0.19.4 - github.com/go-openapi/runtime v0.19.15 - github.com/go-openapi/strfmt v0.19.5 - github.com/go-openapi/swag v0.19.5 - github.com/go-openapi/validate v0.19.8 github.com/gogo/protobuf v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect github.com/hashicorp/golang-lru v0.5.3 // indirect @@ -25,7 +20,7 @@ require ( github.com/subosito/gotenv v1.2.0 go.uber.org/zap v1.13.0 // indirect golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect - golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // from openapi-codegen golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect gopkg.in/yaml.v2 v2.2.4 k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b diff --git a/go.sum b/go.sum index cd4d9e5..3d48679 100644 --- a/go.sum +++ b/go.sum @@ -315,6 +315,7 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/oapi.yaml b/oapi.yaml new file mode 100644 index 0000000..a24d66c --- /dev/null +++ b/oapi.yaml @@ -0,0 +1,1263 @@ +# Please run `make openapi-codegen` after modifying this file +openapi: 3.0.0 +info: + title: Paasta API + version: 1.0.0 +servers: +- url: "{scheme}://{host}/{basePath}" + variables: + basePath: {default: v1} + host: {default: localhost} + scheme: {default: http, enum: [http, https]} +tags: +- description: Information about a paasta service. + name: service +components: + schemas: + AdhocLaunchHistory: + description: A single run + properties: + framework_id: + description: framework id + type: string + launch_time: + description: when the job was launched + type: string + run_id: + description: id of the single run + type: string + type: object + DeployQueue: + description: Current state of the deployd queue + properties: + available_service_instances: + description: Service instances that are ready to be acted on by deployd + items: + $ref: '#/components/schemas/DeployQueueServiceInstance' + type: array + unavailable_service_instances: + description: Service instances that deployd is waiting to act on + items: + $ref: '#/components/schemas/DeployQueueServiceInstance' + type: array + type: object + DeployQueueServiceInstance: + description: An instance of a service in the deploy queue + properties: + bounce_by: + description: Desired timestamp by which the service instance should be bounced + format: float + type: number + bounce_start_time: + description: Timestamp at which service instance was first added to the + queue + format: float + type: number + enqueue_time: + description: Timestamp at which the service instance was last added to the + queue + format: float + type: number + failures: + description: Number of times deployment actions have failed on this service + instance + format: int32 + type: integer + instance: + description: Name of the instance of the service + type: string + processed_count: + description: Number of times any deployment action has been taken on this + service instance + format: int32 + type: integer + service: + description: Name of the service + type: string + wait_until: + description: Timestamp before which no action should be taken on this service + instance + format: float + type: number + watcher: + description: The process that enqueued the task + type: string + type: object + EnvoyBackend: + properties: + address: + description: Address of the host on which the backend is running + type: string + eds_health_status: + description: Status of the backend in Envoy as reported by the EDS + type: string + has_associated_task: + description: Whether this backend has an associated task running + type: boolean + hostname: + description: Name of the host on which the backend is running + type: string + port_value: + description: Port number on which the backend responds + format: int32 + type: integer + weight: + description: The weight of this backend in the cluster + format: int32 + type: integer + type: object + EnvoyLocation: + properties: + backends: + description: Envoy backends running in this location + items: + $ref: '#/components/schemas/EnvoyBackend' + type: array + is_proxied_through_casper: + description: Whether this backend is proxied through Casper + type: boolean + name: + description: Name of the location + type: string + running_backends_count: + description: Number of running backends for the service in this location + format: int32 + type: integer + type: object + EnvoyStatus: + properties: + expected_backends_per_location: + description: Number of backends expected to be present in each location + format: int32 + type: integer + locations: + description: Locations the service is deployed + items: + $ref: '#/components/schemas/EnvoyLocation' + type: array + registration: + description: Registration name of the service in Smartstack + type: string + type: object + FloatAndError: + properties: + error_message: + type: string + value: + format: float + type: number + type: object + HPAMetric: + properties: + current_value: + description: setpoint/target_value as specified in yelpsoa_configs + type: string + name: + description: name of the metric + type: string + target_value: + description: setpoint/target_value as specified in yelpsoa_configs + type: string + type: object + InstanceDelay: + type: object + InstanceMetadataKafkaCluster: + description: Kafka instance metadata + type: object + InstanceSpecKafkaCluster: + description: Kafka instance spec + type: object + InstanceStatus: + properties: + adhoc: + $ref: '#/components/schemas/InstanceStatusAdhoc' + description: Adhoc instance status + flink: + description: Nullable Flink instance status and metadata + properties: + metadata: + $ref: '#/components/schemas/InstanceStatusFlinkMetadata' + status: + $ref: '#/components/schemas/InstanceStatusFlinkStatus' + type: object + git_sha: + description: Git sha of a service + type: string + instance: + description: Instance name + type: string + kafkacluster: + description: Nullable KafkaCluster instance status and metadata + properties: + metadata: + $ref: '#/components/schemas/InstanceMetadataKafkaCluster' + status: + $ref: '#/components/schemas/InstanceStatusKafkaCluster' + type: object + kubernetes: + $ref: '#/components/schemas/InstanceStatusKubernetes' + description: Kubernetes instance status + marathon: + $ref: '#/components/schemas/InstanceStatusMarathon' + description: Marathon instance status + service: + description: Service name + type: string + tron: + $ref: '#/components/schemas/InstanceStatusTron' + description: Tron instance status + type: object + InstanceStatusAdhoc: + description: List of runs associated with job + items: + $ref: '#/components/schemas/AdhocLaunchHistory' + type: array + InstanceStatusFlinkMetadata: + description: Flink instance metadata + type: object + InstanceStatusFlinkStatus: + description: Flink instance status + type: object + InstanceStatusKafkaCluster: + description: Kafka instance status + type: object + InstanceStatusKubernetes: + properties: + app_count: + description: The number of different running versions of the same service + (0 for stopped, 1 for running and 1+ for bouncing) + format: int32 + type: integer + app_id: + description: ID of the desired version of a service instance + type: string + autoscaling_status: + description: HPA associated to this app + properties: + desired_replicas: + description: desired number of _instances as calculated by HPA + type: integer + last_scale_time: + description: timestamp of last autoscale + type: string + max_instances: + description: min_instances as specified in yelpsoa_configs + type: integer + metrics: + description: Current metrics + items: + $ref: '#/components/schemas/HPAMetric' + type: array + min_instances: + description: min_instances as specified in yelpsoa_configs + type: integer + type: object + backoff_seconds: + description: backoff in seconds before launching the next task + format: int32 + type: integer + bounce_method: + description: Method to transit between new and old versions of a service + enum: + - brutal + - upthendown + - downthenup + - crossover + type: string + create_timestamp: + description: Unix timestamp when this app was created + format: float + type: number + deploy_status: + description: Deploy status of a Kubernetes service + enum: + - Running + - Deploying + - Stopped + - Delayed + - Waiting + - NotRunning + type: string + deploy_status_message: + description: Reason for the deploy status + type: string + desired_state: + description: Desired state of a service, for Kubernetes + enum: + - start + - stop + type: string + error_message: + description: Error message when a kubernetes object (Deployment/Statefulset) + cannot be found + type: string + expected_instance_count: + description: The number of desired instances of the service + format: int32 + type: integer + namespace: + description: The namespace this app is running + type: string + pods: + description: Pods associated to this app + items: + $ref: '#/components/schemas/KubernetesPod' + type: array + replicasets: + description: ReplicaSets associated to this app + items: + $ref: '#/components/schemas/KubernetesReplicaSet' + type: array + running_instance_count: + description: The number of actual running instances of the service + format: int32 + type: integer + smartstack: + $ref: '#/components/schemas/SmartstackStatus' + description: Status of the service in smartstack + required: + - desired_state + - app_count + - bounce_method + type: object + InstanceStatusMarathon: + properties: + app_count: + description: The number of different running versions of the same service + (0 for stopped, 1 for running and 1+ for bouncing) + format: int32 + type: integer + app_statuses: + description: Statuses of each app of the service + items: + $ref: '#/components/schemas/MarathonAppStatus' + type: array + autoscaling_info: + $ref: '#/components/schemas/MarathonAutoscalingInfo' + description: Autoscaling information for the service + backoff_seconds: + description: backoff in seconds before launching the next task + format: int32 + type: integer + bounce_method: + description: Method to transit between new and old versions of a service + enum: + - brutal + - upthendown + - downthenup + - crossover + type: string + deploy_status: + description: Deploy status of a marathon service + enum: + - Running + - Deploying + - Stopped + - Delayed + - Waiting + - Waiting for bounce + - NotRunning + type: string + desired_app_id: + description: ID of the desired version of a service instance + type: string + desired_state: + description: Desired state of a service, for Marathon + enum: + - start + - stop + type: string + envoy: + $ref: '#/components/schemas/EnvoyStatus' + description: Status of the service in Envoy + error_message: + description: Error message when a marathon job ID cannot be found + type: string + expected_instance_count: + description: The number of desired instances of the service + format: int32 + type: integer + mesos: + $ref: '#/components/schemas/MarathonMesosStatus' + description: Status of the service in Mesos + running_instance_count: + description: The number of actual running instances of the service + format: int32 + type: integer + smartstack: + $ref: '#/components/schemas/SmartstackStatus' + description: Status of the service in smartstack + required: + - desired_state + - app_count + - bounce_method + type: object + InstanceStatusTron: + properties: + action_command: + description: The command of the action + type: string + action_name: + description: The name of the action + type: string + action_raw_command: + description: The raw command of the action + type: string + action_start_time: + description: The start time of the action + type: string + action_state: + description: The state of the action + type: string + action_stderr: + description: The stderr command of the action + type: string + action_stdout: + description: The stdout command of the action + type: string + job_name: + description: The name of this job + type: string + job_schedule: + description: The job schedule of the job + type: string + job_status: + description: The status of the job + type: string + job_url: + description: The dashboard url of the job + type: string + required: + - job_name + - job_url + type: object + InstanceTask: + type: object + InstanceTasks: + description: List of tasks associated with instance + items: + $ref: '#/components/schemas/InstanceTask' + type: array + IntegerAndError: + properties: + error_message: + type: string + value: + format: int32 + type: integer + type: object + KubernetesContainer: + properties: + name: + description: Name of the container + type: string + tail_lines: + $ref: '#/components/schemas/TaskTailLines' + description: Stdout and stderr tail of the container + type: object + KubernetesPod: + properties: + containers: + items: + $ref: '#/components/schemas/KubernetesContainer' + description: List of containers in the pod + type: array + deployed_timestamp: + description: Time at which the pod was deployed + format: float + type: number + host: + description: name of the pod's host + type: string + message: + description: long message explaining the pod's state + nullable: true + type: string + name: + description: name of the pod in Kubernetes + type: string + phase: + description: The status of the pod + type: string + ready: + description: Whether or not the pod is ready (i.e. all containers up) + type: boolean + reason: + description: short message explaining the pod's state + nullable: true + type: string + type: object + KubernetesReplicaSet: + properties: + create_timestamp: + description: Time at which the replicaset was created + format: float + type: number + name: + description: name of the replicaset in Kubernetes + type: string + ready_replicas: + description: number of ready replicas for the replicaset + format: int32 + type: integer + replicas: + description: number of desired replicas for the replicaset + format: int32 + type: integer + type: object + MarathonAppStatus: + properties: + backoff_seconds: + description: Backoff in seconds before launching next task + format: int32 + type: integer + create_timestamp: + description: Unix timestamp when this app was created + format: float + type: number + dashboard_url: + description: Marathon dashboard URL for this app + type: string + deploy_status: + description: Deploy status of this app + type: string + tasks: + description: Tasks associated to this app + items: + $ref: '#/components/schemas/MarathonTask' + type: array + tasks_healthy: + description: Number of healthy tasks for this app + format: int32 + type: integer + tasks_running: + description: Number running tasks for this app + format: int32 + type: integer + tasks_staged: + description: Number of staged tasks for this app + format: int32 + type: integer + tasks_total: + description: Total number of tasks for this app + format: int32 + type: integer + unused_offer_reason_counts: + description: Mapping of reason offer was refused to the number of times + that type of refusal was seen + type: object + type: object + MarathonAutoscalingInfo: + properties: + current_instances: + description: The number of instances of the service currently running + format: int32 + type: integer + current_utilization: + description: The current utilization of the instances' allocated resources + format: float + type: number + max_instances: + description: The maximum number of instances that the autoscaler will scale + to + format: int32 + type: integer + min_instances: + description: The minimum number of instances that the autoscaler will scale + to + format: int32 + type: integer + target_instances: + description: The autoscaler's current target number of instances of this + service to run + format: int32 + type: integer + type: object + MarathonDashboard: + additionalProperties: + $ref: '#/components/schemas/MarathonDashboardCluster' + description: A list of Marathon service, instance, and shard url for one or + more clusters + type: object + MarathonDashboardCluster: + description: List of all the MarathonDashboardItems for a cluster + items: + $ref: '#/components/schemas/MarathonDashboardItem' + type: array + MarathonDashboardItem: + description: Marathon service, instance, and shard url + properties: + instance: + description: Instance name + type: string + service: + description: Service name + type: string + shard_url: + description: Marathon Shard URL + type: string + type: object + MarathonMesosNonrunningTask: + properties: + deployed_timestamp: + description: The unix timestamp at which the task was deployed + format: float + type: number + hostname: + description: Name of the Mesos agent on which this task is running + type: string + id: + description: The ID of the task in Mesos + type: string + state: + description: The current state of the task + type: string + tail_lines: + $ref: '#/components/schemas/TaskTailLines' + description: Stdout and stderr tail of the task + type: object + MarathonMesosRunningTask: + properties: + cpu_shares: + $ref: '#/components/schemas/FloatAndError' + description: The portion of a CPU that the task can use + cpu_used_seconds: + $ref: '#/components/schemas/FloatAndError' + description: The number of seconds of CPU time the task has used + deployed_timestamp: + description: The unix timestamp at which the task was deployed + format: float + type: number + duration_seconds: + description: The duration over which the task has been running in seconds + format: int32 + type: integer + hostname: + description: Name of the Mesos agent on which this task is running + type: string + id: + description: The ID of the task in Mesos + type: string + mem_limit: + $ref: '#/components/schemas/IntegerAndError' + description: The maximum amount of memory the task is allowed to use + rss: + $ref: '#/components/schemas/IntegerAndError' + description: The tasks's resident set size + tail_lines: + $ref: '#/components/schemas/TaskTailLines' + description: Stdout and stderr tail of the task + type: object + MarathonMesosStatus: + properties: + error_message: + description: Error message when Mesos tasks cannot be queried + type: string + non_running_tasks: + description: Non-running tasks associated to this service + items: + $ref: '#/components/schemas/MarathonMesosNonrunningTask' + type: array + running_task_count: + description: The number of running Mesos tasks associated to this service + format: int32 + type: integer + running_tasks: + description: Currently running tasks associated to this service + items: + $ref: '#/components/schemas/MarathonMesosRunningTask' + type: array + type: object + MarathonTask: + properties: + deployed_timestamp: + description: Time at which the task was deployed + format: float + type: number + host: + description: Name of the host on which the task is running + type: string + id: + description: ID of the task in Mesos + type: string + is_healthy: + description: Whether Marathon thinks the task is healthy + type: boolean + port: + description: Port on which the task is listening + format: int32 + type: integer + type: object + MetaStatus: + description: Result of `paasta metastatus` command + properties: + exit_code: + description: Exit code from `paasta metastatus` command + type: integer + output: + description: Output from `paasta metastatus` command + type: string + type: object + Resource: + items: + $ref: '#/components/schemas/ResourceItem' + type: array + ResourceItem: + properties: + cpus: + $ref: '#/components/schemas/ResourceValue' + disk: + $ref: '#/components/schemas/ResourceValue' + groupings: + type: object + mem: + $ref: '#/components/schemas/ResourceValue' + type: object + ResourceValue: + properties: + free: + type: number + total: + type: number + used: + type: number + type: object + SmartstackBackend: + properties: + check_code: + description: Check code reported by HAProxy + type: string + check_duration: + description: Duration in ms of the last health check performed by HAProxy + format: int32 + type: integer + check_status: + description: Status of last health check of the backend + type: string + has_associated_task: + description: Whether this backend has an associated task running + type: boolean + hostname: + description: Name of the host on which the backend is running + type: string + last_change: + description: Seconds since last change in backend status + format: int32 + type: integer + port: + description: Port number on which the backend responds + format: int32 + type: integer + status: + description: Status of the backend in HAProxy + type: string + type: object + SmartstackLocation: + properties: + backends: + description: Smartstack backends running in this location + items: + $ref: '#/components/schemas/SmartstackBackend' + type: array + name: + description: Name of the location + type: string + running_backends_count: + description: Number of running backends for the service in this location + format: int32 + type: integer + type: object + SmartstackStatus: + properties: + expected_backends_per_location: + description: Number of backends expected to be present in each location + format: int32 + type: integer + locations: + description: Locations the service is deployed + items: + $ref: '#/components/schemas/SmartstackLocation' + type: array + registration: + description: Registration name of the service in Smartstack + type: string + type: object + TaskTailLines: + properties: + error_message: + description: Error message when fetching tail lines fails + type: string + stderr: + description: The requested number of lines from the task's stderr + items: + type: string + type: array + stdout: + description: The requested number of lines from the task's stdout + items: + type: string + type: array + type: object +paths: + /deploy_queue: + get: + operationId: deploy_queue + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployQueue' + description: Contents of deploy queue + summary: Get deploy queue contents + /marathon_dashboard: + get: + operationId: marathon_dashboard + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MarathonDashboard' + description: List of service instances and information on their Marathon + shard + summary: Get marathon service instances and their shards + tags: + - marathon_dashboard + /metastatus: + get: + operationId: metastatus + parameters: + - description: comma separated list of command arguments + in: query + name: cmd_args + required: true + schema: + items: + type: string + type: array + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MetaStatus' + description: Detailed metastatus + "500": + description: Metastatus failure + summary: Get metastatus + /resources/utilization: + get: + operationId: resources + parameters: + - description: comma separated list of keys to group by + in: query + name: groupings + required: false + schema: + items: + type: string + type: array + style: simple + - description: List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'. + Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4) + explode: true + in: query + name: filter + required: false + style: form + schema: + items: + pattern: (.*):(.*,)*(.*) + type: string + type: array + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Resource' + description: Resources in the cluster, filtered and grouped by parameters + "400": + description: Poorly formated query parameters + summary: Get resources in the cluster + tags: + - resources + /service_autoscaler/pause: + delete: + operationId: delete_service_autoscaler_pause + responses: + "200": + description: Service autoscaler successfully unpaused + "500": + description: Unable to talk to zookeeper + summary: Unpause the autoscaler + get: + operationId: get_service_autoscaler_pause + responses: + "200": + content: + application/json: + schema: + type: string + description: The time until which the servcie autoscaler is paused for + "500": + description: Unable to talk to zookeeper + summary: Get autoscaling pause time + post: + operationId: update_service_autoscaler_pause + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + minutes: + type: integer + type: object + required: true + responses: + "200": + description: Service autoscaler successfully paused + "500": + description: Unable to talk to zookeeper + /services: + get: + operationId: list_services_for_cluster + responses: + "200": + content: + application/json: + schema: + properties: + services: + items: + items: {} + type: array + type: array + type: object + description: Services and their instances on the current cluster + summary: List service names and service instance names on the current cluster + tags: + - service + /services/{service}: + get: + operationId: list_instances + parameters: + - description: Service name + in: path + name: service + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + properties: + instances: + items: + type: string + type: array + type: object + description: Instances of a service + summary: List instances of service_name + tags: + - service + /services/{service}/{instance}/autoscaler: + get: + operationId: get_autoscaler_count + parameters: + - description: Service name + in: path + name: service + required: true + schema: + type: string + - description: Instance name + in: path + name: instance + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + properties: + desired_instances: + type: integer + type: object + description: Get desired instance count for a service instance + "404": + description: Deployment key not found + "500": + description: Instance failure + summary: Get status of service_name.instance_name + tags: + - autoscaler + post: + operationId: update_autoscaler_count + parameters: + - description: Service name + in: path + name: service + required: true + schema: + type: string + - description: Instance name + in: path + name: instance + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + calculated_instances: + type: integer + desired_instances: + type: integer + type: object + required: true + responses: + "202": + content: + application/json: + schema: + properties: + desired_instances: + type: integer + status: + type: string + type: object + description: Set desired instance count for a service instance + "404": + description: Deployment key not found + "500": + description: Instance failure + summary: Get status of service_name.instance_name + tags: + - autoscaler + /services/{service}/{instance}/delay: + get: + operationId: delay_instance + parameters: + - description: Service name + in: path + name: service + required: true + schema: + type: string + - description: Instance name + in: path + name: instance + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceDelay' + description: The service is delayed for these possible reasons + "204": + description: Could not find any reasons for a delay + "404": + description: Deployment key not found + "500": + description: Instance failure + summary: Get the possible reasons for a deployment delay for a marathon service.instance + tags: + - service + /services/{service}/{instance}/state/{desired_state}: + post: + operationId: instance_set_state + parameters: + - description: Service name + in: path + name: service + required: true + schema: + type: string + - description: Instance name + in: path + name: instance + required: true + schema: + type: string + - description: Desired state + in: path + name: desired_state + required: true + schema: + type: string + responses: + "200": + description: Result of instance state change + "404": + description: Deployment key not found + "500": + description: Instance failure + summary: Change state of service_name.instance_name + tags: + - service + /services/{service}/{instance}/status: + get: + operationId: status_instance + parameters: + - description: Service name + in: path + name: service + required: true + schema: + type: string + - description: Instance name + in: path + name: instance + required: true + schema: + type: string + - description: Include verbose status information + in: query + name: verbose + required: false + schema: + format: int32 + type: integer + - description: Include Smartstack information + in: query + name: include_smartstack + required: false + schema: + type: boolean + - description: Include Envoy information + in: query + name: include_envoy + required: false + schema: + type: boolean + - description: Include Mesos information + in: query + name: include_mesos + required: false + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceStatus' + description: Detailed status of an instance + "404": + description: Deployment key not found + "500": + description: Instance failure + summary: Get status of service_name.instance_name + tags: + - service + /services/{service}/{instance}/tasks: + get: + operationId: tasks_instance + parameters: + - description: Service name + in: path + name: service + required: true + schema: + type: string + - description: Instance name + in: path + name: instance + required: true + schema: + type: string + - description: slave hostname to filter tasks by + in: query + name: slave_hostname + required: false + schema: + type: string + - description: Return slave and executor for task + in: query + name: verbose + required: false + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceTasks' + description: List of tasks associated with an instance + "400": + description: Bad request + "404": + description: Deployment key not found + "500": + description: Instance failure + summary: Get mesos tasks of service_name.instance_name + tags: + - service + /services/{service}/{instance}/tasks/{task_id}: + get: + operationId: task_instance + parameters: + - description: Service name + in: path + name: service + required: true + schema: + type: string + - description: Instance name + in: path + name: instance + required: true + schema: + type: string + - description: mesos task id + in: path + name: task_id + required: true + schema: + type: string + - description: Return slave and executor for task + in: query + name: verbose + required: false + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceTask' + description: Task associated with an instance with specified ID + "400": + description: Bad request + "404": + description: Task with ID not found + "500": + description: Instance failure + summary: Get mesos task of service_name.instance_name by task_id + tags: + - service + /version: + get: + operationId: showVersion + responses: + "200": + content: + application/json: + schema: + type: string + description: Version of paasta_tools package + summary: Version of paasta_tools package diff --git a/pkg/paastaapi/api_autoscaler.go b/pkg/paastaapi/api_autoscaler.go new file mode 100644 index 0000000..ab29234 --- /dev/null +++ b/pkg/paastaapi/api_autoscaler.go @@ -0,0 +1,241 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// AutoscalerApiService AutoscalerApi service +type AutoscalerApiService service + +type apiGetAutoscalerCountRequest struct { + ctx _context.Context + apiService *AutoscalerApiService + service string + instance string +} + +/* +GetAutoscalerCount Get status of service_name.instance_name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param service Service name + * @param instance Instance name +@return apiGetAutoscalerCountRequest +*/ +func (a *AutoscalerApiService) GetAutoscalerCount(ctx _context.Context, service string, instance string) apiGetAutoscalerCountRequest { + return apiGetAutoscalerCountRequest{ + apiService: a, + ctx: ctx, + service: service, + instance: instance, + } +} + +/* +Execute executes the request +@return InlineResponse2002 +*/ +func (r apiGetAutoscalerCountRequest) Execute() (InlineResponse2002, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2002 + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "AutoscalerApiService.GetAutoscalerCount") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/services/{service}/{instance}/autoscaler" + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.PathEscape(parameterToString(r.service, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"instance"+"}", _neturl.PathEscape(parameterToString(r.instance, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiUpdateAutoscalerCountRequest struct { + ctx _context.Context + apiService *AutoscalerApiService + service string + instance string + inlineObject1 *InlineObject1 +} + +func (r apiUpdateAutoscalerCountRequest) InlineObject1(inlineObject1 InlineObject1) apiUpdateAutoscalerCountRequest { + r.inlineObject1 = &inlineObject1 + return r +} +/* +UpdateAutoscalerCount Get status of service_name.instance_name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param service Service name + * @param instance Instance name +@return apiUpdateAutoscalerCountRequest +*/ +func (a *AutoscalerApiService) UpdateAutoscalerCount(ctx _context.Context, service string, instance string) apiUpdateAutoscalerCountRequest { + return apiUpdateAutoscalerCountRequest{ + apiService: a, + ctx: ctx, + service: service, + instance: instance, + } +} + +/* +Execute executes the request +@return InlineResponse202 +*/ +func (r apiUpdateAutoscalerCountRequest) Execute() (InlineResponse202, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse202 + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "AutoscalerApiService.UpdateAutoscalerCount") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/services/{service}/{instance}/autoscaler" + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.PathEscape(parameterToString(r.service, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"instance"+"}", _neturl.PathEscape(parameterToString(r.instance, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.inlineObject1 == nil { + return localVarReturnValue, nil, reportError("inlineObject1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inlineObject1 + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/pkg/paastaapi/api_default.go b/pkg/paastaapi/api_default.go new file mode 100644 index 0000000..e66a7e4 --- /dev/null +++ b/pkg/paastaapi/api_default.go @@ -0,0 +1,585 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" +) + +// Linger please +var ( + _ _context.Context +) + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type apiDeleteServiceAutoscalerPauseRequest struct { + ctx _context.Context + apiService *DefaultApiService +} + +/* +DeleteServiceAutoscalerPause Unpause the autoscaler + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiDeleteServiceAutoscalerPauseRequest +*/ +func (a *DefaultApiService) DeleteServiceAutoscalerPause(ctx _context.Context) apiDeleteServiceAutoscalerPauseRequest { + return apiDeleteServiceAutoscalerPauseRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request +*/ +func (r apiDeleteServiceAutoscalerPauseRequest) Execute() (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServiceAutoscalerPause") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service_autoscaler/pause" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} +type apiDeployQueueRequest struct { + ctx _context.Context + apiService *DefaultApiService +} + +/* +DeployQueue Get deploy queue contents + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiDeployQueueRequest +*/ +func (a *DefaultApiService) DeployQueue(ctx _context.Context) apiDeployQueueRequest { + return apiDeployQueueRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request +@return DeployQueue +*/ +func (r apiDeployQueueRequest) Execute() (DeployQueue, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DeployQueue + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployQueue") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/deploy_queue" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiGetServiceAutoscalerPauseRequest struct { + ctx _context.Context + apiService *DefaultApiService +} + +/* +GetServiceAutoscalerPause Get autoscaling pause time + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiGetServiceAutoscalerPauseRequest +*/ +func (a *DefaultApiService) GetServiceAutoscalerPause(ctx _context.Context) apiGetServiceAutoscalerPauseRequest { + return apiGetServiceAutoscalerPauseRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request +@return string +*/ +func (r apiGetServiceAutoscalerPauseRequest) Execute() (string, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServiceAutoscalerPause") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service_autoscaler/pause" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiMetastatusRequest struct { + ctx _context.Context + apiService *DefaultApiService + cmdArgs *[]string +} + +func (r apiMetastatusRequest) CmdArgs(cmdArgs []string) apiMetastatusRequest { + r.cmdArgs = &cmdArgs + return r +} +/* +Metastatus Get metastatus + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiMetastatusRequest +*/ +func (a *DefaultApiService) Metastatus(ctx _context.Context) apiMetastatusRequest { + return apiMetastatusRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request +@return MetaStatus +*/ +func (r apiMetastatusRequest) Execute() (MetaStatus, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue MetaStatus + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Metastatus") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metastatus" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.cmdArgs == nil { + return localVarReturnValue, nil, reportError("cmdArgs is required and must be specified") + } + + localVarQueryParams.Add("cmd_args", parameterToString(*r.cmdArgs, "csv")) + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiShowVersionRequest struct { + ctx _context.Context + apiService *DefaultApiService +} + +/* +ShowVersion Version of paasta_tools package + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiShowVersionRequest +*/ +func (a *DefaultApiService) ShowVersion(ctx _context.Context) apiShowVersionRequest { + return apiShowVersionRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request +@return string +*/ +func (r apiShowVersionRequest) Execute() (string, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ShowVersion") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/version" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiUpdateServiceAutoscalerPauseRequest struct { + ctx _context.Context + apiService *DefaultApiService + minutes *int32 +} + +func (r apiUpdateServiceAutoscalerPauseRequest) Minutes(minutes int32) apiUpdateServiceAutoscalerPauseRequest { + r.minutes = &minutes + return r +} +/* +UpdateServiceAutoscalerPause Method for UpdateServiceAutoscalerPause + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiUpdateServiceAutoscalerPauseRequest +*/ +func (a *DefaultApiService) UpdateServiceAutoscalerPause(ctx _context.Context) apiUpdateServiceAutoscalerPauseRequest { + return apiUpdateServiceAutoscalerPauseRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request +*/ +func (r apiUpdateServiceAutoscalerPauseRequest) Execute() (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateServiceAutoscalerPause") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service_autoscaler/pause" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.minutes != nil { + localVarFormParams.Add("minutes", parameterToString(*r.minutes, "")) + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/pkg/paastaapi/api_marathon_dashboard.go b/pkg/paastaapi/api_marathon_dashboard.go new file mode 100644 index 0000000..5b610b7 --- /dev/null +++ b/pkg/paastaapi/api_marathon_dashboard.go @@ -0,0 +1,120 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" +) + +// Linger please +var ( + _ _context.Context +) + +// MarathonDashboardApiService MarathonDashboardApi service +type MarathonDashboardApiService service + +type apiMarathonDashboardRequest struct { + ctx _context.Context + apiService *MarathonDashboardApiService +} + +/* +MarathonDashboard Get marathon service instances and their shards + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiMarathonDashboardRequest +*/ +func (a *MarathonDashboardApiService) MarathonDashboard(ctx _context.Context) apiMarathonDashboardRequest { + return apiMarathonDashboardRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request +@return map[string][]MarathonDashboardItem +*/ +func (r apiMarathonDashboardRequest) Execute() (map[string][]MarathonDashboardItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string][]MarathonDashboardItem + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "MarathonDashboardApiService.MarathonDashboard") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/marathon_dashboard" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/pkg/paastaapi/api_resources.go b/pkg/paastaapi/api_resources.go new file mode 100644 index 0000000..31a22ea --- /dev/null +++ b/pkg/paastaapi/api_resources.go @@ -0,0 +1,145 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "reflect" +) + +// Linger please +var ( + _ _context.Context +) + +// ResourcesApiService ResourcesApi service +type ResourcesApiService service + +type apiResourcesRequest struct { + ctx _context.Context + apiService *ResourcesApiService + groupings *[]string + filter *[]string +} + +func (r apiResourcesRequest) Groupings(groupings []string) apiResourcesRequest { + r.groupings = &groupings + return r +} +func (r apiResourcesRequest) Filter(filter []string) apiResourcesRequest { + r.filter = &filter + return r +} +/* +Resources Get resources in the cluster + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiResourcesRequest +*/ +func (a *ResourcesApiService) Resources(ctx _context.Context) apiResourcesRequest { + return apiResourcesRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request +@return []ResourceItem +*/ +func (r apiResourcesRequest) Execute() ([]ResourceItem, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []ResourceItem + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ResourcesApiService.Resources") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/utilization" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.groupings != nil { + localVarQueryParams.Add("groupings", parameterToString(*r.groupings, "csv")) + } + if r.filter != nil { + t := *r.filter + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("filter", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("filter", parameterToString(t, "multi")) + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/pkg/paastaapi/api_service.go b/pkg/paastaapi/api_service.go new file mode 100644 index 0000000..3b1be5a --- /dev/null +++ b/pkg/paastaapi/api_service.go @@ -0,0 +1,782 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// ServiceApiService ServiceApi service +type ServiceApiService service + +type apiDelayInstanceRequest struct { + ctx _context.Context + apiService *ServiceApiService + service string + instance string +} + +/* +DelayInstance Get the possible reasons for a deployment delay for a marathon service.instance + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param service Service name + * @param instance Instance name +@return apiDelayInstanceRequest +*/ +func (a *ServiceApiService) DelayInstance(ctx _context.Context, service string, instance string) apiDelayInstanceRequest { + return apiDelayInstanceRequest{ + apiService: a, + ctx: ctx, + service: service, + instance: instance, + } +} + +/* +Execute executes the request +@return map[string]interface{} +*/ +func (r apiDelayInstanceRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ServiceApiService.DelayInstance") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/services/{service}/{instance}/delay" + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.PathEscape(parameterToString(r.service, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"instance"+"}", _neturl.PathEscape(parameterToString(r.instance, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiInstanceSetStateRequest struct { + ctx _context.Context + apiService *ServiceApiService + service string + instance string + desiredState string +} + +/* +InstanceSetState Change state of service_name.instance_name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param service Service name + * @param instance Instance name + * @param desiredState Desired state +@return apiInstanceSetStateRequest +*/ +func (a *ServiceApiService) InstanceSetState(ctx _context.Context, service string, instance string, desiredState string) apiInstanceSetStateRequest { + return apiInstanceSetStateRequest{ + apiService: a, + ctx: ctx, + service: service, + instance: instance, + desiredState: desiredState, + } +} + +/* +Execute executes the request +*/ +func (r apiInstanceSetStateRequest) Execute() (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ServiceApiService.InstanceSetState") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/services/{service}/{instance}/state/{desired_state}" + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.PathEscape(parameterToString(r.service, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"instance"+"}", _neturl.PathEscape(parameterToString(r.instance, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"desired_state"+"}", _neturl.PathEscape(parameterToString(r.desiredState, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} +type apiListInstancesRequest struct { + ctx _context.Context + apiService *ServiceApiService + service string +} + +/* +ListInstances List instances of service_name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param service Service name +@return apiListInstancesRequest +*/ +func (a *ServiceApiService) ListInstances(ctx _context.Context, service string) apiListInstancesRequest { + return apiListInstancesRequest{ + apiService: a, + ctx: ctx, + service: service, + } +} + +/* +Execute executes the request +@return InlineResponse2001 +*/ +func (r apiListInstancesRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2001 + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ServiceApiService.ListInstances") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/services/{service}" + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.PathEscape(parameterToString(r.service, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiListServicesForClusterRequest struct { + ctx _context.Context + apiService *ServiceApiService +} + +/* +ListServicesForCluster List service names and service instance names on the current cluster + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiListServicesForClusterRequest +*/ +func (a *ServiceApiService) ListServicesForCluster(ctx _context.Context) apiListServicesForClusterRequest { + return apiListServicesForClusterRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request +@return InlineResponse200 +*/ +func (r apiListServicesForClusterRequest) Execute() (InlineResponse200, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse200 + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ServiceApiService.ListServicesForCluster") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/services" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiStatusInstanceRequest struct { + ctx _context.Context + apiService *ServiceApiService + service string + instance string + verbose *int32 + includeSmartstack *bool + includeEnvoy *bool + includeMesos *bool +} + +func (r apiStatusInstanceRequest) Verbose(verbose int32) apiStatusInstanceRequest { + r.verbose = &verbose + return r +} +func (r apiStatusInstanceRequest) IncludeSmartstack(includeSmartstack bool) apiStatusInstanceRequest { + r.includeSmartstack = &includeSmartstack + return r +} +func (r apiStatusInstanceRequest) IncludeEnvoy(includeEnvoy bool) apiStatusInstanceRequest { + r.includeEnvoy = &includeEnvoy + return r +} +func (r apiStatusInstanceRequest) IncludeMesos(includeMesos bool) apiStatusInstanceRequest { + r.includeMesos = &includeMesos + return r +} +/* +StatusInstance Get status of service_name.instance_name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param service Service name + * @param instance Instance name +@return apiStatusInstanceRequest +*/ +func (a *ServiceApiService) StatusInstance(ctx _context.Context, service string, instance string) apiStatusInstanceRequest { + return apiStatusInstanceRequest{ + apiService: a, + ctx: ctx, + service: service, + instance: instance, + } +} + +/* +Execute executes the request +@return InstanceStatus +*/ +func (r apiStatusInstanceRequest) Execute() (InstanceStatus, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InstanceStatus + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ServiceApiService.StatusInstance") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/services/{service}/{instance}/status" + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.PathEscape(parameterToString(r.service, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"instance"+"}", _neturl.PathEscape(parameterToString(r.instance, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.verbose != nil { + localVarQueryParams.Add("verbose", parameterToString(*r.verbose, "")) + } + if r.includeSmartstack != nil { + localVarQueryParams.Add("include_smartstack", parameterToString(*r.includeSmartstack, "")) + } + if r.includeEnvoy != nil { + localVarQueryParams.Add("include_envoy", parameterToString(*r.includeEnvoy, "")) + } + if r.includeMesos != nil { + localVarQueryParams.Add("include_mesos", parameterToString(*r.includeMesos, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiTaskInstanceRequest struct { + ctx _context.Context + apiService *ServiceApiService + service string + instance string + taskId string + verbose *bool +} + +func (r apiTaskInstanceRequest) Verbose(verbose bool) apiTaskInstanceRequest { + r.verbose = &verbose + return r +} +/* +TaskInstance Get mesos task of service_name.instance_name by task_id + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param service Service name + * @param instance Instance name + * @param taskId mesos task id +@return apiTaskInstanceRequest +*/ +func (a *ServiceApiService) TaskInstance(ctx _context.Context, service string, instance string, taskId string) apiTaskInstanceRequest { + return apiTaskInstanceRequest{ + apiService: a, + ctx: ctx, + service: service, + instance: instance, + taskId: taskId, + } +} + +/* +Execute executes the request +@return map[string]interface{} +*/ +func (r apiTaskInstanceRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ServiceApiService.TaskInstance") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/services/{service}/{instance}/tasks/{task_id}" + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.PathEscape(parameterToString(r.service, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"instance"+"}", _neturl.PathEscape(parameterToString(r.instance, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.verbose != nil { + localVarQueryParams.Add("verbose", parameterToString(*r.verbose, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} +type apiTasksInstanceRequest struct { + ctx _context.Context + apiService *ServiceApiService + service string + instance string + slaveHostname *string + verbose *bool +} + +func (r apiTasksInstanceRequest) SlaveHostname(slaveHostname string) apiTasksInstanceRequest { + r.slaveHostname = &slaveHostname + return r +} +func (r apiTasksInstanceRequest) Verbose(verbose bool) apiTasksInstanceRequest { + r.verbose = &verbose + return r +} +/* +TasksInstance Get mesos tasks of service_name.instance_name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param service Service name + * @param instance Instance name +@return apiTasksInstanceRequest +*/ +func (a *ServiceApiService) TasksInstance(ctx _context.Context, service string, instance string) apiTasksInstanceRequest { + return apiTasksInstanceRequest{ + apiService: a, + ctx: ctx, + service: service, + instance: instance, + } +} + +/* +Execute executes the request +@return []map[string]interface{} +*/ +func (r apiTasksInstanceRequest) Execute() ([]map[string]interface{}, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []map[string]interface{} + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ServiceApiService.TasksInstance") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/services/{service}/{instance}/tasks" + localVarPath = strings.Replace(localVarPath, "{"+"service"+"}", _neturl.PathEscape(parameterToString(r.service, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"instance"+"}", _neturl.PathEscape(parameterToString(r.instance, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.slaveHostname != nil { + localVarQueryParams.Add("slave_hostname", parameterToString(*r.slaveHostname, "")) + } + if r.verbose != nil { + localVarQueryParams.Add("verbose", parameterToString(*r.verbose, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/pkg/paastaapi/client.go b/pkg/paastaapi/client.go new file mode 100644 index 0000000..db2456e --- /dev/null +++ b/pkg/paastaapi/client.go @@ -0,0 +1,544 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) +) + +// APIClient manages communication with the Paasta API API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AutoscalerApi *AutoscalerApiService + + DefaultApi *DefaultApiService + + MarathonDashboardApi *MarathonDashboardApiService + + ResourcesApi *ResourcesApiService + + ServiceApi *ServiceApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.AutoscalerApi = (*AutoscalerApiService)(&c.common) + c.DefaultApi = (*DefaultApiService)(&c.common) + c.MarathonDashboardApi = (*MarathonDashboardApiService)(&c.common) + c.ResourcesApi = (*ResourcesApiService)(&c.common) + c.ServiceApi = (*ServiceApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } else if t, ok := obj.(time.Time); ok { + return t.Format(time.RFC3339) + } + + return fmt.Sprintf("%v", obj) +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFileName string, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{GetActualInstance() interface{}}); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{UnmarshalJSON([]byte) error}); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err!= nil { + return err + } + } else { + errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} diff --git a/pkg/paastaapi/client/autoscaler/autoscaler_client.go b/pkg/paastaapi/client/autoscaler/autoscaler_client.go deleted file mode 100644 index 723b895..0000000 --- a/pkg/paastaapi/client/autoscaler/autoscaler_client.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new autoscaler API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for autoscaler API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) - - UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetAutoscalerCount gets status of service name instance name -*/ -func (a *Client) GetAutoscalerCount(params *GetAutoscalerCountParams) (*GetAutoscalerCountOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetAutoscalerCountParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "get_autoscaler_count", - Method: "GET", - PathPattern: "/services/{service}/{instance}/autoscaler", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetAutoscalerCountReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetAutoscalerCountOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for get_autoscaler_count: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateAutoscalerCount gets status of service name instance name -*/ -func (a *Client) UpdateAutoscalerCount(params *UpdateAutoscalerCountParams) (*UpdateAutoscalerCountAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateAutoscalerCountParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "update_autoscaler_count", - Method: "POST", - PathPattern: "/services/{service}/{instance}/autoscaler", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateAutoscalerCountReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateAutoscalerCountAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for update_autoscaler_count: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paastaapi/client/autoscaler/get_autoscaler_count_parameters.go b/pkg/paastaapi/client/autoscaler/get_autoscaler_count_parameters.go deleted file mode 100644 index df8c045..0000000 --- a/pkg/paastaapi/client/autoscaler/get_autoscaler_count_parameters.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetAutoscalerCountParams creates a new GetAutoscalerCountParams object -// with the default values initialized. -func NewGetAutoscalerCountParams() *GetAutoscalerCountParams { - var () - return &GetAutoscalerCountParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetAutoscalerCountParamsWithTimeout creates a new GetAutoscalerCountParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetAutoscalerCountParamsWithTimeout(timeout time.Duration) *GetAutoscalerCountParams { - var () - return &GetAutoscalerCountParams{ - - timeout: timeout, - } -} - -// NewGetAutoscalerCountParamsWithContext creates a new GetAutoscalerCountParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetAutoscalerCountParamsWithContext(ctx context.Context) *GetAutoscalerCountParams { - var () - return &GetAutoscalerCountParams{ - - Context: ctx, - } -} - -// NewGetAutoscalerCountParamsWithHTTPClient creates a new GetAutoscalerCountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetAutoscalerCountParamsWithHTTPClient(client *http.Client) *GetAutoscalerCountParams { - var () - return &GetAutoscalerCountParams{ - HTTPClient: client, - } -} - -/*GetAutoscalerCountParams contains all the parameters to send to the API endpoint -for the get autoscaler count operation typically these are written to a http.Request -*/ -type GetAutoscalerCountParams struct { - - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithTimeout(timeout time.Duration) *GetAutoscalerCountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithContext(ctx context.Context) *GetAutoscalerCountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithHTTPClient(client *http.Client) *GetAutoscalerCountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithInstance(instance string) *GetAutoscalerCountParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the get autoscaler count params -func (o *GetAutoscalerCountParams) WithService(service string) *GetAutoscalerCountParams { - o.SetService(service) - return o -} - -// SetService adds the service to the get autoscaler count params -func (o *GetAutoscalerCountParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *GetAutoscalerCountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/autoscaler/get_autoscaler_count_responses.go b/pkg/paastaapi/client/autoscaler/get_autoscaler_count_responses.go deleted file mode 100644 index 3530321..0000000 --- a/pkg/paastaapi/client/autoscaler/get_autoscaler_count_responses.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GetAutoscalerCountReader is a Reader for the GetAutoscalerCount structure. -type GetAutoscalerCountReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetAutoscalerCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetAutoscalerCountOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewGetAutoscalerCountNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetAutoscalerCountInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewGetAutoscalerCountOK creates a GetAutoscalerCountOK with default headers values -func NewGetAutoscalerCountOK() *GetAutoscalerCountOK { - return &GetAutoscalerCountOK{} -} - -/*GetAutoscalerCountOK handles this case with default header values. - -Get desired instance count for a service instance -*/ -type GetAutoscalerCountOK struct { - Payload *GetAutoscalerCountOKBody -} - -func (o *GetAutoscalerCountOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/autoscaler][%d] getAutoscalerCountOK %+v", 200, o.Payload) -} - -func (o *GetAutoscalerCountOK) GetPayload() *GetAutoscalerCountOKBody { - return o.Payload -} - -func (o *GetAutoscalerCountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(GetAutoscalerCountOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetAutoscalerCountNotFound creates a GetAutoscalerCountNotFound with default headers values -func NewGetAutoscalerCountNotFound() *GetAutoscalerCountNotFound { - return &GetAutoscalerCountNotFound{} -} - -/*GetAutoscalerCountNotFound handles this case with default header values. - -Deployment key not found -*/ -type GetAutoscalerCountNotFound struct { -} - -func (o *GetAutoscalerCountNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/autoscaler][%d] getAutoscalerCountNotFound ", 404) -} - -func (o *GetAutoscalerCountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewGetAutoscalerCountInternalServerError creates a GetAutoscalerCountInternalServerError with default headers values -func NewGetAutoscalerCountInternalServerError() *GetAutoscalerCountInternalServerError { - return &GetAutoscalerCountInternalServerError{} -} - -/*GetAutoscalerCountInternalServerError handles this case with default header values. - -Instance failure -*/ -type GetAutoscalerCountInternalServerError struct { -} - -func (o *GetAutoscalerCountInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/autoscaler][%d] getAutoscalerCountInternalServerError ", 500) -} - -func (o *GetAutoscalerCountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -/*GetAutoscalerCountOKBody get autoscaler count o k body -swagger:model GetAutoscalerCountOKBody -*/ -type GetAutoscalerCountOKBody struct { - - // desired instances - DesiredInstances int64 `json:"desired_instances,omitempty"` -} - -// Validate validates this get autoscaler count o k body -func (o *GetAutoscalerCountOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetAutoscalerCountOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetAutoscalerCountOKBody) UnmarshalBinary(b []byte) error { - var res GetAutoscalerCountOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paastaapi/client/autoscaler/update_autoscaler_count_parameters.go b/pkg/paastaapi/client/autoscaler/update_autoscaler_count_parameters.go deleted file mode 100644 index 4e4e1dc..0000000 --- a/pkg/paastaapi/client/autoscaler/update_autoscaler_count_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewUpdateAutoscalerCountParams creates a new UpdateAutoscalerCountParams object -// with the default values initialized. -func NewUpdateAutoscalerCountParams() *UpdateAutoscalerCountParams { - var () - return &UpdateAutoscalerCountParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateAutoscalerCountParamsWithTimeout creates a new UpdateAutoscalerCountParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewUpdateAutoscalerCountParamsWithTimeout(timeout time.Duration) *UpdateAutoscalerCountParams { - var () - return &UpdateAutoscalerCountParams{ - - timeout: timeout, - } -} - -// NewUpdateAutoscalerCountParamsWithContext creates a new UpdateAutoscalerCountParams object -// with the default values initialized, and the ability to set a context for a request -func NewUpdateAutoscalerCountParamsWithContext(ctx context.Context) *UpdateAutoscalerCountParams { - var () - return &UpdateAutoscalerCountParams{ - - Context: ctx, - } -} - -// NewUpdateAutoscalerCountParamsWithHTTPClient creates a new UpdateAutoscalerCountParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewUpdateAutoscalerCountParamsWithHTTPClient(client *http.Client) *UpdateAutoscalerCountParams { - var () - return &UpdateAutoscalerCountParams{ - HTTPClient: client, - } -} - -/*UpdateAutoscalerCountParams contains all the parameters to send to the API endpoint -for the update autoscaler count operation typically these are written to a http.Request -*/ -type UpdateAutoscalerCountParams struct { - - /*Instance - Instance name - - */ - Instance string - /*JSONBody*/ - JSONBody UpdateAutoscalerCountBody - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithTimeout(timeout time.Duration) *UpdateAutoscalerCountParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithContext(ctx context.Context) *UpdateAutoscalerCountParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithHTTPClient(client *http.Client) *UpdateAutoscalerCountParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithInstance(instance string) *UpdateAutoscalerCountParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithJSONBody adds the jSONBody to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithJSONBody(jSONBody UpdateAutoscalerCountBody) *UpdateAutoscalerCountParams { - o.SetJSONBody(jSONBody) - return o -} - -// SetJSONBody adds the jsonBody to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetJSONBody(jSONBody UpdateAutoscalerCountBody) { - o.JSONBody = jSONBody -} - -// WithService adds the service to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) WithService(service string) *UpdateAutoscalerCountParams { - o.SetService(service) - return o -} - -// SetService adds the service to the update autoscaler count params -func (o *UpdateAutoscalerCountParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateAutoscalerCountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - if err := r.SetBodyParam(o.JSONBody); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/autoscaler/update_autoscaler_count_responses.go b/pkg/paastaapi/client/autoscaler/update_autoscaler_count_responses.go deleted file mode 100644 index fc7be49..0000000 --- a/pkg/paastaapi/client/autoscaler/update_autoscaler_count_responses.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package autoscaler - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdateAutoscalerCountReader is a Reader for the UpdateAutoscalerCount structure. -type UpdateAutoscalerCountReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateAutoscalerCountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewUpdateAutoscalerCountAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewUpdateAutoscalerCountNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateAutoscalerCountInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewUpdateAutoscalerCountAccepted creates a UpdateAutoscalerCountAccepted with default headers values -func NewUpdateAutoscalerCountAccepted() *UpdateAutoscalerCountAccepted { - return &UpdateAutoscalerCountAccepted{} -} - -/*UpdateAutoscalerCountAccepted handles this case with default header values. - -Set desired instance count for a service instance -*/ -type UpdateAutoscalerCountAccepted struct { - Payload *UpdateAutoscalerCountAcceptedBody -} - -func (o *UpdateAutoscalerCountAccepted) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/autoscaler][%d] updateAutoscalerCountAccepted %+v", 202, o.Payload) -} - -func (o *UpdateAutoscalerCountAccepted) GetPayload() *UpdateAutoscalerCountAcceptedBody { - return o.Payload -} - -func (o *UpdateAutoscalerCountAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(UpdateAutoscalerCountAcceptedBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateAutoscalerCountNotFound creates a UpdateAutoscalerCountNotFound with default headers values -func NewUpdateAutoscalerCountNotFound() *UpdateAutoscalerCountNotFound { - return &UpdateAutoscalerCountNotFound{} -} - -/*UpdateAutoscalerCountNotFound handles this case with default header values. - -Deployment key not found -*/ -type UpdateAutoscalerCountNotFound struct { -} - -func (o *UpdateAutoscalerCountNotFound) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/autoscaler][%d] updateAutoscalerCountNotFound ", 404) -} - -func (o *UpdateAutoscalerCountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateAutoscalerCountInternalServerError creates a UpdateAutoscalerCountInternalServerError with default headers values -func NewUpdateAutoscalerCountInternalServerError() *UpdateAutoscalerCountInternalServerError { - return &UpdateAutoscalerCountInternalServerError{} -} - -/*UpdateAutoscalerCountInternalServerError handles this case with default header values. - -Instance failure -*/ -type UpdateAutoscalerCountInternalServerError struct { -} - -func (o *UpdateAutoscalerCountInternalServerError) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/autoscaler][%d] updateAutoscalerCountInternalServerError ", 500) -} - -func (o *UpdateAutoscalerCountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -/*UpdateAutoscalerCountAcceptedBody update autoscaler count accepted body -swagger:model UpdateAutoscalerCountAcceptedBody -*/ -type UpdateAutoscalerCountAcceptedBody struct { - - // desired instances - DesiredInstances int64 `json:"desired_instances,omitempty"` - - // status - Status string `json:"status,omitempty"` -} - -// Validate validates this update autoscaler count accepted body -func (o *UpdateAutoscalerCountAcceptedBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateAutoscalerCountAcceptedBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateAutoscalerCountAcceptedBody) UnmarshalBinary(b []byte) error { - var res UpdateAutoscalerCountAcceptedBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/*UpdateAutoscalerCountBody update autoscaler count body -swagger:model UpdateAutoscalerCountBody -*/ -type UpdateAutoscalerCountBody struct { - - // calculated instances - CalculatedInstances int64 `json:"calculated_instances,omitempty"` - - // desired instances - DesiredInstances int64 `json:"desired_instances,omitempty"` -} - -// Validate validates this update autoscaler count body -func (o *UpdateAutoscalerCountBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateAutoscalerCountBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateAutoscalerCountBody) UnmarshalBinary(b []byte) error { - var res UpdateAutoscalerCountBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paastaapi/client/marathon_dashboard/marathon_dashboard_client.go b/pkg/paastaapi/client/marathon_dashboard/marathon_dashboard_client.go deleted file mode 100644 index 986e590..0000000 --- a/pkg/paastaapi/client/marathon_dashboard/marathon_dashboard_client.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package marathon_dashboard - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new marathon dashboard API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for marathon dashboard API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - MarathonDashboard gets marathon service instances and their shards -*/ -func (a *Client) MarathonDashboard(params *MarathonDashboardParams) (*MarathonDashboardOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewMarathonDashboardParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "marathon_dashboard", - Method: "GET", - PathPattern: "/marathon_dashboard", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &MarathonDashboardReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*MarathonDashboardOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for marathon_dashboard: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paastaapi/client/marathon_dashboard/marathon_dashboard_parameters.go b/pkg/paastaapi/client/marathon_dashboard/marathon_dashboard_parameters.go deleted file mode 100644 index 67d5f61..0000000 --- a/pkg/paastaapi/client/marathon_dashboard/marathon_dashboard_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package marathon_dashboard - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewMarathonDashboardParams creates a new MarathonDashboardParams object -// with the default values initialized. -func NewMarathonDashboardParams() *MarathonDashboardParams { - - return &MarathonDashboardParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewMarathonDashboardParamsWithTimeout creates a new MarathonDashboardParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewMarathonDashboardParamsWithTimeout(timeout time.Duration) *MarathonDashboardParams { - - return &MarathonDashboardParams{ - - timeout: timeout, - } -} - -// NewMarathonDashboardParamsWithContext creates a new MarathonDashboardParams object -// with the default values initialized, and the ability to set a context for a request -func NewMarathonDashboardParamsWithContext(ctx context.Context) *MarathonDashboardParams { - - return &MarathonDashboardParams{ - - Context: ctx, - } -} - -// NewMarathonDashboardParamsWithHTTPClient creates a new MarathonDashboardParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewMarathonDashboardParamsWithHTTPClient(client *http.Client) *MarathonDashboardParams { - - return &MarathonDashboardParams{ - HTTPClient: client, - } -} - -/*MarathonDashboardParams contains all the parameters to send to the API endpoint -for the marathon dashboard operation typically these are written to a http.Request -*/ -type MarathonDashboardParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the marathon dashboard params -func (o *MarathonDashboardParams) WithTimeout(timeout time.Duration) *MarathonDashboardParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the marathon dashboard params -func (o *MarathonDashboardParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the marathon dashboard params -func (o *MarathonDashboardParams) WithContext(ctx context.Context) *MarathonDashboardParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the marathon dashboard params -func (o *MarathonDashboardParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the marathon dashboard params -func (o *MarathonDashboardParams) WithHTTPClient(client *http.Client) *MarathonDashboardParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the marathon dashboard params -func (o *MarathonDashboardParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *MarathonDashboardParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/marathon_dashboard/marathon_dashboard_responses.go b/pkg/paastaapi/client/marathon_dashboard/marathon_dashboard_responses.go deleted file mode 100644 index c57e6cb..0000000 --- a/pkg/paastaapi/client/marathon_dashboard/marathon_dashboard_responses.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package marathon_dashboard - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/models" -) - -// MarathonDashboardReader is a Reader for the MarathonDashboard structure. -type MarathonDashboardReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *MarathonDashboardReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewMarathonDashboardOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewMarathonDashboardOK creates a MarathonDashboardOK with default headers values -func NewMarathonDashboardOK() *MarathonDashboardOK { - return &MarathonDashboardOK{} -} - -/*MarathonDashboardOK handles this case with default header values. - -List of service instances and information on their Marathon shard -*/ -type MarathonDashboardOK struct { - Payload models.MarathonDashboard -} - -func (o *MarathonDashboardOK) Error() string { - return fmt.Sprintf("[GET /marathon_dashboard][%d] marathonDashboardOK %+v", 200, o.Payload) -} - -func (o *MarathonDashboardOK) GetPayload() models.MarathonDashboard { - return o.Payload -} - -func (o *MarathonDashboardOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/paastaapi/client/operations/delete_service_autoscaler_pause_parameters.go b/pkg/paastaapi/client/operations/delete_service_autoscaler_pause_parameters.go deleted file mode 100644 index 999782b..0000000 --- a/pkg/paastaapi/client/operations/delete_service_autoscaler_pause_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServiceAutoscalerPauseParams creates a new DeleteServiceAutoscalerPauseParams object -// with the default values initialized. -func NewDeleteServiceAutoscalerPauseParams() *DeleteServiceAutoscalerPauseParams { - - return &DeleteServiceAutoscalerPauseParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteServiceAutoscalerPauseParamsWithTimeout creates a new DeleteServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDeleteServiceAutoscalerPauseParamsWithTimeout(timeout time.Duration) *DeleteServiceAutoscalerPauseParams { - - return &DeleteServiceAutoscalerPauseParams{ - - timeout: timeout, - } -} - -// NewDeleteServiceAutoscalerPauseParamsWithContext creates a new DeleteServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a context for a request -func NewDeleteServiceAutoscalerPauseParamsWithContext(ctx context.Context) *DeleteServiceAutoscalerPauseParams { - - return &DeleteServiceAutoscalerPauseParams{ - - Context: ctx, - } -} - -// NewDeleteServiceAutoscalerPauseParamsWithHTTPClient creates a new DeleteServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDeleteServiceAutoscalerPauseParamsWithHTTPClient(client *http.Client) *DeleteServiceAutoscalerPauseParams { - - return &DeleteServiceAutoscalerPauseParams{ - HTTPClient: client, - } -} - -/*DeleteServiceAutoscalerPauseParams contains all the parameters to send to the API endpoint -for the delete service autoscaler pause operation typically these are written to a http.Request -*/ -type DeleteServiceAutoscalerPauseParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) WithTimeout(timeout time.Duration) *DeleteServiceAutoscalerPauseParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) WithContext(ctx context.Context) *DeleteServiceAutoscalerPauseParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) WithHTTPClient(client *http.Client) *DeleteServiceAutoscalerPauseParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete service autoscaler pause params -func (o *DeleteServiceAutoscalerPauseParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteServiceAutoscalerPauseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/operations/delete_service_autoscaler_pause_responses.go b/pkg/paastaapi/client/operations/delete_service_autoscaler_pause_responses.go deleted file mode 100644 index d41f68f..0000000 --- a/pkg/paastaapi/client/operations/delete_service_autoscaler_pause_responses.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// DeleteServiceAutoscalerPauseReader is a Reader for the DeleteServiceAutoscalerPause structure. -type DeleteServiceAutoscalerPauseReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteServiceAutoscalerPauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteServiceAutoscalerPauseOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewDeleteServiceAutoscalerPauseInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewDeleteServiceAutoscalerPauseOK creates a DeleteServiceAutoscalerPauseOK with default headers values -func NewDeleteServiceAutoscalerPauseOK() *DeleteServiceAutoscalerPauseOK { - return &DeleteServiceAutoscalerPauseOK{} -} - -/*DeleteServiceAutoscalerPauseOK handles this case with default header values. - -Service autoscaler successfully unpaused -*/ -type DeleteServiceAutoscalerPauseOK struct { -} - -func (o *DeleteServiceAutoscalerPauseOK) Error() string { - return fmt.Sprintf("[DELETE /service_autoscaler/pause][%d] deleteServiceAutoscalerPauseOK ", 200) -} - -func (o *DeleteServiceAutoscalerPauseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteServiceAutoscalerPauseInternalServerError creates a DeleteServiceAutoscalerPauseInternalServerError with default headers values -func NewDeleteServiceAutoscalerPauseInternalServerError() *DeleteServiceAutoscalerPauseInternalServerError { - return &DeleteServiceAutoscalerPauseInternalServerError{} -} - -/*DeleteServiceAutoscalerPauseInternalServerError handles this case with default header values. - -Unable to talk to zookeeper -*/ -type DeleteServiceAutoscalerPauseInternalServerError struct { -} - -func (o *DeleteServiceAutoscalerPauseInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /service_autoscaler/pause][%d] deleteServiceAutoscalerPauseInternalServerError ", 500) -} - -func (o *DeleteServiceAutoscalerPauseInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paastaapi/client/operations/deploy_queue_parameters.go b/pkg/paastaapi/client/operations/deploy_queue_parameters.go deleted file mode 100644 index a7e02a0..0000000 --- a/pkg/paastaapi/client/operations/deploy_queue_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeployQueueParams creates a new DeployQueueParams object -// with the default values initialized. -func NewDeployQueueParams() *DeployQueueParams { - - return &DeployQueueParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDeployQueueParamsWithTimeout creates a new DeployQueueParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDeployQueueParamsWithTimeout(timeout time.Duration) *DeployQueueParams { - - return &DeployQueueParams{ - - timeout: timeout, - } -} - -// NewDeployQueueParamsWithContext creates a new DeployQueueParams object -// with the default values initialized, and the ability to set a context for a request -func NewDeployQueueParamsWithContext(ctx context.Context) *DeployQueueParams { - - return &DeployQueueParams{ - - Context: ctx, - } -} - -// NewDeployQueueParamsWithHTTPClient creates a new DeployQueueParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDeployQueueParamsWithHTTPClient(client *http.Client) *DeployQueueParams { - - return &DeployQueueParams{ - HTTPClient: client, - } -} - -/*DeployQueueParams contains all the parameters to send to the API endpoint -for the deploy queue operation typically these are written to a http.Request -*/ -type DeployQueueParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the deploy queue params -func (o *DeployQueueParams) WithTimeout(timeout time.Duration) *DeployQueueParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the deploy queue params -func (o *DeployQueueParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the deploy queue params -func (o *DeployQueueParams) WithContext(ctx context.Context) *DeployQueueParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the deploy queue params -func (o *DeployQueueParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the deploy queue params -func (o *DeployQueueParams) WithHTTPClient(client *http.Client) *DeployQueueParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the deploy queue params -func (o *DeployQueueParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DeployQueueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/operations/deploy_queue_responses.go b/pkg/paastaapi/client/operations/deploy_queue_responses.go deleted file mode 100644 index ec56eac..0000000 --- a/pkg/paastaapi/client/operations/deploy_queue_responses.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/models" -) - -// DeployQueueReader is a Reader for the DeployQueue structure. -type DeployQueueReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeployQueueReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeployQueueOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewDeployQueueOK creates a DeployQueueOK with default headers values -func NewDeployQueueOK() *DeployQueueOK { - return &DeployQueueOK{} -} - -/*DeployQueueOK handles this case with default header values. - -Contents of deploy queue -*/ -type DeployQueueOK struct { - Payload *models.DeployQueue -} - -func (o *DeployQueueOK) Error() string { - return fmt.Sprintf("[GET /deploy_queue][%d] deployQueueOK %+v", 200, o.Payload) -} - -func (o *DeployQueueOK) GetPayload() *models.DeployQueue { - return o.Payload -} - -func (o *DeployQueueOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.DeployQueue) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/paastaapi/client/operations/get_service_autoscaler_pause_parameters.go b/pkg/paastaapi/client/operations/get_service_autoscaler_pause_parameters.go deleted file mode 100644 index e00dd1b..0000000 --- a/pkg/paastaapi/client/operations/get_service_autoscaler_pause_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetServiceAutoscalerPauseParams creates a new GetServiceAutoscalerPauseParams object -// with the default values initialized. -func NewGetServiceAutoscalerPauseParams() *GetServiceAutoscalerPauseParams { - - return &GetServiceAutoscalerPauseParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewGetServiceAutoscalerPauseParamsWithTimeout creates a new GetServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewGetServiceAutoscalerPauseParamsWithTimeout(timeout time.Duration) *GetServiceAutoscalerPauseParams { - - return &GetServiceAutoscalerPauseParams{ - - timeout: timeout, - } -} - -// NewGetServiceAutoscalerPauseParamsWithContext creates a new GetServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a context for a request -func NewGetServiceAutoscalerPauseParamsWithContext(ctx context.Context) *GetServiceAutoscalerPauseParams { - - return &GetServiceAutoscalerPauseParams{ - - Context: ctx, - } -} - -// NewGetServiceAutoscalerPauseParamsWithHTTPClient creates a new GetServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewGetServiceAutoscalerPauseParamsWithHTTPClient(client *http.Client) *GetServiceAutoscalerPauseParams { - - return &GetServiceAutoscalerPauseParams{ - HTTPClient: client, - } -} - -/*GetServiceAutoscalerPauseParams contains all the parameters to send to the API endpoint -for the get service autoscaler pause operation typically these are written to a http.Request -*/ -type GetServiceAutoscalerPauseParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) WithTimeout(timeout time.Duration) *GetServiceAutoscalerPauseParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) WithContext(ctx context.Context) *GetServiceAutoscalerPauseParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) WithHTTPClient(client *http.Client) *GetServiceAutoscalerPauseParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get service autoscaler pause params -func (o *GetServiceAutoscalerPauseParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetServiceAutoscalerPauseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/operations/get_service_autoscaler_pause_responses.go b/pkg/paastaapi/client/operations/get_service_autoscaler_pause_responses.go deleted file mode 100644 index 5e0eda9..0000000 --- a/pkg/paastaapi/client/operations/get_service_autoscaler_pause_responses.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// GetServiceAutoscalerPauseReader is a Reader for the GetServiceAutoscalerPause structure. -type GetServiceAutoscalerPauseReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetServiceAutoscalerPauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetServiceAutoscalerPauseOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewGetServiceAutoscalerPauseInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewGetServiceAutoscalerPauseOK creates a GetServiceAutoscalerPauseOK with default headers values -func NewGetServiceAutoscalerPauseOK() *GetServiceAutoscalerPauseOK { - return &GetServiceAutoscalerPauseOK{} -} - -/*GetServiceAutoscalerPauseOK handles this case with default header values. - -The time until which the servcie autoscaler is paused for -*/ -type GetServiceAutoscalerPauseOK struct { - Payload string -} - -func (o *GetServiceAutoscalerPauseOK) Error() string { - return fmt.Sprintf("[GET /service_autoscaler/pause][%d] getServiceAutoscalerPauseOK %+v", 200, o.Payload) -} - -func (o *GetServiceAutoscalerPauseOK) GetPayload() string { - return o.Payload -} - -func (o *GetServiceAutoscalerPauseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetServiceAutoscalerPauseInternalServerError creates a GetServiceAutoscalerPauseInternalServerError with default headers values -func NewGetServiceAutoscalerPauseInternalServerError() *GetServiceAutoscalerPauseInternalServerError { - return &GetServiceAutoscalerPauseInternalServerError{} -} - -/*GetServiceAutoscalerPauseInternalServerError handles this case with default header values. - -Unable to talk to zookeeper -*/ -type GetServiceAutoscalerPauseInternalServerError struct { -} - -func (o *GetServiceAutoscalerPauseInternalServerError) Error() string { - return fmt.Sprintf("[GET /service_autoscaler/pause][%d] getServiceAutoscalerPauseInternalServerError ", 500) -} - -func (o *GetServiceAutoscalerPauseInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paastaapi/client/operations/metastatus_parameters.go b/pkg/paastaapi/client/operations/metastatus_parameters.go deleted file mode 100644 index 3448fcd..0000000 --- a/pkg/paastaapi/client/operations/metastatus_parameters.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewMetastatusParams creates a new MetastatusParams object -// with the default values initialized. -func NewMetastatusParams() *MetastatusParams { - var () - return &MetastatusParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewMetastatusParamsWithTimeout creates a new MetastatusParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewMetastatusParamsWithTimeout(timeout time.Duration) *MetastatusParams { - var () - return &MetastatusParams{ - - timeout: timeout, - } -} - -// NewMetastatusParamsWithContext creates a new MetastatusParams object -// with the default values initialized, and the ability to set a context for a request -func NewMetastatusParamsWithContext(ctx context.Context) *MetastatusParams { - var () - return &MetastatusParams{ - - Context: ctx, - } -} - -// NewMetastatusParamsWithHTTPClient creates a new MetastatusParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewMetastatusParamsWithHTTPClient(client *http.Client) *MetastatusParams { - var () - return &MetastatusParams{ - HTTPClient: client, - } -} - -/*MetastatusParams contains all the parameters to send to the API endpoint -for the metastatus operation typically these are written to a http.Request -*/ -type MetastatusParams struct { - - /*CmdArgs - comma separated list of command arguments - - */ - CmdArgs []string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the metastatus params -func (o *MetastatusParams) WithTimeout(timeout time.Duration) *MetastatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the metastatus params -func (o *MetastatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the metastatus params -func (o *MetastatusParams) WithContext(ctx context.Context) *MetastatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the metastatus params -func (o *MetastatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the metastatus params -func (o *MetastatusParams) WithHTTPClient(client *http.Client) *MetastatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the metastatus params -func (o *MetastatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCmdArgs adds the cmdArgs to the metastatus params -func (o *MetastatusParams) WithCmdArgs(cmdArgs []string) *MetastatusParams { - o.SetCmdArgs(cmdArgs) - return o -} - -// SetCmdArgs adds the cmdArgs to the metastatus params -func (o *MetastatusParams) SetCmdArgs(cmdArgs []string) { - o.CmdArgs = cmdArgs -} - -// WriteToRequest writes these params to a swagger request -func (o *MetastatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - valuesCmdArgs := o.CmdArgs - - joinedCmdArgs := swag.JoinByFormat(valuesCmdArgs, "csv") - // query array param cmd_args - if err := r.SetQueryParam("cmd_args", joinedCmdArgs...); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/operations/metastatus_responses.go b/pkg/paastaapi/client/operations/metastatus_responses.go deleted file mode 100644 index dea90ba..0000000 --- a/pkg/paastaapi/client/operations/metastatus_responses.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/models" -) - -// MetastatusReader is a Reader for the Metastatus structure. -type MetastatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *MetastatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewMetastatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewMetastatusInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewMetastatusOK creates a MetastatusOK with default headers values -func NewMetastatusOK() *MetastatusOK { - return &MetastatusOK{} -} - -/*MetastatusOK handles this case with default header values. - -Detailed metastatus -*/ -type MetastatusOK struct { - Payload *models.MetaStatus -} - -func (o *MetastatusOK) Error() string { - return fmt.Sprintf("[GET /metastatus][%d] metastatusOK %+v", 200, o.Payload) -} - -func (o *MetastatusOK) GetPayload() *models.MetaStatus { - return o.Payload -} - -func (o *MetastatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.MetaStatus) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewMetastatusInternalServerError creates a MetastatusInternalServerError with default headers values -func NewMetastatusInternalServerError() *MetastatusInternalServerError { - return &MetastatusInternalServerError{} -} - -/*MetastatusInternalServerError handles this case with default header values. - -Metastatus failure -*/ -type MetastatusInternalServerError struct { -} - -func (o *MetastatusInternalServerError) Error() string { - return fmt.Sprintf("[GET /metastatus][%d] metastatusInternalServerError ", 500) -} - -func (o *MetastatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paastaapi/client/operations/operations_client.go b/pkg/paastaapi/client/operations/operations_client.go deleted file mode 100644 index 825d239..0000000 --- a/pkg/paastaapi/client/operations/operations_client.go +++ /dev/null @@ -1,252 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new operations API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for operations API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) - - DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) - - GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) - - Metastatus(params *MetastatusParams) (*MetastatusOK, error) - - ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) - - UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DeleteServiceAutoscalerPause unpauses the autoscaler -*/ -func (a *Client) DeleteServiceAutoscalerPause(params *DeleteServiceAutoscalerPauseParams) (*DeleteServiceAutoscalerPauseOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteServiceAutoscalerPauseParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "delete_service_autoscaler_pause", - Method: "DELETE", - PathPattern: "/service_autoscaler/pause", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeleteServiceAutoscalerPauseReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteServiceAutoscalerPauseOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for delete_service_autoscaler_pause: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeployQueue gets deploy queue contents -*/ -func (a *Client) DeployQueue(params *DeployQueueParams) (*DeployQueueOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeployQueueParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "deploy_queue", - Method: "GET", - PathPattern: "/deploy_queue", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeployQueueReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*DeployQueueOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deploy_queue: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetServiceAutoscalerPause gets autoscaling pause time -*/ -func (a *Client) GetServiceAutoscalerPause(params *GetServiceAutoscalerPauseParams) (*GetServiceAutoscalerPauseOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetServiceAutoscalerPauseParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "get_service_autoscaler_pause", - Method: "GET", - PathPattern: "/service_autoscaler/pause", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetServiceAutoscalerPauseReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetServiceAutoscalerPauseOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for get_service_autoscaler_pause: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - Metastatus gets metastatus -*/ -func (a *Client) Metastatus(params *MetastatusParams) (*MetastatusOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewMetastatusParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "metastatus", - Method: "GET", - PathPattern: "/metastatus", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &MetastatusReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*MetastatusOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for metastatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ShowVersion versions of paasta tools package -*/ -func (a *Client) ShowVersion(params *ShowVersionParams) (*ShowVersionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewShowVersionParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "showVersion", - Method: "GET", - PathPattern: "/version", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ShowVersionReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ShowVersionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for showVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateServiceAutoscalerPause update service autoscaler pause API -*/ -func (a *Client) UpdateServiceAutoscalerPause(params *UpdateServiceAutoscalerPauseParams) (*UpdateServiceAutoscalerPauseOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateServiceAutoscalerPauseParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "update_service_autoscaler_pause", - Method: "POST", - PathPattern: "/service_autoscaler/pause", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateServiceAutoscalerPauseReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateServiceAutoscalerPauseOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for update_service_autoscaler_pause: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paastaapi/client/operations/show_version_parameters.go b/pkg/paastaapi/client/operations/show_version_parameters.go deleted file mode 100644 index a8b181a..0000000 --- a/pkg/paastaapi/client/operations/show_version_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewShowVersionParams creates a new ShowVersionParams object -// with the default values initialized. -func NewShowVersionParams() *ShowVersionParams { - - return &ShowVersionParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewShowVersionParamsWithTimeout creates a new ShowVersionParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewShowVersionParamsWithTimeout(timeout time.Duration) *ShowVersionParams { - - return &ShowVersionParams{ - - timeout: timeout, - } -} - -// NewShowVersionParamsWithContext creates a new ShowVersionParams object -// with the default values initialized, and the ability to set a context for a request -func NewShowVersionParamsWithContext(ctx context.Context) *ShowVersionParams { - - return &ShowVersionParams{ - - Context: ctx, - } -} - -// NewShowVersionParamsWithHTTPClient creates a new ShowVersionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewShowVersionParamsWithHTTPClient(client *http.Client) *ShowVersionParams { - - return &ShowVersionParams{ - HTTPClient: client, - } -} - -/*ShowVersionParams contains all the parameters to send to the API endpoint -for the show version operation typically these are written to a http.Request -*/ -type ShowVersionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the show version params -func (o *ShowVersionParams) WithTimeout(timeout time.Duration) *ShowVersionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the show version params -func (o *ShowVersionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the show version params -func (o *ShowVersionParams) WithContext(ctx context.Context) *ShowVersionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the show version params -func (o *ShowVersionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the show version params -func (o *ShowVersionParams) WithHTTPClient(client *http.Client) *ShowVersionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the show version params -func (o *ShowVersionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ShowVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/operations/show_version_responses.go b/pkg/paastaapi/client/operations/show_version_responses.go deleted file mode 100644 index bd7c8f7..0000000 --- a/pkg/paastaapi/client/operations/show_version_responses.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// ShowVersionReader is a Reader for the ShowVersion structure. -type ShowVersionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ShowVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewShowVersionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewShowVersionOK creates a ShowVersionOK with default headers values -func NewShowVersionOK() *ShowVersionOK { - return &ShowVersionOK{} -} - -/*ShowVersionOK handles this case with default header values. - -Version of paasta_tools package -*/ -type ShowVersionOK struct { - Payload string -} - -func (o *ShowVersionOK) Error() string { - return fmt.Sprintf("[GET /version][%d] showVersionOK %+v", 200, o.Payload) -} - -func (o *ShowVersionOK) GetPayload() string { - return o.Payload -} - -func (o *ShowVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/paastaapi/client/operations/update_service_autoscaler_pause_parameters.go b/pkg/paastaapi/client/operations/update_service_autoscaler_pause_parameters.go deleted file mode 100644 index 5fb998d..0000000 --- a/pkg/paastaapi/client/operations/update_service_autoscaler_pause_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewUpdateServiceAutoscalerPauseParams creates a new UpdateServiceAutoscalerPauseParams object -// with the default values initialized. -func NewUpdateServiceAutoscalerPauseParams() *UpdateServiceAutoscalerPauseParams { - var () - return &UpdateServiceAutoscalerPauseParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateServiceAutoscalerPauseParamsWithTimeout creates a new UpdateServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewUpdateServiceAutoscalerPauseParamsWithTimeout(timeout time.Duration) *UpdateServiceAutoscalerPauseParams { - var () - return &UpdateServiceAutoscalerPauseParams{ - - timeout: timeout, - } -} - -// NewUpdateServiceAutoscalerPauseParamsWithContext creates a new UpdateServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a context for a request -func NewUpdateServiceAutoscalerPauseParamsWithContext(ctx context.Context) *UpdateServiceAutoscalerPauseParams { - var () - return &UpdateServiceAutoscalerPauseParams{ - - Context: ctx, - } -} - -// NewUpdateServiceAutoscalerPauseParamsWithHTTPClient creates a new UpdateServiceAutoscalerPauseParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewUpdateServiceAutoscalerPauseParamsWithHTTPClient(client *http.Client) *UpdateServiceAutoscalerPauseParams { - var () - return &UpdateServiceAutoscalerPauseParams{ - HTTPClient: client, - } -} - -/*UpdateServiceAutoscalerPauseParams contains all the parameters to send to the API endpoint -for the update service autoscaler pause operation typically these are written to a http.Request -*/ -type UpdateServiceAutoscalerPauseParams struct { - - /*JSONBody*/ - JSONBody UpdateServiceAutoscalerPauseBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) WithTimeout(timeout time.Duration) *UpdateServiceAutoscalerPauseParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) WithContext(ctx context.Context) *UpdateServiceAutoscalerPauseParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) WithHTTPClient(client *http.Client) *UpdateServiceAutoscalerPauseParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithJSONBody adds the jSONBody to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) WithJSONBody(jSONBody UpdateServiceAutoscalerPauseBody) *UpdateServiceAutoscalerPauseParams { - o.SetJSONBody(jSONBody) - return o -} - -// SetJSONBody adds the jsonBody to the update service autoscaler pause params -func (o *UpdateServiceAutoscalerPauseParams) SetJSONBody(jSONBody UpdateServiceAutoscalerPauseBody) { - o.JSONBody = jSONBody -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateServiceAutoscalerPauseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if err := r.SetBodyParam(o.JSONBody); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/operations/update_service_autoscaler_pause_responses.go b/pkg/paastaapi/client/operations/update_service_autoscaler_pause_responses.go deleted file mode 100644 index 4496259..0000000 --- a/pkg/paastaapi/client/operations/update_service_autoscaler_pause_responses.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdateServiceAutoscalerPauseReader is a Reader for the UpdateServiceAutoscalerPause structure. -type UpdateServiceAutoscalerPauseReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateServiceAutoscalerPauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateServiceAutoscalerPauseOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewUpdateServiceAutoscalerPauseInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewUpdateServiceAutoscalerPauseOK creates a UpdateServiceAutoscalerPauseOK with default headers values -func NewUpdateServiceAutoscalerPauseOK() *UpdateServiceAutoscalerPauseOK { - return &UpdateServiceAutoscalerPauseOK{} -} - -/*UpdateServiceAutoscalerPauseOK handles this case with default header values. - -Service autoscaler successfully paused -*/ -type UpdateServiceAutoscalerPauseOK struct { -} - -func (o *UpdateServiceAutoscalerPauseOK) Error() string { - return fmt.Sprintf("[POST /service_autoscaler/pause][%d] updateServiceAutoscalerPauseOK ", 200) -} - -func (o *UpdateServiceAutoscalerPauseOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewUpdateServiceAutoscalerPauseInternalServerError creates a UpdateServiceAutoscalerPauseInternalServerError with default headers values -func NewUpdateServiceAutoscalerPauseInternalServerError() *UpdateServiceAutoscalerPauseInternalServerError { - return &UpdateServiceAutoscalerPauseInternalServerError{} -} - -/*UpdateServiceAutoscalerPauseInternalServerError handles this case with default header values. - -Unable to talk to zookeeper -*/ -type UpdateServiceAutoscalerPauseInternalServerError struct { -} - -func (o *UpdateServiceAutoscalerPauseInternalServerError) Error() string { - return fmt.Sprintf("[POST /service_autoscaler/pause][%d] updateServiceAutoscalerPauseInternalServerError ", 500) -} - -func (o *UpdateServiceAutoscalerPauseInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -/*UpdateServiceAutoscalerPauseBody update service autoscaler pause body -swagger:model UpdateServiceAutoscalerPauseBody -*/ -type UpdateServiceAutoscalerPauseBody struct { - - // minutes - Minutes int64 `json:"minutes,omitempty"` -} - -// Validate validates this update service autoscaler pause body -func (o *UpdateServiceAutoscalerPauseBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateServiceAutoscalerPauseBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateServiceAutoscalerPauseBody) UnmarshalBinary(b []byte) error { - var res UpdateServiceAutoscalerPauseBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paastaapi/client/paasta_client.go b/pkg/paastaapi/client/paasta_client.go deleted file mode 100644 index 6ab044e..0000000 --- a/pkg/paastaapi/client/paasta_client.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/client/autoscaler" - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/client/marathon_dashboard" - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/client/operations" - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/client/resources" - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/client/service" -) - -// Default paasta HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/v1" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new paasta HTTP client. -func NewHTTPClient(formats strfmt.Registry) *Paasta { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new paasta HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Paasta { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new paasta client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Paasta { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(Paasta) - cli.Transport = transport - cli.Autoscaler = autoscaler.New(transport, formats) - cli.MarathonDashboard = marathon_dashboard.New(transport, formats) - cli.Operations = operations.New(transport, formats) - cli.Resources = resources.New(transport, formats) - cli.Service = service.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// Paasta is a client for paasta -type Paasta struct { - Autoscaler autoscaler.ClientService - - MarathonDashboard marathon_dashboard.ClientService - - Operations operations.ClientService - - Resources resources.ClientService - - Service service.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *Paasta) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Autoscaler.SetTransport(transport) - c.MarathonDashboard.SetTransport(transport) - c.Operations.SetTransport(transport) - c.Resources.SetTransport(transport) - c.Service.SetTransport(transport) -} diff --git a/pkg/paastaapi/client/resources/resources_client.go b/pkg/paastaapi/client/resources/resources_client.go deleted file mode 100644 index 94639f3..0000000 --- a/pkg/paastaapi/client/resources/resources_client.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package resources - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new resources API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for resources API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - Resources(params *ResourcesParams) (*ResourcesOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - Resources gets resources in the cluster -*/ -func (a *Client) Resources(params *ResourcesParams) (*ResourcesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewResourcesParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "resources", - Method: "GET", - PathPattern: "/resources/utilization", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ResourcesReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ResourcesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for resources: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paastaapi/client/resources/resources_parameters.go b/pkg/paastaapi/client/resources/resources_parameters.go deleted file mode 100644 index 48a697f..0000000 --- a/pkg/paastaapi/client/resources/resources_parameters.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package resources - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewResourcesParams creates a new ResourcesParams object -// with the default values initialized. -func NewResourcesParams() *ResourcesParams { - var () - return &ResourcesParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewResourcesParamsWithTimeout creates a new ResourcesParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewResourcesParamsWithTimeout(timeout time.Duration) *ResourcesParams { - var () - return &ResourcesParams{ - - timeout: timeout, - } -} - -// NewResourcesParamsWithContext creates a new ResourcesParams object -// with the default values initialized, and the ability to set a context for a request -func NewResourcesParamsWithContext(ctx context.Context) *ResourcesParams { - var () - return &ResourcesParams{ - - Context: ctx, - } -} - -// NewResourcesParamsWithHTTPClient creates a new ResourcesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewResourcesParamsWithHTTPClient(client *http.Client) *ResourcesParams { - var () - return &ResourcesParams{ - HTTPClient: client, - } -} - -/*ResourcesParams contains all the parameters to send to the API endpoint -for the resources operation typically these are written to a http.Request -*/ -type ResourcesParams struct { - - /*Filter - List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'. Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4) - - */ - Filter []string - /*Groupings - comma separated list of keys to group by - - */ - Groupings []string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the resources params -func (o *ResourcesParams) WithTimeout(timeout time.Duration) *ResourcesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the resources params -func (o *ResourcesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the resources params -func (o *ResourcesParams) WithContext(ctx context.Context) *ResourcesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the resources params -func (o *ResourcesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the resources params -func (o *ResourcesParams) WithHTTPClient(client *http.Client) *ResourcesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the resources params -func (o *ResourcesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the resources params -func (o *ResourcesParams) WithFilter(filter []string) *ResourcesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the resources params -func (o *ResourcesParams) SetFilter(filter []string) { - o.Filter = filter -} - -// WithGroupings adds the groupings to the resources params -func (o *ResourcesParams) WithGroupings(groupings []string) *ResourcesParams { - o.SetGroupings(groupings) - return o -} - -// SetGroupings adds the groupings to the resources params -func (o *ResourcesParams) SetGroupings(groupings []string) { - o.Groupings = groupings -} - -// WriteToRequest writes these params to a swagger request -func (o *ResourcesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - valuesFilter := o.Filter - - joinedFilter := swag.JoinByFormat(valuesFilter, "multi") - // query array param filter - if err := r.SetQueryParam("filter", joinedFilter...); err != nil { - return err - } - - valuesGroupings := o.Groupings - - joinedGroupings := swag.JoinByFormat(valuesGroupings, "csv") - // query array param groupings - if err := r.SetQueryParam("groupings", joinedGroupings...); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/resources/resources_responses.go b/pkg/paastaapi/client/resources/resources_responses.go deleted file mode 100644 index 0d143be..0000000 --- a/pkg/paastaapi/client/resources/resources_responses.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package resources - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/models" -) - -// ResourcesReader is a Reader for the Resources structure. -type ResourcesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ResourcesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewResourcesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewResourcesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewResourcesOK creates a ResourcesOK with default headers values -func NewResourcesOK() *ResourcesOK { - return &ResourcesOK{} -} - -/*ResourcesOK handles this case with default header values. - -Resources in the cluster, filtered and grouped by parameters -*/ -type ResourcesOK struct { - Payload models.Resource -} - -func (o *ResourcesOK) Error() string { - return fmt.Sprintf("[GET /resources/utilization][%d] resourcesOK %+v", 200, o.Payload) -} - -func (o *ResourcesOK) GetPayload() models.Resource { - return o.Payload -} - -func (o *ResourcesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewResourcesBadRequest creates a ResourcesBadRequest with default headers values -func NewResourcesBadRequest() *ResourcesBadRequest { - return &ResourcesBadRequest{} -} - -/*ResourcesBadRequest handles this case with default header values. - -Poorly formated query parameters -*/ -type ResourcesBadRequest struct { -} - -func (o *ResourcesBadRequest) Error() string { - return fmt.Sprintf("[GET /resources/utilization][%d] resourcesBadRequest ", 400) -} - -func (o *ResourcesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paastaapi/client/service/delay_instance_parameters.go b/pkg/paastaapi/client/service/delay_instance_parameters.go deleted file mode 100644 index 3b90c31..0000000 --- a/pkg/paastaapi/client/service/delay_instance_parameters.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDelayInstanceParams creates a new DelayInstanceParams object -// with the default values initialized. -func NewDelayInstanceParams() *DelayInstanceParams { - var () - return &DelayInstanceParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDelayInstanceParamsWithTimeout creates a new DelayInstanceParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDelayInstanceParamsWithTimeout(timeout time.Duration) *DelayInstanceParams { - var () - return &DelayInstanceParams{ - - timeout: timeout, - } -} - -// NewDelayInstanceParamsWithContext creates a new DelayInstanceParams object -// with the default values initialized, and the ability to set a context for a request -func NewDelayInstanceParamsWithContext(ctx context.Context) *DelayInstanceParams { - var () - return &DelayInstanceParams{ - - Context: ctx, - } -} - -// NewDelayInstanceParamsWithHTTPClient creates a new DelayInstanceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDelayInstanceParamsWithHTTPClient(client *http.Client) *DelayInstanceParams { - var () - return &DelayInstanceParams{ - HTTPClient: client, - } -} - -/*DelayInstanceParams contains all the parameters to send to the API endpoint -for the delay instance operation typically these are written to a http.Request -*/ -type DelayInstanceParams struct { - - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the delay instance params -func (o *DelayInstanceParams) WithTimeout(timeout time.Duration) *DelayInstanceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delay instance params -func (o *DelayInstanceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delay instance params -func (o *DelayInstanceParams) WithContext(ctx context.Context) *DelayInstanceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delay instance params -func (o *DelayInstanceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delay instance params -func (o *DelayInstanceParams) WithHTTPClient(client *http.Client) *DelayInstanceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delay instance params -func (o *DelayInstanceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the delay instance params -func (o *DelayInstanceParams) WithInstance(instance string) *DelayInstanceParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the delay instance params -func (o *DelayInstanceParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the delay instance params -func (o *DelayInstanceParams) WithService(service string) *DelayInstanceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the delay instance params -func (o *DelayInstanceParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *DelayInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/service/delay_instance_responses.go b/pkg/paastaapi/client/service/delay_instance_responses.go deleted file mode 100644 index 188a8f4..0000000 --- a/pkg/paastaapi/client/service/delay_instance_responses.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/models" -) - -// DelayInstanceReader is a Reader for the DelayInstance structure. -type DelayInstanceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DelayInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDelayInstanceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 204: - result := NewDelayInstanceNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewDelayInstanceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDelayInstanceInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewDelayInstanceOK creates a DelayInstanceOK with default headers values -func NewDelayInstanceOK() *DelayInstanceOK { - return &DelayInstanceOK{} -} - -/*DelayInstanceOK handles this case with default header values. - -The service is delayed for these possible reasons -*/ -type DelayInstanceOK struct { - Payload models.InstanceDelay -} - -func (o *DelayInstanceOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceOK %+v", 200, o.Payload) -} - -func (o *DelayInstanceOK) GetPayload() models.InstanceDelay { - return o.Payload -} - -func (o *DelayInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDelayInstanceNoContent creates a DelayInstanceNoContent with default headers values -func NewDelayInstanceNoContent() *DelayInstanceNoContent { - return &DelayInstanceNoContent{} -} - -/*DelayInstanceNoContent handles this case with default header values. - -Could not find any reasons for a delay -*/ -type DelayInstanceNoContent struct { -} - -func (o *DelayInstanceNoContent) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceNoContent ", 204) -} - -func (o *DelayInstanceNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDelayInstanceNotFound creates a DelayInstanceNotFound with default headers values -func NewDelayInstanceNotFound() *DelayInstanceNotFound { - return &DelayInstanceNotFound{} -} - -/*DelayInstanceNotFound handles this case with default header values. - -Deployment key not found -*/ -type DelayInstanceNotFound struct { -} - -func (o *DelayInstanceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceNotFound ", 404) -} - -func (o *DelayInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDelayInstanceInternalServerError creates a DelayInstanceInternalServerError with default headers values -func NewDelayInstanceInternalServerError() *DelayInstanceInternalServerError { - return &DelayInstanceInternalServerError{} -} - -/*DelayInstanceInternalServerError handles this case with default header values. - -Instance failure -*/ -type DelayInstanceInternalServerError struct { -} - -func (o *DelayInstanceInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/delay][%d] delayInstanceInternalServerError ", 500) -} - -func (o *DelayInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paastaapi/client/service/instance_set_state_parameters.go b/pkg/paastaapi/client/service/instance_set_state_parameters.go deleted file mode 100644 index 3359d4e..0000000 --- a/pkg/paastaapi/client/service/instance_set_state_parameters.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewInstanceSetStateParams creates a new InstanceSetStateParams object -// with the default values initialized. -func NewInstanceSetStateParams() *InstanceSetStateParams { - var () - return &InstanceSetStateParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewInstanceSetStateParamsWithTimeout creates a new InstanceSetStateParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewInstanceSetStateParamsWithTimeout(timeout time.Duration) *InstanceSetStateParams { - var () - return &InstanceSetStateParams{ - - timeout: timeout, - } -} - -// NewInstanceSetStateParamsWithContext creates a new InstanceSetStateParams object -// with the default values initialized, and the ability to set a context for a request -func NewInstanceSetStateParamsWithContext(ctx context.Context) *InstanceSetStateParams { - var () - return &InstanceSetStateParams{ - - Context: ctx, - } -} - -// NewInstanceSetStateParamsWithHTTPClient creates a new InstanceSetStateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewInstanceSetStateParamsWithHTTPClient(client *http.Client) *InstanceSetStateParams { - var () - return &InstanceSetStateParams{ - HTTPClient: client, - } -} - -/*InstanceSetStateParams contains all the parameters to send to the API endpoint -for the instance set state operation typically these are written to a http.Request -*/ -type InstanceSetStateParams struct { - - /*DesiredState - Desired state - - */ - DesiredState string - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the instance set state params -func (o *InstanceSetStateParams) WithTimeout(timeout time.Duration) *InstanceSetStateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the instance set state params -func (o *InstanceSetStateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the instance set state params -func (o *InstanceSetStateParams) WithContext(ctx context.Context) *InstanceSetStateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the instance set state params -func (o *InstanceSetStateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the instance set state params -func (o *InstanceSetStateParams) WithHTTPClient(client *http.Client) *InstanceSetStateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the instance set state params -func (o *InstanceSetStateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithDesiredState adds the desiredState to the instance set state params -func (o *InstanceSetStateParams) WithDesiredState(desiredState string) *InstanceSetStateParams { - o.SetDesiredState(desiredState) - return o -} - -// SetDesiredState adds the desiredState to the instance set state params -func (o *InstanceSetStateParams) SetDesiredState(desiredState string) { - o.DesiredState = desiredState -} - -// WithInstance adds the instance to the instance set state params -func (o *InstanceSetStateParams) WithInstance(instance string) *InstanceSetStateParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the instance set state params -func (o *InstanceSetStateParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the instance set state params -func (o *InstanceSetStateParams) WithService(service string) *InstanceSetStateParams { - o.SetService(service) - return o -} - -// SetService adds the service to the instance set state params -func (o *InstanceSetStateParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *InstanceSetStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param desired_state - if err := r.SetPathParam("desired_state", o.DesiredState); err != nil { - return err - } - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/service/instance_set_state_responses.go b/pkg/paastaapi/client/service/instance_set_state_responses.go deleted file mode 100644 index d5a8496..0000000 --- a/pkg/paastaapi/client/service/instance_set_state_responses.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// InstanceSetStateReader is a Reader for the InstanceSetState structure. -type InstanceSetStateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InstanceSetStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInstanceSetStateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewInstanceSetStateNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewInstanceSetStateInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewInstanceSetStateOK creates a InstanceSetStateOK with default headers values -func NewInstanceSetStateOK() *InstanceSetStateOK { - return &InstanceSetStateOK{} -} - -/*InstanceSetStateOK handles this case with default header values. - -Result of instance state change -*/ -type InstanceSetStateOK struct { -} - -func (o *InstanceSetStateOK) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/state/{desired_state}][%d] instanceSetStateOK ", 200) -} - -func (o *InstanceSetStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewInstanceSetStateNotFound creates a InstanceSetStateNotFound with default headers values -func NewInstanceSetStateNotFound() *InstanceSetStateNotFound { - return &InstanceSetStateNotFound{} -} - -/*InstanceSetStateNotFound handles this case with default header values. - -Deployment key not found -*/ -type InstanceSetStateNotFound struct { -} - -func (o *InstanceSetStateNotFound) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/state/{desired_state}][%d] instanceSetStateNotFound ", 404) -} - -func (o *InstanceSetStateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewInstanceSetStateInternalServerError creates a InstanceSetStateInternalServerError with default headers values -func NewInstanceSetStateInternalServerError() *InstanceSetStateInternalServerError { - return &InstanceSetStateInternalServerError{} -} - -/*InstanceSetStateInternalServerError handles this case with default header values. - -Instance failure -*/ -type InstanceSetStateInternalServerError struct { -} - -func (o *InstanceSetStateInternalServerError) Error() string { - return fmt.Sprintf("[POST /services/{service}/{instance}/state/{desired_state}][%d] instanceSetStateInternalServerError ", 500) -} - -func (o *InstanceSetStateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paastaapi/client/service/list_instances_parameters.go b/pkg/paastaapi/client/service/list_instances_parameters.go deleted file mode 100644 index e36e755..0000000 --- a/pkg/paastaapi/client/service/list_instances_parameters.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListInstancesParams creates a new ListInstancesParams object -// with the default values initialized. -func NewListInstancesParams() *ListInstancesParams { - var () - return &ListInstancesParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewListInstancesParamsWithTimeout creates a new ListInstancesParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewListInstancesParamsWithTimeout(timeout time.Duration) *ListInstancesParams { - var () - return &ListInstancesParams{ - - timeout: timeout, - } -} - -// NewListInstancesParamsWithContext creates a new ListInstancesParams object -// with the default values initialized, and the ability to set a context for a request -func NewListInstancesParamsWithContext(ctx context.Context) *ListInstancesParams { - var () - return &ListInstancesParams{ - - Context: ctx, - } -} - -// NewListInstancesParamsWithHTTPClient creates a new ListInstancesParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewListInstancesParamsWithHTTPClient(client *http.Client) *ListInstancesParams { - var () - return &ListInstancesParams{ - HTTPClient: client, - } -} - -/*ListInstancesParams contains all the parameters to send to the API endpoint -for the list instances operation typically these are written to a http.Request -*/ -type ListInstancesParams struct { - - /*Service - Service name - - */ - Service string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the list instances params -func (o *ListInstancesParams) WithTimeout(timeout time.Duration) *ListInstancesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list instances params -func (o *ListInstancesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list instances params -func (o *ListInstancesParams) WithContext(ctx context.Context) *ListInstancesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list instances params -func (o *ListInstancesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list instances params -func (o *ListInstancesParams) WithHTTPClient(client *http.Client) *ListInstancesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list instances params -func (o *ListInstancesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithService adds the service to the list instances params -func (o *ListInstancesParams) WithService(service string) *ListInstancesParams { - o.SetService(service) - return o -} - -// SetService adds the service to the list instances params -func (o *ListInstancesParams) SetService(service string) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *ListInstancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/service/list_instances_responses.go b/pkg/paastaapi/client/service/list_instances_responses.go deleted file mode 100644 index 0ca8f18..0000000 --- a/pkg/paastaapi/client/service/list_instances_responses.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListInstancesReader is a Reader for the ListInstances structure. -type ListInstancesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListInstancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListInstancesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewListInstancesOK creates a ListInstancesOK with default headers values -func NewListInstancesOK() *ListInstancesOK { - return &ListInstancesOK{} -} - -/*ListInstancesOK handles this case with default header values. - -Instances of a service -*/ -type ListInstancesOK struct { - Payload *ListInstancesOKBody -} - -func (o *ListInstancesOK) Error() string { - return fmt.Sprintf("[GET /services/{service}][%d] listInstancesOK %+v", 200, o.Payload) -} - -func (o *ListInstancesOK) GetPayload() *ListInstancesOKBody { - return o.Payload -} - -func (o *ListInstancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(ListInstancesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/*ListInstancesOKBody list instances o k body -swagger:model ListInstancesOKBody -*/ -type ListInstancesOKBody struct { - - // instances - Instances []string `json:"instances"` -} - -// Validate validates this list instances o k body -func (o *ListInstancesOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListInstancesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListInstancesOKBody) UnmarshalBinary(b []byte) error { - var res ListInstancesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paastaapi/client/service/list_services_for_cluster_parameters.go b/pkg/paastaapi/client/service/list_services_for_cluster_parameters.go deleted file mode 100644 index d2c6416..0000000 --- a/pkg/paastaapi/client/service/list_services_for_cluster_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListServicesForClusterParams creates a new ListServicesForClusterParams object -// with the default values initialized. -func NewListServicesForClusterParams() *ListServicesForClusterParams { - - return &ListServicesForClusterParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewListServicesForClusterParamsWithTimeout creates a new ListServicesForClusterParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewListServicesForClusterParamsWithTimeout(timeout time.Duration) *ListServicesForClusterParams { - - return &ListServicesForClusterParams{ - - timeout: timeout, - } -} - -// NewListServicesForClusterParamsWithContext creates a new ListServicesForClusterParams object -// with the default values initialized, and the ability to set a context for a request -func NewListServicesForClusterParamsWithContext(ctx context.Context) *ListServicesForClusterParams { - - return &ListServicesForClusterParams{ - - Context: ctx, - } -} - -// NewListServicesForClusterParamsWithHTTPClient creates a new ListServicesForClusterParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewListServicesForClusterParamsWithHTTPClient(client *http.Client) *ListServicesForClusterParams { - - return &ListServicesForClusterParams{ - HTTPClient: client, - } -} - -/*ListServicesForClusterParams contains all the parameters to send to the API endpoint -for the list services for cluster operation typically these are written to a http.Request -*/ -type ListServicesForClusterParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the list services for cluster params -func (o *ListServicesForClusterParams) WithTimeout(timeout time.Duration) *ListServicesForClusterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list services for cluster params -func (o *ListServicesForClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list services for cluster params -func (o *ListServicesForClusterParams) WithContext(ctx context.Context) *ListServicesForClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list services for cluster params -func (o *ListServicesForClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list services for cluster params -func (o *ListServicesForClusterParams) WithHTTPClient(client *http.Client) *ListServicesForClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list services for cluster params -func (o *ListServicesForClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServicesForClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/service/list_services_for_cluster_responses.go b/pkg/paastaapi/client/service/list_services_for_cluster_responses.go deleted file mode 100644 index d17c09b..0000000 --- a/pkg/paastaapi/client/service/list_services_for_cluster_responses.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListServicesForClusterReader is a Reader for the ListServicesForCluster structure. -type ListServicesForClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicesForClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServicesForClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewListServicesForClusterOK creates a ListServicesForClusterOK with default headers values -func NewListServicesForClusterOK() *ListServicesForClusterOK { - return &ListServicesForClusterOK{} -} - -/*ListServicesForClusterOK handles this case with default header values. - -Services and their instances on the current cluster -*/ -type ListServicesForClusterOK struct { - Payload *ListServicesForClusterOKBody -} - -func (o *ListServicesForClusterOK) Error() string { - return fmt.Sprintf("[GET /services][%d] listServicesForClusterOK %+v", 200, o.Payload) -} - -func (o *ListServicesForClusterOK) GetPayload() *ListServicesForClusterOKBody { - return o.Payload -} - -func (o *ListServicesForClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(ListServicesForClusterOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/*ListServicesForClusterOKBody list services for cluster o k body -swagger:model ListServicesForClusterOKBody -*/ -type ListServicesForClusterOKBody struct { - - // services - Services [][]interface{} `json:"services"` -} - -// Validate validates this list services for cluster o k body -func (o *ListServicesForClusterOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListServicesForClusterOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListServicesForClusterOKBody) UnmarshalBinary(b []byte) error { - var res ListServicesForClusterOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/paastaapi/client/service/service_client.go b/pkg/paastaapi/client/service/service_client.go deleted file mode 100644 index 0edf5a3..0000000 --- a/pkg/paastaapi/client/service/service_client.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) - - InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) - - ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) - - ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) - - StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) - - TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) - - TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DelayInstance gets the possible reasons for a deployment delay for a marathon service instance -*/ -func (a *Client) DelayInstance(params *DelayInstanceParams) (*DelayInstanceOK, *DelayInstanceNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDelayInstanceParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "delay_instance", - Method: "GET", - PathPattern: "/services/{service}/{instance}/delay", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DelayInstanceReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, nil, err - } - switch value := result.(type) { - case *DelayInstanceOK: - return value, nil, nil - case *DelayInstanceNoContent: - return nil, value, nil - } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for service: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - InstanceSetState changes state of service name instance name -*/ -func (a *Client) InstanceSetState(params *InstanceSetStateParams) (*InstanceSetStateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInstanceSetStateParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "instance_set_state", - Method: "POST", - PathPattern: "/services/{service}/{instance}/state/{desired_state}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &InstanceSetStateReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*InstanceSetStateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for instance_set_state: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListInstances lists instances of service name -*/ -func (a *Client) ListInstances(params *ListInstancesParams) (*ListInstancesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListInstancesParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "list_instances", - Method: "GET", - PathPattern: "/services/{service}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ListInstancesReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ListInstancesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for list_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServicesForCluster lists service names and service instance names on the current cluster -*/ -func (a *Client) ListServicesForCluster(params *ListServicesForClusterParams) (*ListServicesForClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServicesForClusterParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "list_services_for_cluster", - Method: "GET", - PathPattern: "/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ListServicesForClusterReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*ListServicesForClusterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for list_services_for_cluster: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - StatusInstance gets status of service name instance name -*/ -func (a *Client) StatusInstance(params *StatusInstanceParams) (*StatusInstanceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewStatusInstanceParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "status_instance", - Method: "GET", - PathPattern: "/services/{service}/{instance}/status", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &StatusInstanceReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*StatusInstanceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for status_instance: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - TaskInstance gets mesos task of service name instance name by task id -*/ -func (a *Client) TaskInstance(params *TaskInstanceParams) (*TaskInstanceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewTaskInstanceParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "task_instance", - Method: "GET", - PathPattern: "/services/{service}/{instance}/tasks/{task_id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &TaskInstanceReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*TaskInstanceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for task_instance: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - TasksInstance gets mesos tasks of service name instance name -*/ -func (a *Client) TasksInstance(params *TasksInstanceParams) (*TasksInstanceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewTasksInstanceParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "tasks_instance", - Method: "GET", - PathPattern: "/services/{service}/{instance}/tasks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, - Schemes: []string{"http"}, - Params: params, - Reader: &TasksInstanceReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*TasksInstanceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for tasks_instance: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/paastaapi/client/service/status_instance_parameters.go b/pkg/paastaapi/client/service/status_instance_parameters.go deleted file mode 100644 index c20547d..0000000 --- a/pkg/paastaapi/client/service/status_instance_parameters.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewStatusInstanceParams creates a new StatusInstanceParams object -// with the default values initialized. -func NewStatusInstanceParams() *StatusInstanceParams { - var () - return &StatusInstanceParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewStatusInstanceParamsWithTimeout creates a new StatusInstanceParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewStatusInstanceParamsWithTimeout(timeout time.Duration) *StatusInstanceParams { - var () - return &StatusInstanceParams{ - - timeout: timeout, - } -} - -// NewStatusInstanceParamsWithContext creates a new StatusInstanceParams object -// with the default values initialized, and the ability to set a context for a request -func NewStatusInstanceParamsWithContext(ctx context.Context) *StatusInstanceParams { - var () - return &StatusInstanceParams{ - - Context: ctx, - } -} - -// NewStatusInstanceParamsWithHTTPClient creates a new StatusInstanceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewStatusInstanceParamsWithHTTPClient(client *http.Client) *StatusInstanceParams { - var () - return &StatusInstanceParams{ - HTTPClient: client, - } -} - -/*StatusInstanceParams contains all the parameters to send to the API endpoint -for the status instance operation typically these are written to a http.Request -*/ -type StatusInstanceParams struct { - - /*IncludeEnvoy - Include Envoy information - - */ - IncludeEnvoy *bool - /*IncludeMesos - Include Mesos information - - */ - IncludeMesos *bool - /*IncludeSmartstack - Include Smartstack information - - */ - IncludeSmartstack *bool - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - /*Verbose - Include verbose status information - - */ - Verbose *int32 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the status instance params -func (o *StatusInstanceParams) WithTimeout(timeout time.Duration) *StatusInstanceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the status instance params -func (o *StatusInstanceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the status instance params -func (o *StatusInstanceParams) WithContext(ctx context.Context) *StatusInstanceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the status instance params -func (o *StatusInstanceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the status instance params -func (o *StatusInstanceParams) WithHTTPClient(client *http.Client) *StatusInstanceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the status instance params -func (o *StatusInstanceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIncludeEnvoy adds the includeEnvoy to the status instance params -func (o *StatusInstanceParams) WithIncludeEnvoy(includeEnvoy *bool) *StatusInstanceParams { - o.SetIncludeEnvoy(includeEnvoy) - return o -} - -// SetIncludeEnvoy adds the includeEnvoy to the status instance params -func (o *StatusInstanceParams) SetIncludeEnvoy(includeEnvoy *bool) { - o.IncludeEnvoy = includeEnvoy -} - -// WithIncludeMesos adds the includeMesos to the status instance params -func (o *StatusInstanceParams) WithIncludeMesos(includeMesos *bool) *StatusInstanceParams { - o.SetIncludeMesos(includeMesos) - return o -} - -// SetIncludeMesos adds the includeMesos to the status instance params -func (o *StatusInstanceParams) SetIncludeMesos(includeMesos *bool) { - o.IncludeMesos = includeMesos -} - -// WithIncludeSmartstack adds the includeSmartstack to the status instance params -func (o *StatusInstanceParams) WithIncludeSmartstack(includeSmartstack *bool) *StatusInstanceParams { - o.SetIncludeSmartstack(includeSmartstack) - return o -} - -// SetIncludeSmartstack adds the includeSmartstack to the status instance params -func (o *StatusInstanceParams) SetIncludeSmartstack(includeSmartstack *bool) { - o.IncludeSmartstack = includeSmartstack -} - -// WithInstance adds the instance to the status instance params -func (o *StatusInstanceParams) WithInstance(instance string) *StatusInstanceParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the status instance params -func (o *StatusInstanceParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the status instance params -func (o *StatusInstanceParams) WithService(service string) *StatusInstanceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the status instance params -func (o *StatusInstanceParams) SetService(service string) { - o.Service = service -} - -// WithVerbose adds the verbose to the status instance params -func (o *StatusInstanceParams) WithVerbose(verbose *int32) *StatusInstanceParams { - o.SetVerbose(verbose) - return o -} - -// SetVerbose adds the verbose to the status instance params -func (o *StatusInstanceParams) SetVerbose(verbose *int32) { - o.Verbose = verbose -} - -// WriteToRequest writes these params to a swagger request -func (o *StatusInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.IncludeEnvoy != nil { - - // query param include_envoy - var qrIncludeEnvoy bool - if o.IncludeEnvoy != nil { - qrIncludeEnvoy = *o.IncludeEnvoy - } - qIncludeEnvoy := swag.FormatBool(qrIncludeEnvoy) - if qIncludeEnvoy != "" { - if err := r.SetQueryParam("include_envoy", qIncludeEnvoy); err != nil { - return err - } - } - - } - - if o.IncludeMesos != nil { - - // query param include_mesos - var qrIncludeMesos bool - if o.IncludeMesos != nil { - qrIncludeMesos = *o.IncludeMesos - } - qIncludeMesos := swag.FormatBool(qrIncludeMesos) - if qIncludeMesos != "" { - if err := r.SetQueryParam("include_mesos", qIncludeMesos); err != nil { - return err - } - } - - } - - if o.IncludeSmartstack != nil { - - // query param include_smartstack - var qrIncludeSmartstack bool - if o.IncludeSmartstack != nil { - qrIncludeSmartstack = *o.IncludeSmartstack - } - qIncludeSmartstack := swag.FormatBool(qrIncludeSmartstack) - if qIncludeSmartstack != "" { - if err := r.SetQueryParam("include_smartstack", qIncludeSmartstack); err != nil { - return err - } - } - - } - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if o.Verbose != nil { - - // query param verbose - var qrVerbose int32 - if o.Verbose != nil { - qrVerbose = *o.Verbose - } - qVerbose := swag.FormatInt32(qrVerbose) - if qVerbose != "" { - if err := r.SetQueryParam("verbose", qVerbose); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/service/status_instance_responses.go b/pkg/paastaapi/client/service/status_instance_responses.go deleted file mode 100644 index 22d8f6c..0000000 --- a/pkg/paastaapi/client/service/status_instance_responses.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/models" -) - -// StatusInstanceReader is a Reader for the StatusInstance structure. -type StatusInstanceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *StatusInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewStatusInstanceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewStatusInstanceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewStatusInstanceInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewStatusInstanceOK creates a StatusInstanceOK with default headers values -func NewStatusInstanceOK() *StatusInstanceOK { - return &StatusInstanceOK{} -} - -/*StatusInstanceOK handles this case with default header values. - -Detailed status of an instance -*/ -type StatusInstanceOK struct { - Payload *models.InstanceStatus -} - -func (o *StatusInstanceOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/status][%d] statusInstanceOK %+v", 200, o.Payload) -} - -func (o *StatusInstanceOK) GetPayload() *models.InstanceStatus { - return o.Payload -} - -func (o *StatusInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.InstanceStatus) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewStatusInstanceNotFound creates a StatusInstanceNotFound with default headers values -func NewStatusInstanceNotFound() *StatusInstanceNotFound { - return &StatusInstanceNotFound{} -} - -/*StatusInstanceNotFound handles this case with default header values. - -Deployment key not found -*/ -type StatusInstanceNotFound struct { -} - -func (o *StatusInstanceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/status][%d] statusInstanceNotFound ", 404) -} - -func (o *StatusInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewStatusInstanceInternalServerError creates a StatusInstanceInternalServerError with default headers values -func NewStatusInstanceInternalServerError() *StatusInstanceInternalServerError { - return &StatusInstanceInternalServerError{} -} - -/*StatusInstanceInternalServerError handles this case with default header values. - -Instance failure -*/ -type StatusInstanceInternalServerError struct { -} - -func (o *StatusInstanceInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/status][%d] statusInstanceInternalServerError ", 500) -} - -func (o *StatusInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paastaapi/client/service/task_instance_parameters.go b/pkg/paastaapi/client/service/task_instance_parameters.go deleted file mode 100644 index 9cada39..0000000 --- a/pkg/paastaapi/client/service/task_instance_parameters.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewTaskInstanceParams creates a new TaskInstanceParams object -// with the default values initialized. -func NewTaskInstanceParams() *TaskInstanceParams { - var () - return &TaskInstanceParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewTaskInstanceParamsWithTimeout creates a new TaskInstanceParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewTaskInstanceParamsWithTimeout(timeout time.Duration) *TaskInstanceParams { - var () - return &TaskInstanceParams{ - - timeout: timeout, - } -} - -// NewTaskInstanceParamsWithContext creates a new TaskInstanceParams object -// with the default values initialized, and the ability to set a context for a request -func NewTaskInstanceParamsWithContext(ctx context.Context) *TaskInstanceParams { - var () - return &TaskInstanceParams{ - - Context: ctx, - } -} - -// NewTaskInstanceParamsWithHTTPClient creates a new TaskInstanceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewTaskInstanceParamsWithHTTPClient(client *http.Client) *TaskInstanceParams { - var () - return &TaskInstanceParams{ - HTTPClient: client, - } -} - -/*TaskInstanceParams contains all the parameters to send to the API endpoint -for the task instance operation typically these are written to a http.Request -*/ -type TaskInstanceParams struct { - - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - /*TaskID - mesos task id - - */ - TaskID string - /*Verbose - Return slave and executor for task - - */ - Verbose *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the task instance params -func (o *TaskInstanceParams) WithTimeout(timeout time.Duration) *TaskInstanceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the task instance params -func (o *TaskInstanceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the task instance params -func (o *TaskInstanceParams) WithContext(ctx context.Context) *TaskInstanceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the task instance params -func (o *TaskInstanceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the task instance params -func (o *TaskInstanceParams) WithHTTPClient(client *http.Client) *TaskInstanceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the task instance params -func (o *TaskInstanceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the task instance params -func (o *TaskInstanceParams) WithInstance(instance string) *TaskInstanceParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the task instance params -func (o *TaskInstanceParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the task instance params -func (o *TaskInstanceParams) WithService(service string) *TaskInstanceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the task instance params -func (o *TaskInstanceParams) SetService(service string) { - o.Service = service -} - -// WithTaskID adds the taskID to the task instance params -func (o *TaskInstanceParams) WithTaskID(taskID string) *TaskInstanceParams { - o.SetTaskID(taskID) - return o -} - -// SetTaskID adds the taskId to the task instance params -func (o *TaskInstanceParams) SetTaskID(taskID string) { - o.TaskID = taskID -} - -// WithVerbose adds the verbose to the task instance params -func (o *TaskInstanceParams) WithVerbose(verbose *bool) *TaskInstanceParams { - o.SetVerbose(verbose) - return o -} - -// SetVerbose adds the verbose to the task instance params -func (o *TaskInstanceParams) SetVerbose(verbose *bool) { - o.Verbose = verbose -} - -// WriteToRequest writes these params to a swagger request -func (o *TaskInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - // path param task_id - if err := r.SetPathParam("task_id", o.TaskID); err != nil { - return err - } - - if o.Verbose != nil { - - // query param verbose - var qrVerbose bool - if o.Verbose != nil { - qrVerbose = *o.Verbose - } - qVerbose := swag.FormatBool(qrVerbose) - if qVerbose != "" { - if err := r.SetQueryParam("verbose", qVerbose); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/service/task_instance_responses.go b/pkg/paastaapi/client/service/task_instance_responses.go deleted file mode 100644 index b8cc88a..0000000 --- a/pkg/paastaapi/client/service/task_instance_responses.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/models" -) - -// TaskInstanceReader is a Reader for the TaskInstance structure. -type TaskInstanceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *TaskInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewTaskInstanceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewTaskInstanceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewTaskInstanceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewTaskInstanceInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewTaskInstanceOK creates a TaskInstanceOK with default headers values -func NewTaskInstanceOK() *TaskInstanceOK { - return &TaskInstanceOK{} -} - -/*TaskInstanceOK handles this case with default header values. - -Task associated with an instance with specified ID -*/ -type TaskInstanceOK struct { - Payload models.InstanceTask -} - -func (o *TaskInstanceOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceOK %+v", 200, o.Payload) -} - -func (o *TaskInstanceOK) GetPayload() models.InstanceTask { - return o.Payload -} - -func (o *TaskInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewTaskInstanceBadRequest creates a TaskInstanceBadRequest with default headers values -func NewTaskInstanceBadRequest() *TaskInstanceBadRequest { - return &TaskInstanceBadRequest{} -} - -/*TaskInstanceBadRequest handles this case with default header values. - -Bad request -*/ -type TaskInstanceBadRequest struct { -} - -func (o *TaskInstanceBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceBadRequest ", 400) -} - -func (o *TaskInstanceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewTaskInstanceNotFound creates a TaskInstanceNotFound with default headers values -func NewTaskInstanceNotFound() *TaskInstanceNotFound { - return &TaskInstanceNotFound{} -} - -/*TaskInstanceNotFound handles this case with default header values. - -Task with ID not found -*/ -type TaskInstanceNotFound struct { -} - -func (o *TaskInstanceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceNotFound ", 404) -} - -func (o *TaskInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewTaskInstanceInternalServerError creates a TaskInstanceInternalServerError with default headers values -func NewTaskInstanceInternalServerError() *TaskInstanceInternalServerError { - return &TaskInstanceInternalServerError{} -} - -/*TaskInstanceInternalServerError handles this case with default header values. - -Instance failure -*/ -type TaskInstanceInternalServerError struct { -} - -func (o *TaskInstanceInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks/{task_id}][%d] taskInstanceInternalServerError ", 500) -} - -func (o *TaskInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paastaapi/client/service/tasks_instance_parameters.go b/pkg/paastaapi/client/service/tasks_instance_parameters.go deleted file mode 100644 index fbb920f..0000000 --- a/pkg/paastaapi/client/service/tasks_instance_parameters.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewTasksInstanceParams creates a new TasksInstanceParams object -// with the default values initialized. -func NewTasksInstanceParams() *TasksInstanceParams { - var () - return &TasksInstanceParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewTasksInstanceParamsWithTimeout creates a new TasksInstanceParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewTasksInstanceParamsWithTimeout(timeout time.Duration) *TasksInstanceParams { - var () - return &TasksInstanceParams{ - - timeout: timeout, - } -} - -// NewTasksInstanceParamsWithContext creates a new TasksInstanceParams object -// with the default values initialized, and the ability to set a context for a request -func NewTasksInstanceParamsWithContext(ctx context.Context) *TasksInstanceParams { - var () - return &TasksInstanceParams{ - - Context: ctx, - } -} - -// NewTasksInstanceParamsWithHTTPClient creates a new TasksInstanceParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewTasksInstanceParamsWithHTTPClient(client *http.Client) *TasksInstanceParams { - var () - return &TasksInstanceParams{ - HTTPClient: client, - } -} - -/*TasksInstanceParams contains all the parameters to send to the API endpoint -for the tasks instance operation typically these are written to a http.Request -*/ -type TasksInstanceParams struct { - - /*Instance - Instance name - - */ - Instance string - /*Service - Service name - - */ - Service string - /*SlaveHostname - slave hostname to filter tasks by - - */ - SlaveHostname *string - /*Verbose - Return slave and executor for task - - */ - Verbose *bool - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the tasks instance params -func (o *TasksInstanceParams) WithTimeout(timeout time.Duration) *TasksInstanceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the tasks instance params -func (o *TasksInstanceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the tasks instance params -func (o *TasksInstanceParams) WithContext(ctx context.Context) *TasksInstanceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the tasks instance params -func (o *TasksInstanceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the tasks instance params -func (o *TasksInstanceParams) WithHTTPClient(client *http.Client) *TasksInstanceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the tasks instance params -func (o *TasksInstanceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithInstance adds the instance to the tasks instance params -func (o *TasksInstanceParams) WithInstance(instance string) *TasksInstanceParams { - o.SetInstance(instance) - return o -} - -// SetInstance adds the instance to the tasks instance params -func (o *TasksInstanceParams) SetInstance(instance string) { - o.Instance = instance -} - -// WithService adds the service to the tasks instance params -func (o *TasksInstanceParams) WithService(service string) *TasksInstanceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the tasks instance params -func (o *TasksInstanceParams) SetService(service string) { - o.Service = service -} - -// WithSlaveHostname adds the slaveHostname to the tasks instance params -func (o *TasksInstanceParams) WithSlaveHostname(slaveHostname *string) *TasksInstanceParams { - o.SetSlaveHostname(slaveHostname) - return o -} - -// SetSlaveHostname adds the slaveHostname to the tasks instance params -func (o *TasksInstanceParams) SetSlaveHostname(slaveHostname *string) { - o.SlaveHostname = slaveHostname -} - -// WithVerbose adds the verbose to the tasks instance params -func (o *TasksInstanceParams) WithVerbose(verbose *bool) *TasksInstanceParams { - o.SetVerbose(verbose) - return o -} - -// SetVerbose adds the verbose to the tasks instance params -func (o *TasksInstanceParams) SetVerbose(verbose *bool) { - o.Verbose = verbose -} - -// WriteToRequest writes these params to a swagger request -func (o *TasksInstanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param instance - if err := r.SetPathParam("instance", o.Instance); err != nil { - return err - } - - // path param service - if err := r.SetPathParam("service", o.Service); err != nil { - return err - } - - if o.SlaveHostname != nil { - - // query param slave_hostname - var qrSlaveHostname string - if o.SlaveHostname != nil { - qrSlaveHostname = *o.SlaveHostname - } - qSlaveHostname := qrSlaveHostname - if qSlaveHostname != "" { - if err := r.SetQueryParam("slave_hostname", qSlaveHostname); err != nil { - return err - } - } - - } - - if o.Verbose != nil { - - // query param verbose - var qrVerbose bool - if o.Verbose != nil { - qrVerbose = *o.Verbose - } - qVerbose := swag.FormatBool(qrVerbose) - if qVerbose != "" { - if err := r.SetQueryParam("verbose", qVerbose); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/client/service/tasks_instance_responses.go b/pkg/paastaapi/client/service/tasks_instance_responses.go deleted file mode 100644 index 5b9bd95..0000000 --- a/pkg/paastaapi/client/service/tasks_instance_responses.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/Yelp/paasta-tools-go/pkg/paastaapi/models" -) - -// TasksInstanceReader is a Reader for the TasksInstance structure. -type TasksInstanceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *TasksInstanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewTasksInstanceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewTasksInstanceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewTasksInstanceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewTasksInstanceInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewTasksInstanceOK creates a TasksInstanceOK with default headers values -func NewTasksInstanceOK() *TasksInstanceOK { - return &TasksInstanceOK{} -} - -/*TasksInstanceOK handles this case with default header values. - -List of tasks associated with an instance -*/ -type TasksInstanceOK struct { - Payload models.InstanceTasks -} - -func (o *TasksInstanceOK) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceOK %+v", 200, o.Payload) -} - -func (o *TasksInstanceOK) GetPayload() models.InstanceTasks { - return o.Payload -} - -func (o *TasksInstanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewTasksInstanceBadRequest creates a TasksInstanceBadRequest with default headers values -func NewTasksInstanceBadRequest() *TasksInstanceBadRequest { - return &TasksInstanceBadRequest{} -} - -/*TasksInstanceBadRequest handles this case with default header values. - -Bad request -*/ -type TasksInstanceBadRequest struct { -} - -func (o *TasksInstanceBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceBadRequest ", 400) -} - -func (o *TasksInstanceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewTasksInstanceNotFound creates a TasksInstanceNotFound with default headers values -func NewTasksInstanceNotFound() *TasksInstanceNotFound { - return &TasksInstanceNotFound{} -} - -/*TasksInstanceNotFound handles this case with default header values. - -Deployment key not found -*/ -type TasksInstanceNotFound struct { -} - -func (o *TasksInstanceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceNotFound ", 404) -} - -func (o *TasksInstanceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewTasksInstanceInternalServerError creates a TasksInstanceInternalServerError with default headers values -func NewTasksInstanceInternalServerError() *TasksInstanceInternalServerError { - return &TasksInstanceInternalServerError{} -} - -/*TasksInstanceInternalServerError handles this case with default header values. - -Instance failure -*/ -type TasksInstanceInternalServerError struct { -} - -func (o *TasksInstanceInternalServerError) Error() string { - return fmt.Sprintf("[GET /services/{service}/{instance}/tasks][%d] tasksInstanceInternalServerError ", 500) -} - -func (o *TasksInstanceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/paastaapi/configuration.go b/pkg/paastaapi/configuration.go new file mode 100644 index 0000000..db8a961 --- /dev/null +++ b/pkg/paastaapi/configuration.go @@ -0,0 +1,247 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "{scheme}://{host}/{basePath}", + Description: "No description provided", + Variables: map[string]ServerVariable{ + "basePath": ServerVariable{ + Description: "No description provided", + DefaultValue: "v1", + }, + "host": ServerVariable{ + Description: "No description provided", + DefaultValue: "localhost", + }, + "scheme": ServerVariable{ + Description: "No description provided", + DefaultValue: "http", + EnumValues: []string{ + "http", + "https", + }, + }, + }, + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/pkg/paastaapi/model_adhoc_launch_history.go b/pkg/paastaapi/model_adhoc_launch_history.go new file mode 100644 index 0000000..d31a28f --- /dev/null +++ b/pkg/paastaapi/model_adhoc_launch_history.go @@ -0,0 +1,189 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// AdhocLaunchHistory A single run +type AdhocLaunchHistory struct { + // framework id + FrameworkId *string `json:"framework_id,omitempty"` + // when the job was launched + LaunchTime *string `json:"launch_time,omitempty"` + // id of the single run + RunId *string `json:"run_id,omitempty"` +} + +// NewAdhocLaunchHistory instantiates a new AdhocLaunchHistory object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdhocLaunchHistory() *AdhocLaunchHistory { + this := AdhocLaunchHistory{} + return &this +} + +// NewAdhocLaunchHistoryWithDefaults instantiates a new AdhocLaunchHistory object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdhocLaunchHistoryWithDefaults() *AdhocLaunchHistory { + this := AdhocLaunchHistory{} + return &this +} + +// GetFrameworkId returns the FrameworkId field value if set, zero value otherwise. +func (o *AdhocLaunchHistory) GetFrameworkId() string { + if o == nil || o.FrameworkId == nil { + var ret string + return ret + } + return *o.FrameworkId +} + +// GetFrameworkIdOk returns a tuple with the FrameworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdhocLaunchHistory) GetFrameworkIdOk() (*string, bool) { + if o == nil || o.FrameworkId == nil { + return nil, false + } + return o.FrameworkId, true +} + +// HasFrameworkId returns a boolean if a field has been set. +func (o *AdhocLaunchHistory) HasFrameworkId() bool { + if o != nil && o.FrameworkId != nil { + return true + } + + return false +} + +// SetFrameworkId gets a reference to the given string and assigns it to the FrameworkId field. +func (o *AdhocLaunchHistory) SetFrameworkId(v string) { + o.FrameworkId = &v +} + +// GetLaunchTime returns the LaunchTime field value if set, zero value otherwise. +func (o *AdhocLaunchHistory) GetLaunchTime() string { + if o == nil || o.LaunchTime == nil { + var ret string + return ret + } + return *o.LaunchTime +} + +// GetLaunchTimeOk returns a tuple with the LaunchTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdhocLaunchHistory) GetLaunchTimeOk() (*string, bool) { + if o == nil || o.LaunchTime == nil { + return nil, false + } + return o.LaunchTime, true +} + +// HasLaunchTime returns a boolean if a field has been set. +func (o *AdhocLaunchHistory) HasLaunchTime() bool { + if o != nil && o.LaunchTime != nil { + return true + } + + return false +} + +// SetLaunchTime gets a reference to the given string and assigns it to the LaunchTime field. +func (o *AdhocLaunchHistory) SetLaunchTime(v string) { + o.LaunchTime = &v +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *AdhocLaunchHistory) GetRunId() string { + if o == nil || o.RunId == nil { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdhocLaunchHistory) GetRunIdOk() (*string, bool) { + if o == nil || o.RunId == nil { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *AdhocLaunchHistory) HasRunId() bool { + if o != nil && o.RunId != nil { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *AdhocLaunchHistory) SetRunId(v string) { + o.RunId = &v +} + +func (o AdhocLaunchHistory) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.FrameworkId != nil { + toSerialize["framework_id"] = o.FrameworkId + } + if o.LaunchTime != nil { + toSerialize["launch_time"] = o.LaunchTime + } + if o.RunId != nil { + toSerialize["run_id"] = o.RunId + } + return json.Marshal(toSerialize) +} + +type NullableAdhocLaunchHistory struct { + value *AdhocLaunchHistory + isSet bool +} + +func (v NullableAdhocLaunchHistory) Get() *AdhocLaunchHistory { + return v.value +} + +func (v *NullableAdhocLaunchHistory) Set(val *AdhocLaunchHistory) { + v.value = val + v.isSet = true +} + +func (v NullableAdhocLaunchHistory) IsSet() bool { + return v.isSet +} + +func (v *NullableAdhocLaunchHistory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdhocLaunchHistory(val *AdhocLaunchHistory) *NullableAdhocLaunchHistory { + return &NullableAdhocLaunchHistory{value: val, isSet: true} +} + +func (v NullableAdhocLaunchHistory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdhocLaunchHistory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_deploy_queue.go b/pkg/paastaapi/model_deploy_queue.go new file mode 100644 index 0000000..fd9b04d --- /dev/null +++ b/pkg/paastaapi/model_deploy_queue.go @@ -0,0 +1,152 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// DeployQueue Current state of the deployd queue +type DeployQueue struct { + // Service instances that are ready to be acted on by deployd + AvailableServiceInstances *[]DeployQueueServiceInstance `json:"available_service_instances,omitempty"` + // Service instances that deployd is waiting to act on + UnavailableServiceInstances *[]DeployQueueServiceInstance `json:"unavailable_service_instances,omitempty"` +} + +// NewDeployQueue instantiates a new DeployQueue object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployQueue() *DeployQueue { + this := DeployQueue{} + return &this +} + +// NewDeployQueueWithDefaults instantiates a new DeployQueue object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployQueueWithDefaults() *DeployQueue { + this := DeployQueue{} + return &this +} + +// GetAvailableServiceInstances returns the AvailableServiceInstances field value if set, zero value otherwise. +func (o *DeployQueue) GetAvailableServiceInstances() []DeployQueueServiceInstance { + if o == nil || o.AvailableServiceInstances == nil { + var ret []DeployQueueServiceInstance + return ret + } + return *o.AvailableServiceInstances +} + +// GetAvailableServiceInstancesOk returns a tuple with the AvailableServiceInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueue) GetAvailableServiceInstancesOk() (*[]DeployQueueServiceInstance, bool) { + if o == nil || o.AvailableServiceInstances == nil { + return nil, false + } + return o.AvailableServiceInstances, true +} + +// HasAvailableServiceInstances returns a boolean if a field has been set. +func (o *DeployQueue) HasAvailableServiceInstances() bool { + if o != nil && o.AvailableServiceInstances != nil { + return true + } + + return false +} + +// SetAvailableServiceInstances gets a reference to the given []DeployQueueServiceInstance and assigns it to the AvailableServiceInstances field. +func (o *DeployQueue) SetAvailableServiceInstances(v []DeployQueueServiceInstance) { + o.AvailableServiceInstances = &v +} + +// GetUnavailableServiceInstances returns the UnavailableServiceInstances field value if set, zero value otherwise. +func (o *DeployQueue) GetUnavailableServiceInstances() []DeployQueueServiceInstance { + if o == nil || o.UnavailableServiceInstances == nil { + var ret []DeployQueueServiceInstance + return ret + } + return *o.UnavailableServiceInstances +} + +// GetUnavailableServiceInstancesOk returns a tuple with the UnavailableServiceInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueue) GetUnavailableServiceInstancesOk() (*[]DeployQueueServiceInstance, bool) { + if o == nil || o.UnavailableServiceInstances == nil { + return nil, false + } + return o.UnavailableServiceInstances, true +} + +// HasUnavailableServiceInstances returns a boolean if a field has been set. +func (o *DeployQueue) HasUnavailableServiceInstances() bool { + if o != nil && o.UnavailableServiceInstances != nil { + return true + } + + return false +} + +// SetUnavailableServiceInstances gets a reference to the given []DeployQueueServiceInstance and assigns it to the UnavailableServiceInstances field. +func (o *DeployQueue) SetUnavailableServiceInstances(v []DeployQueueServiceInstance) { + o.UnavailableServiceInstances = &v +} + +func (o DeployQueue) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AvailableServiceInstances != nil { + toSerialize["available_service_instances"] = o.AvailableServiceInstances + } + if o.UnavailableServiceInstances != nil { + toSerialize["unavailable_service_instances"] = o.UnavailableServiceInstances + } + return json.Marshal(toSerialize) +} + +type NullableDeployQueue struct { + value *DeployQueue + isSet bool +} + +func (v NullableDeployQueue) Get() *DeployQueue { + return v.value +} + +func (v *NullableDeployQueue) Set(val *DeployQueue) { + v.value = val + v.isSet = true +} + +func (v NullableDeployQueue) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployQueue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployQueue(val *DeployQueue) *NullableDeployQueue { + return &NullableDeployQueue{value: val, isSet: true} +} + +func (v NullableDeployQueue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployQueue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_deploy_queue_service_instance.go b/pkg/paastaapi/model_deploy_queue_service_instance.go new file mode 100644 index 0000000..aaca1dc --- /dev/null +++ b/pkg/paastaapi/model_deploy_queue_service_instance.go @@ -0,0 +1,411 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// DeployQueueServiceInstance An instance of a service in the deploy queue +type DeployQueueServiceInstance struct { + // Desired timestamp by which the service instance should be bounced + BounceBy *float32 `json:"bounce_by,omitempty"` + // Timestamp at which service instance was first added to the queue + BounceStartTime *float32 `json:"bounce_start_time,omitempty"` + // Timestamp at which the service instance was last added to the queue + EnqueueTime *float32 `json:"enqueue_time,omitempty"` + // Number of times deployment actions have failed on this service instance + Failures *int32 `json:"failures,omitempty"` + // Name of the instance of the service + Instance *string `json:"instance,omitempty"` + // Number of times any deployment action has been taken on this service instance + ProcessedCount *int32 `json:"processed_count,omitempty"` + // Name of the service + Service *string `json:"service,omitempty"` + // Timestamp before which no action should be taken on this service instance + WaitUntil *float32 `json:"wait_until,omitempty"` + // The process that enqueued the task + Watcher *string `json:"watcher,omitempty"` +} + +// NewDeployQueueServiceInstance instantiates a new DeployQueueServiceInstance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployQueueServiceInstance() *DeployQueueServiceInstance { + this := DeployQueueServiceInstance{} + return &this +} + +// NewDeployQueueServiceInstanceWithDefaults instantiates a new DeployQueueServiceInstance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployQueueServiceInstanceWithDefaults() *DeployQueueServiceInstance { + this := DeployQueueServiceInstance{} + return &this +} + +// GetBounceBy returns the BounceBy field value if set, zero value otherwise. +func (o *DeployQueueServiceInstance) GetBounceBy() float32 { + if o == nil || o.BounceBy == nil { + var ret float32 + return ret + } + return *o.BounceBy +} + +// GetBounceByOk returns a tuple with the BounceBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueueServiceInstance) GetBounceByOk() (*float32, bool) { + if o == nil || o.BounceBy == nil { + return nil, false + } + return o.BounceBy, true +} + +// HasBounceBy returns a boolean if a field has been set. +func (o *DeployQueueServiceInstance) HasBounceBy() bool { + if o != nil && o.BounceBy != nil { + return true + } + + return false +} + +// SetBounceBy gets a reference to the given float32 and assigns it to the BounceBy field. +func (o *DeployQueueServiceInstance) SetBounceBy(v float32) { + o.BounceBy = &v +} + +// GetBounceStartTime returns the BounceStartTime field value if set, zero value otherwise. +func (o *DeployQueueServiceInstance) GetBounceStartTime() float32 { + if o == nil || o.BounceStartTime == nil { + var ret float32 + return ret + } + return *o.BounceStartTime +} + +// GetBounceStartTimeOk returns a tuple with the BounceStartTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueueServiceInstance) GetBounceStartTimeOk() (*float32, bool) { + if o == nil || o.BounceStartTime == nil { + return nil, false + } + return o.BounceStartTime, true +} + +// HasBounceStartTime returns a boolean if a field has been set. +func (o *DeployQueueServiceInstance) HasBounceStartTime() bool { + if o != nil && o.BounceStartTime != nil { + return true + } + + return false +} + +// SetBounceStartTime gets a reference to the given float32 and assigns it to the BounceStartTime field. +func (o *DeployQueueServiceInstance) SetBounceStartTime(v float32) { + o.BounceStartTime = &v +} + +// GetEnqueueTime returns the EnqueueTime field value if set, zero value otherwise. +func (o *DeployQueueServiceInstance) GetEnqueueTime() float32 { + if o == nil || o.EnqueueTime == nil { + var ret float32 + return ret + } + return *o.EnqueueTime +} + +// GetEnqueueTimeOk returns a tuple with the EnqueueTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueueServiceInstance) GetEnqueueTimeOk() (*float32, bool) { + if o == nil || o.EnqueueTime == nil { + return nil, false + } + return o.EnqueueTime, true +} + +// HasEnqueueTime returns a boolean if a field has been set. +func (o *DeployQueueServiceInstance) HasEnqueueTime() bool { + if o != nil && o.EnqueueTime != nil { + return true + } + + return false +} + +// SetEnqueueTime gets a reference to the given float32 and assigns it to the EnqueueTime field. +func (o *DeployQueueServiceInstance) SetEnqueueTime(v float32) { + o.EnqueueTime = &v +} + +// GetFailures returns the Failures field value if set, zero value otherwise. +func (o *DeployQueueServiceInstance) GetFailures() int32 { + if o == nil || o.Failures == nil { + var ret int32 + return ret + } + return *o.Failures +} + +// GetFailuresOk returns a tuple with the Failures field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueueServiceInstance) GetFailuresOk() (*int32, bool) { + if o == nil || o.Failures == nil { + return nil, false + } + return o.Failures, true +} + +// HasFailures returns a boolean if a field has been set. +func (o *DeployQueueServiceInstance) HasFailures() bool { + if o != nil && o.Failures != nil { + return true + } + + return false +} + +// SetFailures gets a reference to the given int32 and assigns it to the Failures field. +func (o *DeployQueueServiceInstance) SetFailures(v int32) { + o.Failures = &v +} + +// GetInstance returns the Instance field value if set, zero value otherwise. +func (o *DeployQueueServiceInstance) GetInstance() string { + if o == nil || o.Instance == nil { + var ret string + return ret + } + return *o.Instance +} + +// GetInstanceOk returns a tuple with the Instance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueueServiceInstance) GetInstanceOk() (*string, bool) { + if o == nil || o.Instance == nil { + return nil, false + } + return o.Instance, true +} + +// HasInstance returns a boolean if a field has been set. +func (o *DeployQueueServiceInstance) HasInstance() bool { + if o != nil && o.Instance != nil { + return true + } + + return false +} + +// SetInstance gets a reference to the given string and assigns it to the Instance field. +func (o *DeployQueueServiceInstance) SetInstance(v string) { + o.Instance = &v +} + +// GetProcessedCount returns the ProcessedCount field value if set, zero value otherwise. +func (o *DeployQueueServiceInstance) GetProcessedCount() int32 { + if o == nil || o.ProcessedCount == nil { + var ret int32 + return ret + } + return *o.ProcessedCount +} + +// GetProcessedCountOk returns a tuple with the ProcessedCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueueServiceInstance) GetProcessedCountOk() (*int32, bool) { + if o == nil || o.ProcessedCount == nil { + return nil, false + } + return o.ProcessedCount, true +} + +// HasProcessedCount returns a boolean if a field has been set. +func (o *DeployQueueServiceInstance) HasProcessedCount() bool { + if o != nil && o.ProcessedCount != nil { + return true + } + + return false +} + +// SetProcessedCount gets a reference to the given int32 and assigns it to the ProcessedCount field. +func (o *DeployQueueServiceInstance) SetProcessedCount(v int32) { + o.ProcessedCount = &v +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *DeployQueueServiceInstance) GetService() string { + if o == nil || o.Service == nil { + var ret string + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueueServiceInstance) GetServiceOk() (*string, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *DeployQueueServiceInstance) HasService() bool { + if o != nil && o.Service != nil { + return true + } + + return false +} + +// SetService gets a reference to the given string and assigns it to the Service field. +func (o *DeployQueueServiceInstance) SetService(v string) { + o.Service = &v +} + +// GetWaitUntil returns the WaitUntil field value if set, zero value otherwise. +func (o *DeployQueueServiceInstance) GetWaitUntil() float32 { + if o == nil || o.WaitUntil == nil { + var ret float32 + return ret + } + return *o.WaitUntil +} + +// GetWaitUntilOk returns a tuple with the WaitUntil field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueueServiceInstance) GetWaitUntilOk() (*float32, bool) { + if o == nil || o.WaitUntil == nil { + return nil, false + } + return o.WaitUntil, true +} + +// HasWaitUntil returns a boolean if a field has been set. +func (o *DeployQueueServiceInstance) HasWaitUntil() bool { + if o != nil && o.WaitUntil != nil { + return true + } + + return false +} + +// SetWaitUntil gets a reference to the given float32 and assigns it to the WaitUntil field. +func (o *DeployQueueServiceInstance) SetWaitUntil(v float32) { + o.WaitUntil = &v +} + +// GetWatcher returns the Watcher field value if set, zero value otherwise. +func (o *DeployQueueServiceInstance) GetWatcher() string { + if o == nil || o.Watcher == nil { + var ret string + return ret + } + return *o.Watcher +} + +// GetWatcherOk returns a tuple with the Watcher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployQueueServiceInstance) GetWatcherOk() (*string, bool) { + if o == nil || o.Watcher == nil { + return nil, false + } + return o.Watcher, true +} + +// HasWatcher returns a boolean if a field has been set. +func (o *DeployQueueServiceInstance) HasWatcher() bool { + if o != nil && o.Watcher != nil { + return true + } + + return false +} + +// SetWatcher gets a reference to the given string and assigns it to the Watcher field. +func (o *DeployQueueServiceInstance) SetWatcher(v string) { + o.Watcher = &v +} + +func (o DeployQueueServiceInstance) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.BounceBy != nil { + toSerialize["bounce_by"] = o.BounceBy + } + if o.BounceStartTime != nil { + toSerialize["bounce_start_time"] = o.BounceStartTime + } + if o.EnqueueTime != nil { + toSerialize["enqueue_time"] = o.EnqueueTime + } + if o.Failures != nil { + toSerialize["failures"] = o.Failures + } + if o.Instance != nil { + toSerialize["instance"] = o.Instance + } + if o.ProcessedCount != nil { + toSerialize["processed_count"] = o.ProcessedCount + } + if o.Service != nil { + toSerialize["service"] = o.Service + } + if o.WaitUntil != nil { + toSerialize["wait_until"] = o.WaitUntil + } + if o.Watcher != nil { + toSerialize["watcher"] = o.Watcher + } + return json.Marshal(toSerialize) +} + +type NullableDeployQueueServiceInstance struct { + value *DeployQueueServiceInstance + isSet bool +} + +func (v NullableDeployQueueServiceInstance) Get() *DeployQueueServiceInstance { + return v.value +} + +func (v *NullableDeployQueueServiceInstance) Set(val *DeployQueueServiceInstance) { + v.value = val + v.isSet = true +} + +func (v NullableDeployQueueServiceInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployQueueServiceInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployQueueServiceInstance(val *DeployQueueServiceInstance) *NullableDeployQueueServiceInstance { + return &NullableDeployQueueServiceInstance{value: val, isSet: true} +} + +func (v NullableDeployQueueServiceInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployQueueServiceInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_envoy_backend.go b/pkg/paastaapi/model_envoy_backend.go new file mode 100644 index 0000000..efe0ec4 --- /dev/null +++ b/pkg/paastaapi/model_envoy_backend.go @@ -0,0 +1,300 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// EnvoyBackend struct for EnvoyBackend +type EnvoyBackend struct { + // Address of the host on which the backend is running + Address *string `json:"address,omitempty"` + // Status of the backend in Envoy as reported by the EDS + EdsHealthStatus *string `json:"eds_health_status,omitempty"` + // Whether this backend has an associated task running + HasAssociatedTask *bool `json:"has_associated_task,omitempty"` + // Name of the host on which the backend is running + Hostname *string `json:"hostname,omitempty"` + // Port number on which the backend responds + PortValue *int32 `json:"port_value,omitempty"` + // The weight of this backend in the cluster + Weight *int32 `json:"weight,omitempty"` +} + +// NewEnvoyBackend instantiates a new EnvoyBackend object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnvoyBackend() *EnvoyBackend { + this := EnvoyBackend{} + return &this +} + +// NewEnvoyBackendWithDefaults instantiates a new EnvoyBackend object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnvoyBackendWithDefaults() *EnvoyBackend { + this := EnvoyBackend{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *EnvoyBackend) GetAddress() string { + if o == nil || o.Address == nil { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyBackend) GetAddressOk() (*string, bool) { + if o == nil || o.Address == nil { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *EnvoyBackend) HasAddress() bool { + if o != nil && o.Address != nil { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *EnvoyBackend) SetAddress(v string) { + o.Address = &v +} + +// GetEdsHealthStatus returns the EdsHealthStatus field value if set, zero value otherwise. +func (o *EnvoyBackend) GetEdsHealthStatus() string { + if o == nil || o.EdsHealthStatus == nil { + var ret string + return ret + } + return *o.EdsHealthStatus +} + +// GetEdsHealthStatusOk returns a tuple with the EdsHealthStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyBackend) GetEdsHealthStatusOk() (*string, bool) { + if o == nil || o.EdsHealthStatus == nil { + return nil, false + } + return o.EdsHealthStatus, true +} + +// HasEdsHealthStatus returns a boolean if a field has been set. +func (o *EnvoyBackend) HasEdsHealthStatus() bool { + if o != nil && o.EdsHealthStatus != nil { + return true + } + + return false +} + +// SetEdsHealthStatus gets a reference to the given string and assigns it to the EdsHealthStatus field. +func (o *EnvoyBackend) SetEdsHealthStatus(v string) { + o.EdsHealthStatus = &v +} + +// GetHasAssociatedTask returns the HasAssociatedTask field value if set, zero value otherwise. +func (o *EnvoyBackend) GetHasAssociatedTask() bool { + if o == nil || o.HasAssociatedTask == nil { + var ret bool + return ret + } + return *o.HasAssociatedTask +} + +// GetHasAssociatedTaskOk returns a tuple with the HasAssociatedTask field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyBackend) GetHasAssociatedTaskOk() (*bool, bool) { + if o == nil || o.HasAssociatedTask == nil { + return nil, false + } + return o.HasAssociatedTask, true +} + +// HasHasAssociatedTask returns a boolean if a field has been set. +func (o *EnvoyBackend) HasHasAssociatedTask() bool { + if o != nil && o.HasAssociatedTask != nil { + return true + } + + return false +} + +// SetHasAssociatedTask gets a reference to the given bool and assigns it to the HasAssociatedTask field. +func (o *EnvoyBackend) SetHasAssociatedTask(v bool) { + o.HasAssociatedTask = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *EnvoyBackend) GetHostname() string { + if o == nil || o.Hostname == nil { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyBackend) GetHostnameOk() (*string, bool) { + if o == nil || o.Hostname == nil { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *EnvoyBackend) HasHostname() bool { + if o != nil && o.Hostname != nil { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *EnvoyBackend) SetHostname(v string) { + o.Hostname = &v +} + +// GetPortValue returns the PortValue field value if set, zero value otherwise. +func (o *EnvoyBackend) GetPortValue() int32 { + if o == nil || o.PortValue == nil { + var ret int32 + return ret + } + return *o.PortValue +} + +// GetPortValueOk returns a tuple with the PortValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyBackend) GetPortValueOk() (*int32, bool) { + if o == nil || o.PortValue == nil { + return nil, false + } + return o.PortValue, true +} + +// HasPortValue returns a boolean if a field has been set. +func (o *EnvoyBackend) HasPortValue() bool { + if o != nil && o.PortValue != nil { + return true + } + + return false +} + +// SetPortValue gets a reference to the given int32 and assigns it to the PortValue field. +func (o *EnvoyBackend) SetPortValue(v int32) { + o.PortValue = &v +} + +// GetWeight returns the Weight field value if set, zero value otherwise. +func (o *EnvoyBackend) GetWeight() int32 { + if o == nil || o.Weight == nil { + var ret int32 + return ret + } + return *o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyBackend) GetWeightOk() (*int32, bool) { + if o == nil || o.Weight == nil { + return nil, false + } + return o.Weight, true +} + +// HasWeight returns a boolean if a field has been set. +func (o *EnvoyBackend) HasWeight() bool { + if o != nil && o.Weight != nil { + return true + } + + return false +} + +// SetWeight gets a reference to the given int32 and assigns it to the Weight field. +func (o *EnvoyBackend) SetWeight(v int32) { + o.Weight = &v +} + +func (o EnvoyBackend) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Address != nil { + toSerialize["address"] = o.Address + } + if o.EdsHealthStatus != nil { + toSerialize["eds_health_status"] = o.EdsHealthStatus + } + if o.HasAssociatedTask != nil { + toSerialize["has_associated_task"] = o.HasAssociatedTask + } + if o.Hostname != nil { + toSerialize["hostname"] = o.Hostname + } + if o.PortValue != nil { + toSerialize["port_value"] = o.PortValue + } + if o.Weight != nil { + toSerialize["weight"] = o.Weight + } + return json.Marshal(toSerialize) +} + +type NullableEnvoyBackend struct { + value *EnvoyBackend + isSet bool +} + +func (v NullableEnvoyBackend) Get() *EnvoyBackend { + return v.value +} + +func (v *NullableEnvoyBackend) Set(val *EnvoyBackend) { + v.value = val + v.isSet = true +} + +func (v NullableEnvoyBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvoyBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvoyBackend(val *EnvoyBackend) *NullableEnvoyBackend { + return &NullableEnvoyBackend{value: val, isSet: true} +} + +func (v NullableEnvoyBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvoyBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_envoy_location.go b/pkg/paastaapi/model_envoy_location.go new file mode 100644 index 0000000..228e261 --- /dev/null +++ b/pkg/paastaapi/model_envoy_location.go @@ -0,0 +1,226 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// EnvoyLocation struct for EnvoyLocation +type EnvoyLocation struct { + // Envoy backends running in this location + Backends *[]EnvoyBackend `json:"backends,omitempty"` + // Whether this backend is proxied through Casper + IsProxiedThroughCasper *bool `json:"is_proxied_through_casper,omitempty"` + // Name of the location + Name *string `json:"name,omitempty"` + // Number of running backends for the service in this location + RunningBackendsCount *int32 `json:"running_backends_count,omitempty"` +} + +// NewEnvoyLocation instantiates a new EnvoyLocation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnvoyLocation() *EnvoyLocation { + this := EnvoyLocation{} + return &this +} + +// NewEnvoyLocationWithDefaults instantiates a new EnvoyLocation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnvoyLocationWithDefaults() *EnvoyLocation { + this := EnvoyLocation{} + return &this +} + +// GetBackends returns the Backends field value if set, zero value otherwise. +func (o *EnvoyLocation) GetBackends() []EnvoyBackend { + if o == nil || o.Backends == nil { + var ret []EnvoyBackend + return ret + } + return *o.Backends +} + +// GetBackendsOk returns a tuple with the Backends field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyLocation) GetBackendsOk() (*[]EnvoyBackend, bool) { + if o == nil || o.Backends == nil { + return nil, false + } + return o.Backends, true +} + +// HasBackends returns a boolean if a field has been set. +func (o *EnvoyLocation) HasBackends() bool { + if o != nil && o.Backends != nil { + return true + } + + return false +} + +// SetBackends gets a reference to the given []EnvoyBackend and assigns it to the Backends field. +func (o *EnvoyLocation) SetBackends(v []EnvoyBackend) { + o.Backends = &v +} + +// GetIsProxiedThroughCasper returns the IsProxiedThroughCasper field value if set, zero value otherwise. +func (o *EnvoyLocation) GetIsProxiedThroughCasper() bool { + if o == nil || o.IsProxiedThroughCasper == nil { + var ret bool + return ret + } + return *o.IsProxiedThroughCasper +} + +// GetIsProxiedThroughCasperOk returns a tuple with the IsProxiedThroughCasper field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyLocation) GetIsProxiedThroughCasperOk() (*bool, bool) { + if o == nil || o.IsProxiedThroughCasper == nil { + return nil, false + } + return o.IsProxiedThroughCasper, true +} + +// HasIsProxiedThroughCasper returns a boolean if a field has been set. +func (o *EnvoyLocation) HasIsProxiedThroughCasper() bool { + if o != nil && o.IsProxiedThroughCasper != nil { + return true + } + + return false +} + +// SetIsProxiedThroughCasper gets a reference to the given bool and assigns it to the IsProxiedThroughCasper field. +func (o *EnvoyLocation) SetIsProxiedThroughCasper(v bool) { + o.IsProxiedThroughCasper = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *EnvoyLocation) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyLocation) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *EnvoyLocation) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *EnvoyLocation) SetName(v string) { + o.Name = &v +} + +// GetRunningBackendsCount returns the RunningBackendsCount field value if set, zero value otherwise. +func (o *EnvoyLocation) GetRunningBackendsCount() int32 { + if o == nil || o.RunningBackendsCount == nil { + var ret int32 + return ret + } + return *o.RunningBackendsCount +} + +// GetRunningBackendsCountOk returns a tuple with the RunningBackendsCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyLocation) GetRunningBackendsCountOk() (*int32, bool) { + if o == nil || o.RunningBackendsCount == nil { + return nil, false + } + return o.RunningBackendsCount, true +} + +// HasRunningBackendsCount returns a boolean if a field has been set. +func (o *EnvoyLocation) HasRunningBackendsCount() bool { + if o != nil && o.RunningBackendsCount != nil { + return true + } + + return false +} + +// SetRunningBackendsCount gets a reference to the given int32 and assigns it to the RunningBackendsCount field. +func (o *EnvoyLocation) SetRunningBackendsCount(v int32) { + o.RunningBackendsCount = &v +} + +func (o EnvoyLocation) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Backends != nil { + toSerialize["backends"] = o.Backends + } + if o.IsProxiedThroughCasper != nil { + toSerialize["is_proxied_through_casper"] = o.IsProxiedThroughCasper + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.RunningBackendsCount != nil { + toSerialize["running_backends_count"] = o.RunningBackendsCount + } + return json.Marshal(toSerialize) +} + +type NullableEnvoyLocation struct { + value *EnvoyLocation + isSet bool +} + +func (v NullableEnvoyLocation) Get() *EnvoyLocation { + return v.value +} + +func (v *NullableEnvoyLocation) Set(val *EnvoyLocation) { + v.value = val + v.isSet = true +} + +func (v NullableEnvoyLocation) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvoyLocation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvoyLocation(val *EnvoyLocation) *NullableEnvoyLocation { + return &NullableEnvoyLocation{value: val, isSet: true} +} + +func (v NullableEnvoyLocation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvoyLocation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_envoy_status.go b/pkg/paastaapi/model_envoy_status.go new file mode 100644 index 0000000..2be68a5 --- /dev/null +++ b/pkg/paastaapi/model_envoy_status.go @@ -0,0 +1,189 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// EnvoyStatus struct for EnvoyStatus +type EnvoyStatus struct { + // Number of backends expected to be present in each location + ExpectedBackendsPerLocation *int32 `json:"expected_backends_per_location,omitempty"` + // Locations the service is deployed + Locations *[]EnvoyLocation `json:"locations,omitempty"` + // Registration name of the service in Smartstack + Registration *string `json:"registration,omitempty"` +} + +// NewEnvoyStatus instantiates a new EnvoyStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnvoyStatus() *EnvoyStatus { + this := EnvoyStatus{} + return &this +} + +// NewEnvoyStatusWithDefaults instantiates a new EnvoyStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnvoyStatusWithDefaults() *EnvoyStatus { + this := EnvoyStatus{} + return &this +} + +// GetExpectedBackendsPerLocation returns the ExpectedBackendsPerLocation field value if set, zero value otherwise. +func (o *EnvoyStatus) GetExpectedBackendsPerLocation() int32 { + if o == nil || o.ExpectedBackendsPerLocation == nil { + var ret int32 + return ret + } + return *o.ExpectedBackendsPerLocation +} + +// GetExpectedBackendsPerLocationOk returns a tuple with the ExpectedBackendsPerLocation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyStatus) GetExpectedBackendsPerLocationOk() (*int32, bool) { + if o == nil || o.ExpectedBackendsPerLocation == nil { + return nil, false + } + return o.ExpectedBackendsPerLocation, true +} + +// HasExpectedBackendsPerLocation returns a boolean if a field has been set. +func (o *EnvoyStatus) HasExpectedBackendsPerLocation() bool { + if o != nil && o.ExpectedBackendsPerLocation != nil { + return true + } + + return false +} + +// SetExpectedBackendsPerLocation gets a reference to the given int32 and assigns it to the ExpectedBackendsPerLocation field. +func (o *EnvoyStatus) SetExpectedBackendsPerLocation(v int32) { + o.ExpectedBackendsPerLocation = &v +} + +// GetLocations returns the Locations field value if set, zero value otherwise. +func (o *EnvoyStatus) GetLocations() []EnvoyLocation { + if o == nil || o.Locations == nil { + var ret []EnvoyLocation + return ret + } + return *o.Locations +} + +// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyStatus) GetLocationsOk() (*[]EnvoyLocation, bool) { + if o == nil || o.Locations == nil { + return nil, false + } + return o.Locations, true +} + +// HasLocations returns a boolean if a field has been set. +func (o *EnvoyStatus) HasLocations() bool { + if o != nil && o.Locations != nil { + return true + } + + return false +} + +// SetLocations gets a reference to the given []EnvoyLocation and assigns it to the Locations field. +func (o *EnvoyStatus) SetLocations(v []EnvoyLocation) { + o.Locations = &v +} + +// GetRegistration returns the Registration field value if set, zero value otherwise. +func (o *EnvoyStatus) GetRegistration() string { + if o == nil || o.Registration == nil { + var ret string + return ret + } + return *o.Registration +} + +// GetRegistrationOk returns a tuple with the Registration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvoyStatus) GetRegistrationOk() (*string, bool) { + if o == nil || o.Registration == nil { + return nil, false + } + return o.Registration, true +} + +// HasRegistration returns a boolean if a field has been set. +func (o *EnvoyStatus) HasRegistration() bool { + if o != nil && o.Registration != nil { + return true + } + + return false +} + +// SetRegistration gets a reference to the given string and assigns it to the Registration field. +func (o *EnvoyStatus) SetRegistration(v string) { + o.Registration = &v +} + +func (o EnvoyStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ExpectedBackendsPerLocation != nil { + toSerialize["expected_backends_per_location"] = o.ExpectedBackendsPerLocation + } + if o.Locations != nil { + toSerialize["locations"] = o.Locations + } + if o.Registration != nil { + toSerialize["registration"] = o.Registration + } + return json.Marshal(toSerialize) +} + +type NullableEnvoyStatus struct { + value *EnvoyStatus + isSet bool +} + +func (v NullableEnvoyStatus) Get() *EnvoyStatus { + return v.value +} + +func (v *NullableEnvoyStatus) Set(val *EnvoyStatus) { + v.value = val + v.isSet = true +} + +func (v NullableEnvoyStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvoyStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvoyStatus(val *EnvoyStatus) *NullableEnvoyStatus { + return &NullableEnvoyStatus{value: val, isSet: true} +} + +func (v NullableEnvoyStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvoyStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_float_and_error.go b/pkg/paastaapi/model_float_and_error.go new file mode 100644 index 0000000..f01f3ed --- /dev/null +++ b/pkg/paastaapi/model_float_and_error.go @@ -0,0 +1,150 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// FloatAndError struct for FloatAndError +type FloatAndError struct { + ErrorMessage *string `json:"error_message,omitempty"` + Value *float32 `json:"value,omitempty"` +} + +// NewFloatAndError instantiates a new FloatAndError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFloatAndError() *FloatAndError { + this := FloatAndError{} + return &this +} + +// NewFloatAndErrorWithDefaults instantiates a new FloatAndError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFloatAndErrorWithDefaults() *FloatAndError { + this := FloatAndError{} + return &this +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *FloatAndError) GetErrorMessage() string { + if o == nil || o.ErrorMessage == nil { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FloatAndError) GetErrorMessageOk() (*string, bool) { + if o == nil || o.ErrorMessage == nil { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *FloatAndError) HasErrorMessage() bool { + if o != nil && o.ErrorMessage != nil { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *FloatAndError) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *FloatAndError) GetValue() float32 { + if o == nil || o.Value == nil { + var ret float32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FloatAndError) GetValueOk() (*float32, bool) { + if o == nil || o.Value == nil { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *FloatAndError) HasValue() bool { + if o != nil && o.Value != nil { + return true + } + + return false +} + +// SetValue gets a reference to the given float32 and assigns it to the Value field. +func (o *FloatAndError) SetValue(v float32) { + o.Value = &v +} + +func (o FloatAndError) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ErrorMessage != nil { + toSerialize["error_message"] = o.ErrorMessage + } + if o.Value != nil { + toSerialize["value"] = o.Value + } + return json.Marshal(toSerialize) +} + +type NullableFloatAndError struct { + value *FloatAndError + isSet bool +} + +func (v NullableFloatAndError) Get() *FloatAndError { + return v.value +} + +func (v *NullableFloatAndError) Set(val *FloatAndError) { + v.value = val + v.isSet = true +} + +func (v NullableFloatAndError) IsSet() bool { + return v.isSet +} + +func (v *NullableFloatAndError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloatAndError(val *FloatAndError) *NullableFloatAndError { + return &NullableFloatAndError{value: val, isSet: true} +} + +func (v NullableFloatAndError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloatAndError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_hpa_metric.go b/pkg/paastaapi/model_hpa_metric.go new file mode 100644 index 0000000..44623b3 --- /dev/null +++ b/pkg/paastaapi/model_hpa_metric.go @@ -0,0 +1,189 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// HPAMetric struct for HPAMetric +type HPAMetric struct { + // setpoint/target_value as specified in yelpsoa_configs + CurrentValue *string `json:"current_value,omitempty"` + // name of the metric + Name *string `json:"name,omitempty"` + // setpoint/target_value as specified in yelpsoa_configs + TargetValue *string `json:"target_value,omitempty"` +} + +// NewHPAMetric instantiates a new HPAMetric object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHPAMetric() *HPAMetric { + this := HPAMetric{} + return &this +} + +// NewHPAMetricWithDefaults instantiates a new HPAMetric object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHPAMetricWithDefaults() *HPAMetric { + this := HPAMetric{} + return &this +} + +// GetCurrentValue returns the CurrentValue field value if set, zero value otherwise. +func (o *HPAMetric) GetCurrentValue() string { + if o == nil || o.CurrentValue == nil { + var ret string + return ret + } + return *o.CurrentValue +} + +// GetCurrentValueOk returns a tuple with the CurrentValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HPAMetric) GetCurrentValueOk() (*string, bool) { + if o == nil || o.CurrentValue == nil { + return nil, false + } + return o.CurrentValue, true +} + +// HasCurrentValue returns a boolean if a field has been set. +func (o *HPAMetric) HasCurrentValue() bool { + if o != nil && o.CurrentValue != nil { + return true + } + + return false +} + +// SetCurrentValue gets a reference to the given string and assigns it to the CurrentValue field. +func (o *HPAMetric) SetCurrentValue(v string) { + o.CurrentValue = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *HPAMetric) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HPAMetric) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *HPAMetric) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *HPAMetric) SetName(v string) { + o.Name = &v +} + +// GetTargetValue returns the TargetValue field value if set, zero value otherwise. +func (o *HPAMetric) GetTargetValue() string { + if o == nil || o.TargetValue == nil { + var ret string + return ret + } + return *o.TargetValue +} + +// GetTargetValueOk returns a tuple with the TargetValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HPAMetric) GetTargetValueOk() (*string, bool) { + if o == nil || o.TargetValue == nil { + return nil, false + } + return o.TargetValue, true +} + +// HasTargetValue returns a boolean if a field has been set. +func (o *HPAMetric) HasTargetValue() bool { + if o != nil && o.TargetValue != nil { + return true + } + + return false +} + +// SetTargetValue gets a reference to the given string and assigns it to the TargetValue field. +func (o *HPAMetric) SetTargetValue(v string) { + o.TargetValue = &v +} + +func (o HPAMetric) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CurrentValue != nil { + toSerialize["current_value"] = o.CurrentValue + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.TargetValue != nil { + toSerialize["target_value"] = o.TargetValue + } + return json.Marshal(toSerialize) +} + +type NullableHPAMetric struct { + value *HPAMetric + isSet bool +} + +func (v NullableHPAMetric) Get() *HPAMetric { + return v.value +} + +func (v *NullableHPAMetric) Set(val *HPAMetric) { + v.value = val + v.isSet = true +} + +func (v NullableHPAMetric) IsSet() bool { + return v.isSet +} + +func (v *NullableHPAMetric) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHPAMetric(val *HPAMetric) *NullableHPAMetric { + return &NullableHPAMetric{value: val, isSet: true} +} + +func (v NullableHPAMetric) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHPAMetric) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_inline_object.go b/pkg/paastaapi/model_inline_object.go new file mode 100644 index 0000000..3adfb7c --- /dev/null +++ b/pkg/paastaapi/model_inline_object.go @@ -0,0 +1,114 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InlineObject struct for InlineObject +type InlineObject struct { + Minutes *int32 `json:"minutes,omitempty"` +} + +// NewInlineObject instantiates a new InlineObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineObject() *InlineObject { + this := InlineObject{} + return &this +} + +// NewInlineObjectWithDefaults instantiates a new InlineObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineObjectWithDefaults() *InlineObject { + this := InlineObject{} + return &this +} + +// GetMinutes returns the Minutes field value if set, zero value otherwise. +func (o *InlineObject) GetMinutes() int32 { + if o == nil || o.Minutes == nil { + var ret int32 + return ret + } + return *o.Minutes +} + +// GetMinutesOk returns a tuple with the Minutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject) GetMinutesOk() (*int32, bool) { + if o == nil || o.Minutes == nil { + return nil, false + } + return o.Minutes, true +} + +// HasMinutes returns a boolean if a field has been set. +func (o *InlineObject) HasMinutes() bool { + if o != nil && o.Minutes != nil { + return true + } + + return false +} + +// SetMinutes gets a reference to the given int32 and assigns it to the Minutes field. +func (o *InlineObject) SetMinutes(v int32) { + o.Minutes = &v +} + +func (o InlineObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Minutes != nil { + toSerialize["minutes"] = o.Minutes + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject struct { + value *InlineObject + isSet bool +} + +func (v NullableInlineObject) Get() *InlineObject { + return v.value +} + +func (v *NullableInlineObject) Set(val *InlineObject) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject(val *InlineObject) *NullableInlineObject { + return &NullableInlineObject{value: val, isSet: true} +} + +func (v NullableInlineObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_inline_object_1.go b/pkg/paastaapi/model_inline_object_1.go new file mode 100644 index 0000000..c05e5db --- /dev/null +++ b/pkg/paastaapi/model_inline_object_1.go @@ -0,0 +1,150 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InlineObject1 struct for InlineObject1 +type InlineObject1 struct { + CalculatedInstances *int32 `json:"calculated_instances,omitempty"` + DesiredInstances *int32 `json:"desired_instances,omitempty"` +} + +// NewInlineObject1 instantiates a new InlineObject1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineObject1() *InlineObject1 { + this := InlineObject1{} + return &this +} + +// NewInlineObject1WithDefaults instantiates a new InlineObject1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineObject1WithDefaults() *InlineObject1 { + this := InlineObject1{} + return &this +} + +// GetCalculatedInstances returns the CalculatedInstances field value if set, zero value otherwise. +func (o *InlineObject1) GetCalculatedInstances() int32 { + if o == nil || o.CalculatedInstances == nil { + var ret int32 + return ret + } + return *o.CalculatedInstances +} + +// GetCalculatedInstancesOk returns a tuple with the CalculatedInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject1) GetCalculatedInstancesOk() (*int32, bool) { + if o == nil || o.CalculatedInstances == nil { + return nil, false + } + return o.CalculatedInstances, true +} + +// HasCalculatedInstances returns a boolean if a field has been set. +func (o *InlineObject1) HasCalculatedInstances() bool { + if o != nil && o.CalculatedInstances != nil { + return true + } + + return false +} + +// SetCalculatedInstances gets a reference to the given int32 and assigns it to the CalculatedInstances field. +func (o *InlineObject1) SetCalculatedInstances(v int32) { + o.CalculatedInstances = &v +} + +// GetDesiredInstances returns the DesiredInstances field value if set, zero value otherwise. +func (o *InlineObject1) GetDesiredInstances() int32 { + if o == nil || o.DesiredInstances == nil { + var ret int32 + return ret + } + return *o.DesiredInstances +} + +// GetDesiredInstancesOk returns a tuple with the DesiredInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject1) GetDesiredInstancesOk() (*int32, bool) { + if o == nil || o.DesiredInstances == nil { + return nil, false + } + return o.DesiredInstances, true +} + +// HasDesiredInstances returns a boolean if a field has been set. +func (o *InlineObject1) HasDesiredInstances() bool { + if o != nil && o.DesiredInstances != nil { + return true + } + + return false +} + +// SetDesiredInstances gets a reference to the given int32 and assigns it to the DesiredInstances field. +func (o *InlineObject1) SetDesiredInstances(v int32) { + o.DesiredInstances = &v +} + +func (o InlineObject1) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CalculatedInstances != nil { + toSerialize["calculated_instances"] = o.CalculatedInstances + } + if o.DesiredInstances != nil { + toSerialize["desired_instances"] = o.DesiredInstances + } + return json.Marshal(toSerialize) +} + +type NullableInlineObject1 struct { + value *InlineObject1 + isSet bool +} + +func (v NullableInlineObject1) Get() *InlineObject1 { + return v.value +} + +func (v *NullableInlineObject1) Set(val *InlineObject1) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject1) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject1(val *InlineObject1) *NullableInlineObject1 { + return &NullableInlineObject1{value: val, isSet: true} +} + +func (v NullableInlineObject1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_inline_response_200.go b/pkg/paastaapi/model_inline_response_200.go new file mode 100644 index 0000000..18058fe --- /dev/null +++ b/pkg/paastaapi/model_inline_response_200.go @@ -0,0 +1,114 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InlineResponse200 struct for InlineResponse200 +type InlineResponse200 struct { + Services *[][]interface{} `json:"services,omitempty"` +} + +// NewInlineResponse200 instantiates a new InlineResponse200 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse200() *InlineResponse200 { + this := InlineResponse200{} + return &this +} + +// NewInlineResponse200WithDefaults instantiates a new InlineResponse200 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse200WithDefaults() *InlineResponse200 { + this := InlineResponse200{} + return &this +} + +// GetServices returns the Services field value if set, zero value otherwise. +func (o *InlineResponse200) GetServices() [][]interface{} { + if o == nil || o.Services == nil { + var ret [][]interface{} + return ret + } + return *o.Services +} + +// GetServicesOk returns a tuple with the Services field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse200) GetServicesOk() (*[][]interface{}, bool) { + if o == nil || o.Services == nil { + return nil, false + } + return o.Services, true +} + +// HasServices returns a boolean if a field has been set. +func (o *InlineResponse200) HasServices() bool { + if o != nil && o.Services != nil { + return true + } + + return false +} + +// SetServices gets a reference to the given [][]interface{} and assigns it to the Services field. +func (o *InlineResponse200) SetServices(v [][]interface{}) { + o.Services = &v +} + +func (o InlineResponse200) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Services != nil { + toSerialize["services"] = o.Services + } + return json.Marshal(toSerialize) +} + +type NullableInlineResponse200 struct { + value *InlineResponse200 + isSet bool +} + +func (v NullableInlineResponse200) Get() *InlineResponse200 { + return v.value +} + +func (v *NullableInlineResponse200) Set(val *InlineResponse200) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse200) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse200) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse200(val *InlineResponse200) *NullableInlineResponse200 { + return &NullableInlineResponse200{value: val, isSet: true} +} + +func (v NullableInlineResponse200) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse200) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_inline_response_200_1.go b/pkg/paastaapi/model_inline_response_200_1.go new file mode 100644 index 0000000..4ad915d --- /dev/null +++ b/pkg/paastaapi/model_inline_response_200_1.go @@ -0,0 +1,114 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InlineResponse2001 struct for InlineResponse2001 +type InlineResponse2001 struct { + Instances *[]string `json:"instances,omitempty"` +} + +// NewInlineResponse2001 instantiates a new InlineResponse2001 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse2001() *InlineResponse2001 { + this := InlineResponse2001{} + return &this +} + +// NewInlineResponse2001WithDefaults instantiates a new InlineResponse2001 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse2001WithDefaults() *InlineResponse2001 { + this := InlineResponse2001{} + return &this +} + +// GetInstances returns the Instances field value if set, zero value otherwise. +func (o *InlineResponse2001) GetInstances() []string { + if o == nil || o.Instances == nil { + var ret []string + return ret + } + return *o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse2001) GetInstancesOk() (*[]string, bool) { + if o == nil || o.Instances == nil { + return nil, false + } + return o.Instances, true +} + +// HasInstances returns a boolean if a field has been set. +func (o *InlineResponse2001) HasInstances() bool { + if o != nil && o.Instances != nil { + return true + } + + return false +} + +// SetInstances gets a reference to the given []string and assigns it to the Instances field. +func (o *InlineResponse2001) SetInstances(v []string) { + o.Instances = &v +} + +func (o InlineResponse2001) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Instances != nil { + toSerialize["instances"] = o.Instances + } + return json.Marshal(toSerialize) +} + +type NullableInlineResponse2001 struct { + value *InlineResponse2001 + isSet bool +} + +func (v NullableInlineResponse2001) Get() *InlineResponse2001 { + return v.value +} + +func (v *NullableInlineResponse2001) Set(val *InlineResponse2001) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse2001) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse2001) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse2001(val *InlineResponse2001) *NullableInlineResponse2001 { + return &NullableInlineResponse2001{value: val, isSet: true} +} + +func (v NullableInlineResponse2001) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse2001) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_inline_response_200_2.go b/pkg/paastaapi/model_inline_response_200_2.go new file mode 100644 index 0000000..0652ae8 --- /dev/null +++ b/pkg/paastaapi/model_inline_response_200_2.go @@ -0,0 +1,114 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InlineResponse2002 struct for InlineResponse2002 +type InlineResponse2002 struct { + DesiredInstances *int32 `json:"desired_instances,omitempty"` +} + +// NewInlineResponse2002 instantiates a new InlineResponse2002 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse2002() *InlineResponse2002 { + this := InlineResponse2002{} + return &this +} + +// NewInlineResponse2002WithDefaults instantiates a new InlineResponse2002 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse2002WithDefaults() *InlineResponse2002 { + this := InlineResponse2002{} + return &this +} + +// GetDesiredInstances returns the DesiredInstances field value if set, zero value otherwise. +func (o *InlineResponse2002) GetDesiredInstances() int32 { + if o == nil || o.DesiredInstances == nil { + var ret int32 + return ret + } + return *o.DesiredInstances +} + +// GetDesiredInstancesOk returns a tuple with the DesiredInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse2002) GetDesiredInstancesOk() (*int32, bool) { + if o == nil || o.DesiredInstances == nil { + return nil, false + } + return o.DesiredInstances, true +} + +// HasDesiredInstances returns a boolean if a field has been set. +func (o *InlineResponse2002) HasDesiredInstances() bool { + if o != nil && o.DesiredInstances != nil { + return true + } + + return false +} + +// SetDesiredInstances gets a reference to the given int32 and assigns it to the DesiredInstances field. +func (o *InlineResponse2002) SetDesiredInstances(v int32) { + o.DesiredInstances = &v +} + +func (o InlineResponse2002) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.DesiredInstances != nil { + toSerialize["desired_instances"] = o.DesiredInstances + } + return json.Marshal(toSerialize) +} + +type NullableInlineResponse2002 struct { + value *InlineResponse2002 + isSet bool +} + +func (v NullableInlineResponse2002) Get() *InlineResponse2002 { + return v.value +} + +func (v *NullableInlineResponse2002) Set(val *InlineResponse2002) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse2002) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse2002) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse2002(val *InlineResponse2002) *NullableInlineResponse2002 { + return &NullableInlineResponse2002{value: val, isSet: true} +} + +func (v NullableInlineResponse2002) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse2002) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_inline_response_202.go b/pkg/paastaapi/model_inline_response_202.go new file mode 100644 index 0000000..3aa1e11 --- /dev/null +++ b/pkg/paastaapi/model_inline_response_202.go @@ -0,0 +1,150 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InlineResponse202 struct for InlineResponse202 +type InlineResponse202 struct { + DesiredInstances *int32 `json:"desired_instances,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewInlineResponse202 instantiates a new InlineResponse202 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse202() *InlineResponse202 { + this := InlineResponse202{} + return &this +} + +// NewInlineResponse202WithDefaults instantiates a new InlineResponse202 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse202WithDefaults() *InlineResponse202 { + this := InlineResponse202{} + return &this +} + +// GetDesiredInstances returns the DesiredInstances field value if set, zero value otherwise. +func (o *InlineResponse202) GetDesiredInstances() int32 { + if o == nil || o.DesiredInstances == nil { + var ret int32 + return ret + } + return *o.DesiredInstances +} + +// GetDesiredInstancesOk returns a tuple with the DesiredInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse202) GetDesiredInstancesOk() (*int32, bool) { + if o == nil || o.DesiredInstances == nil { + return nil, false + } + return o.DesiredInstances, true +} + +// HasDesiredInstances returns a boolean if a field has been set. +func (o *InlineResponse202) HasDesiredInstances() bool { + if o != nil && o.DesiredInstances != nil { + return true + } + + return false +} + +// SetDesiredInstances gets a reference to the given int32 and assigns it to the DesiredInstances field. +func (o *InlineResponse202) SetDesiredInstances(v int32) { + o.DesiredInstances = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InlineResponse202) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse202) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InlineResponse202) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InlineResponse202) SetStatus(v string) { + o.Status = &v +} + +func (o InlineResponse202) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.DesiredInstances != nil { + toSerialize["desired_instances"] = o.DesiredInstances + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableInlineResponse202 struct { + value *InlineResponse202 + isSet bool +} + +func (v NullableInlineResponse202) Get() *InlineResponse202 { + return v.value +} + +func (v *NullableInlineResponse202) Set(val *InlineResponse202) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse202) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse202) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse202(val *InlineResponse202) *NullableInlineResponse202 { + return &NullableInlineResponse202{value: val, isSet: true} +} + +func (v NullableInlineResponse202) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse202) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_instance_status.go b/pkg/paastaapi/model_instance_status.go new file mode 100644 index 0000000..75302a9 --- /dev/null +++ b/pkg/paastaapi/model_instance_status.go @@ -0,0 +1,406 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InstanceStatus struct for InstanceStatus +type InstanceStatus struct { + // List of runs associated with job + Adhoc *[]AdhocLaunchHistory `json:"adhoc,omitempty"` + Flink *InstanceStatusFlink `json:"flink,omitempty"` + // Git sha of a service + GitSha *string `json:"git_sha,omitempty"` + // Instance name + Instance *string `json:"instance,omitempty"` + Kafkacluster *InstanceStatusKafkacluster `json:"kafkacluster,omitempty"` + Kubernetes *InstanceStatusKubernetes `json:"kubernetes,omitempty"` + Marathon *InstanceStatusMarathon `json:"marathon,omitempty"` + // Service name + Service *string `json:"service,omitempty"` + Tron *InstanceStatusTron `json:"tron,omitempty"` +} + +// NewInstanceStatus instantiates a new InstanceStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceStatus() *InstanceStatus { + this := InstanceStatus{} + return &this +} + +// NewInstanceStatusWithDefaults instantiates a new InstanceStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceStatusWithDefaults() *InstanceStatus { + this := InstanceStatus{} + return &this +} + +// GetAdhoc returns the Adhoc field value if set, zero value otherwise. +func (o *InstanceStatus) GetAdhoc() []AdhocLaunchHistory { + if o == nil || o.Adhoc == nil { + var ret []AdhocLaunchHistory + return ret + } + return *o.Adhoc +} + +// GetAdhocOk returns a tuple with the Adhoc field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatus) GetAdhocOk() (*[]AdhocLaunchHistory, bool) { + if o == nil || o.Adhoc == nil { + return nil, false + } + return o.Adhoc, true +} + +// HasAdhoc returns a boolean if a field has been set. +func (o *InstanceStatus) HasAdhoc() bool { + if o != nil && o.Adhoc != nil { + return true + } + + return false +} + +// SetAdhoc gets a reference to the given []AdhocLaunchHistory and assigns it to the Adhoc field. +func (o *InstanceStatus) SetAdhoc(v []AdhocLaunchHistory) { + o.Adhoc = &v +} + +// GetFlink returns the Flink field value if set, zero value otherwise. +func (o *InstanceStatus) GetFlink() InstanceStatusFlink { + if o == nil || o.Flink == nil { + var ret InstanceStatusFlink + return ret + } + return *o.Flink +} + +// GetFlinkOk returns a tuple with the Flink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatus) GetFlinkOk() (*InstanceStatusFlink, bool) { + if o == nil || o.Flink == nil { + return nil, false + } + return o.Flink, true +} + +// HasFlink returns a boolean if a field has been set. +func (o *InstanceStatus) HasFlink() bool { + if o != nil && o.Flink != nil { + return true + } + + return false +} + +// SetFlink gets a reference to the given InstanceStatusFlink and assigns it to the Flink field. +func (o *InstanceStatus) SetFlink(v InstanceStatusFlink) { + o.Flink = &v +} + +// GetGitSha returns the GitSha field value if set, zero value otherwise. +func (o *InstanceStatus) GetGitSha() string { + if o == nil || o.GitSha == nil { + var ret string + return ret + } + return *o.GitSha +} + +// GetGitShaOk returns a tuple with the GitSha field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatus) GetGitShaOk() (*string, bool) { + if o == nil || o.GitSha == nil { + return nil, false + } + return o.GitSha, true +} + +// HasGitSha returns a boolean if a field has been set. +func (o *InstanceStatus) HasGitSha() bool { + if o != nil && o.GitSha != nil { + return true + } + + return false +} + +// SetGitSha gets a reference to the given string and assigns it to the GitSha field. +func (o *InstanceStatus) SetGitSha(v string) { + o.GitSha = &v +} + +// GetInstance returns the Instance field value if set, zero value otherwise. +func (o *InstanceStatus) GetInstance() string { + if o == nil || o.Instance == nil { + var ret string + return ret + } + return *o.Instance +} + +// GetInstanceOk returns a tuple with the Instance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatus) GetInstanceOk() (*string, bool) { + if o == nil || o.Instance == nil { + return nil, false + } + return o.Instance, true +} + +// HasInstance returns a boolean if a field has been set. +func (o *InstanceStatus) HasInstance() bool { + if o != nil && o.Instance != nil { + return true + } + + return false +} + +// SetInstance gets a reference to the given string and assigns it to the Instance field. +func (o *InstanceStatus) SetInstance(v string) { + o.Instance = &v +} + +// GetKafkacluster returns the Kafkacluster field value if set, zero value otherwise. +func (o *InstanceStatus) GetKafkacluster() InstanceStatusKafkacluster { + if o == nil || o.Kafkacluster == nil { + var ret InstanceStatusKafkacluster + return ret + } + return *o.Kafkacluster +} + +// GetKafkaclusterOk returns a tuple with the Kafkacluster field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatus) GetKafkaclusterOk() (*InstanceStatusKafkacluster, bool) { + if o == nil || o.Kafkacluster == nil { + return nil, false + } + return o.Kafkacluster, true +} + +// HasKafkacluster returns a boolean if a field has been set. +func (o *InstanceStatus) HasKafkacluster() bool { + if o != nil && o.Kafkacluster != nil { + return true + } + + return false +} + +// SetKafkacluster gets a reference to the given InstanceStatusKafkacluster and assigns it to the Kafkacluster field. +func (o *InstanceStatus) SetKafkacluster(v InstanceStatusKafkacluster) { + o.Kafkacluster = &v +} + +// GetKubernetes returns the Kubernetes field value if set, zero value otherwise. +func (o *InstanceStatus) GetKubernetes() InstanceStatusKubernetes { + if o == nil || o.Kubernetes == nil { + var ret InstanceStatusKubernetes + return ret + } + return *o.Kubernetes +} + +// GetKubernetesOk returns a tuple with the Kubernetes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatus) GetKubernetesOk() (*InstanceStatusKubernetes, bool) { + if o == nil || o.Kubernetes == nil { + return nil, false + } + return o.Kubernetes, true +} + +// HasKubernetes returns a boolean if a field has been set. +func (o *InstanceStatus) HasKubernetes() bool { + if o != nil && o.Kubernetes != nil { + return true + } + + return false +} + +// SetKubernetes gets a reference to the given InstanceStatusKubernetes and assigns it to the Kubernetes field. +func (o *InstanceStatus) SetKubernetes(v InstanceStatusKubernetes) { + o.Kubernetes = &v +} + +// GetMarathon returns the Marathon field value if set, zero value otherwise. +func (o *InstanceStatus) GetMarathon() InstanceStatusMarathon { + if o == nil || o.Marathon == nil { + var ret InstanceStatusMarathon + return ret + } + return *o.Marathon +} + +// GetMarathonOk returns a tuple with the Marathon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatus) GetMarathonOk() (*InstanceStatusMarathon, bool) { + if o == nil || o.Marathon == nil { + return nil, false + } + return o.Marathon, true +} + +// HasMarathon returns a boolean if a field has been set. +func (o *InstanceStatus) HasMarathon() bool { + if o != nil && o.Marathon != nil { + return true + } + + return false +} + +// SetMarathon gets a reference to the given InstanceStatusMarathon and assigns it to the Marathon field. +func (o *InstanceStatus) SetMarathon(v InstanceStatusMarathon) { + o.Marathon = &v +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *InstanceStatus) GetService() string { + if o == nil || o.Service == nil { + var ret string + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatus) GetServiceOk() (*string, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *InstanceStatus) HasService() bool { + if o != nil && o.Service != nil { + return true + } + + return false +} + +// SetService gets a reference to the given string and assigns it to the Service field. +func (o *InstanceStatus) SetService(v string) { + o.Service = &v +} + +// GetTron returns the Tron field value if set, zero value otherwise. +func (o *InstanceStatus) GetTron() InstanceStatusTron { + if o == nil || o.Tron == nil { + var ret InstanceStatusTron + return ret + } + return *o.Tron +} + +// GetTronOk returns a tuple with the Tron field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatus) GetTronOk() (*InstanceStatusTron, bool) { + if o == nil || o.Tron == nil { + return nil, false + } + return o.Tron, true +} + +// HasTron returns a boolean if a field has been set. +func (o *InstanceStatus) HasTron() bool { + if o != nil && o.Tron != nil { + return true + } + + return false +} + +// SetTron gets a reference to the given InstanceStatusTron and assigns it to the Tron field. +func (o *InstanceStatus) SetTron(v InstanceStatusTron) { + o.Tron = &v +} + +func (o InstanceStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Adhoc != nil { + toSerialize["adhoc"] = o.Adhoc + } + if o.Flink != nil { + toSerialize["flink"] = o.Flink + } + if o.GitSha != nil { + toSerialize["git_sha"] = o.GitSha + } + if o.Instance != nil { + toSerialize["instance"] = o.Instance + } + if o.Kafkacluster != nil { + toSerialize["kafkacluster"] = o.Kafkacluster + } + if o.Kubernetes != nil { + toSerialize["kubernetes"] = o.Kubernetes + } + if o.Marathon != nil { + toSerialize["marathon"] = o.Marathon + } + if o.Service != nil { + toSerialize["service"] = o.Service + } + if o.Tron != nil { + toSerialize["tron"] = o.Tron + } + return json.Marshal(toSerialize) +} + +type NullableInstanceStatus struct { + value *InstanceStatus + isSet bool +} + +func (v NullableInstanceStatus) Get() *InstanceStatus { + return v.value +} + +func (v *NullableInstanceStatus) Set(val *InstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { + return &NullableInstanceStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_instance_status_flink.go b/pkg/paastaapi/model_instance_status_flink.go new file mode 100644 index 0000000..06384e5 --- /dev/null +++ b/pkg/paastaapi/model_instance_status_flink.go @@ -0,0 +1,152 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InstanceStatusFlink Nullable Flink instance status and metadata +type InstanceStatusFlink struct { + // Flink instance metadata + Metadata *map[string]interface{} `json:"metadata,omitempty"` + // Flink instance status + Status *map[string]interface{} `json:"status,omitempty"` +} + +// NewInstanceStatusFlink instantiates a new InstanceStatusFlink object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceStatusFlink() *InstanceStatusFlink { + this := InstanceStatusFlink{} + return &this +} + +// NewInstanceStatusFlinkWithDefaults instantiates a new InstanceStatusFlink object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceStatusFlinkWithDefaults() *InstanceStatusFlink { + this := InstanceStatusFlink{} + return &this +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *InstanceStatusFlink) GetMetadata() map[string]interface{} { + if o == nil || o.Metadata == nil { + var ret map[string]interface{} + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusFlink) GetMetadataOk() (*map[string]interface{}, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *InstanceStatusFlink) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *InstanceStatusFlink) SetMetadata(v map[string]interface{}) { + o.Metadata = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InstanceStatusFlink) GetStatus() map[string]interface{} { + if o == nil || o.Status == nil { + var ret map[string]interface{} + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusFlink) GetStatusOk() (*map[string]interface{}, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InstanceStatusFlink) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given map[string]interface{} and assigns it to the Status field. +func (o *InstanceStatusFlink) SetStatus(v map[string]interface{}) { + o.Status = &v +} + +func (o InstanceStatusFlink) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableInstanceStatusFlink struct { + value *InstanceStatusFlink + isSet bool +} + +func (v NullableInstanceStatusFlink) Get() *InstanceStatusFlink { + return v.value +} + +func (v *NullableInstanceStatusFlink) Set(val *InstanceStatusFlink) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatusFlink) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatusFlink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatusFlink(val *InstanceStatusFlink) *NullableInstanceStatusFlink { + return &NullableInstanceStatusFlink{value: val, isSet: true} +} + +func (v NullableInstanceStatusFlink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatusFlink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_instance_status_kafkacluster.go b/pkg/paastaapi/model_instance_status_kafkacluster.go new file mode 100644 index 0000000..024b44a --- /dev/null +++ b/pkg/paastaapi/model_instance_status_kafkacluster.go @@ -0,0 +1,152 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InstanceStatusKafkacluster Nullable KafkaCluster instance status and metadata +type InstanceStatusKafkacluster struct { + // Kafka instance metadata + Metadata *map[string]interface{} `json:"metadata,omitempty"` + // Kafka instance status + Status *map[string]interface{} `json:"status,omitempty"` +} + +// NewInstanceStatusKafkacluster instantiates a new InstanceStatusKafkacluster object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceStatusKafkacluster() *InstanceStatusKafkacluster { + this := InstanceStatusKafkacluster{} + return &this +} + +// NewInstanceStatusKafkaclusterWithDefaults instantiates a new InstanceStatusKafkacluster object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceStatusKafkaclusterWithDefaults() *InstanceStatusKafkacluster { + this := InstanceStatusKafkacluster{} + return &this +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *InstanceStatusKafkacluster) GetMetadata() map[string]interface{} { + if o == nil || o.Metadata == nil { + var ret map[string]interface{} + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKafkacluster) GetMetadataOk() (*map[string]interface{}, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *InstanceStatusKafkacluster) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *InstanceStatusKafkacluster) SetMetadata(v map[string]interface{}) { + o.Metadata = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InstanceStatusKafkacluster) GetStatus() map[string]interface{} { + if o == nil || o.Status == nil { + var ret map[string]interface{} + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKafkacluster) GetStatusOk() (*map[string]interface{}, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InstanceStatusKafkacluster) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given map[string]interface{} and assigns it to the Status field. +func (o *InstanceStatusKafkacluster) SetStatus(v map[string]interface{}) { + o.Status = &v +} + +func (o InstanceStatusKafkacluster) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableInstanceStatusKafkacluster struct { + value *InstanceStatusKafkacluster + isSet bool +} + +func (v NullableInstanceStatusKafkacluster) Get() *InstanceStatusKafkacluster { + return v.value +} + +func (v *NullableInstanceStatusKafkacluster) Set(val *InstanceStatusKafkacluster) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatusKafkacluster) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatusKafkacluster) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatusKafkacluster(val *InstanceStatusKafkacluster) *NullableInstanceStatusKafkacluster { + return &NullableInstanceStatusKafkacluster{value: val, isSet: true} +} + +func (v NullableInstanceStatusKafkacluster) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatusKafkacluster) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_instance_status_kubernetes.go b/pkg/paastaapi/model_instance_status_kubernetes.go new file mode 100644 index 0000000..5b5ff77 --- /dev/null +++ b/pkg/paastaapi/model_instance_status_kubernetes.go @@ -0,0 +1,647 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InstanceStatusKubernetes struct for InstanceStatusKubernetes +type InstanceStatusKubernetes struct { + // The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing) + AppCount int32 `json:"app_count"` + // ID of the desired version of a service instance + AppId *string `json:"app_id,omitempty"` + AutoscalingStatus *InstanceStatusKubernetesAutoscalingStatus `json:"autoscaling_status,omitempty"` + // backoff in seconds before launching the next task + BackoffSeconds *int32 `json:"backoff_seconds,omitempty"` + // Method to transit between new and old versions of a service + BounceMethod string `json:"bounce_method"` + // Unix timestamp when this app was created + CreateTimestamp *float32 `json:"create_timestamp,omitempty"` + // Deploy status of a Kubernetes service + DeployStatus *string `json:"deploy_status,omitempty"` + // Reason for the deploy status + DeployStatusMessage *string `json:"deploy_status_message,omitempty"` + // Desired state of a service, for Kubernetes + DesiredState string `json:"desired_state"` + // Error message when a kubernetes object (Deployment/Statefulset) cannot be found + ErrorMessage *string `json:"error_message,omitempty"` + // The number of desired instances of the service + ExpectedInstanceCount *int32 `json:"expected_instance_count,omitempty"` + // The namespace this app is running + Namespace *string `json:"namespace,omitempty"` + // Pods associated to this app + Pods *[]KubernetesPod `json:"pods,omitempty"` + // ReplicaSets associated to this app + Replicasets *[]KubernetesReplicaSet `json:"replicasets,omitempty"` + // The number of actual running instances of the service + RunningInstanceCount *int32 `json:"running_instance_count,omitempty"` + Smartstack *SmartstackStatus `json:"smartstack,omitempty"` +} + +// NewInstanceStatusKubernetes instantiates a new InstanceStatusKubernetes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceStatusKubernetes(appCount int32, bounceMethod string, desiredState string, ) *InstanceStatusKubernetes { + this := InstanceStatusKubernetes{} + this.AppCount = appCount + this.BounceMethod = bounceMethod + this.DesiredState = desiredState + return &this +} + +// NewInstanceStatusKubernetesWithDefaults instantiates a new InstanceStatusKubernetes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceStatusKubernetesWithDefaults() *InstanceStatusKubernetes { + this := InstanceStatusKubernetes{} + return &this +} + +// GetAppCount returns the AppCount field value +func (o *InstanceStatusKubernetes) GetAppCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.AppCount +} + +// GetAppCountOk returns a tuple with the AppCount field value +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetAppCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.AppCount, true +} + +// SetAppCount sets field value +func (o *InstanceStatusKubernetes) SetAppCount(v int32) { + o.AppCount = v +} + +// GetAppId returns the AppId field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetAppId() string { + if o == nil || o.AppId == nil { + var ret string + return ret + } + return *o.AppId +} + +// GetAppIdOk returns a tuple with the AppId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetAppIdOk() (*string, bool) { + if o == nil || o.AppId == nil { + return nil, false + } + return o.AppId, true +} + +// HasAppId returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasAppId() bool { + if o != nil && o.AppId != nil { + return true + } + + return false +} + +// SetAppId gets a reference to the given string and assigns it to the AppId field. +func (o *InstanceStatusKubernetes) SetAppId(v string) { + o.AppId = &v +} + +// GetAutoscalingStatus returns the AutoscalingStatus field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetAutoscalingStatus() InstanceStatusKubernetesAutoscalingStatus { + if o == nil || o.AutoscalingStatus == nil { + var ret InstanceStatusKubernetesAutoscalingStatus + return ret + } + return *o.AutoscalingStatus +} + +// GetAutoscalingStatusOk returns a tuple with the AutoscalingStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetAutoscalingStatusOk() (*InstanceStatusKubernetesAutoscalingStatus, bool) { + if o == nil || o.AutoscalingStatus == nil { + return nil, false + } + return o.AutoscalingStatus, true +} + +// HasAutoscalingStatus returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasAutoscalingStatus() bool { + if o != nil && o.AutoscalingStatus != nil { + return true + } + + return false +} + +// SetAutoscalingStatus gets a reference to the given InstanceStatusKubernetesAutoscalingStatus and assigns it to the AutoscalingStatus field. +func (o *InstanceStatusKubernetes) SetAutoscalingStatus(v InstanceStatusKubernetesAutoscalingStatus) { + o.AutoscalingStatus = &v +} + +// GetBackoffSeconds returns the BackoffSeconds field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetBackoffSeconds() int32 { + if o == nil || o.BackoffSeconds == nil { + var ret int32 + return ret + } + return *o.BackoffSeconds +} + +// GetBackoffSecondsOk returns a tuple with the BackoffSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetBackoffSecondsOk() (*int32, bool) { + if o == nil || o.BackoffSeconds == nil { + return nil, false + } + return o.BackoffSeconds, true +} + +// HasBackoffSeconds returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasBackoffSeconds() bool { + if o != nil && o.BackoffSeconds != nil { + return true + } + + return false +} + +// SetBackoffSeconds gets a reference to the given int32 and assigns it to the BackoffSeconds field. +func (o *InstanceStatusKubernetes) SetBackoffSeconds(v int32) { + o.BackoffSeconds = &v +} + +// GetBounceMethod returns the BounceMethod field value +func (o *InstanceStatusKubernetes) GetBounceMethod() string { + if o == nil { + var ret string + return ret + } + + return o.BounceMethod +} + +// GetBounceMethodOk returns a tuple with the BounceMethod field value +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetBounceMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BounceMethod, true +} + +// SetBounceMethod sets field value +func (o *InstanceStatusKubernetes) SetBounceMethod(v string) { + o.BounceMethod = v +} + +// GetCreateTimestamp returns the CreateTimestamp field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetCreateTimestamp() float32 { + if o == nil || o.CreateTimestamp == nil { + var ret float32 + return ret + } + return *o.CreateTimestamp +} + +// GetCreateTimestampOk returns a tuple with the CreateTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetCreateTimestampOk() (*float32, bool) { + if o == nil || o.CreateTimestamp == nil { + return nil, false + } + return o.CreateTimestamp, true +} + +// HasCreateTimestamp returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasCreateTimestamp() bool { + if o != nil && o.CreateTimestamp != nil { + return true + } + + return false +} + +// SetCreateTimestamp gets a reference to the given float32 and assigns it to the CreateTimestamp field. +func (o *InstanceStatusKubernetes) SetCreateTimestamp(v float32) { + o.CreateTimestamp = &v +} + +// GetDeployStatus returns the DeployStatus field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetDeployStatus() string { + if o == nil || o.DeployStatus == nil { + var ret string + return ret + } + return *o.DeployStatus +} + +// GetDeployStatusOk returns a tuple with the DeployStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetDeployStatusOk() (*string, bool) { + if o == nil || o.DeployStatus == nil { + return nil, false + } + return o.DeployStatus, true +} + +// HasDeployStatus returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasDeployStatus() bool { + if o != nil && o.DeployStatus != nil { + return true + } + + return false +} + +// SetDeployStatus gets a reference to the given string and assigns it to the DeployStatus field. +func (o *InstanceStatusKubernetes) SetDeployStatus(v string) { + o.DeployStatus = &v +} + +// GetDeployStatusMessage returns the DeployStatusMessage field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetDeployStatusMessage() string { + if o == nil || o.DeployStatusMessage == nil { + var ret string + return ret + } + return *o.DeployStatusMessage +} + +// GetDeployStatusMessageOk returns a tuple with the DeployStatusMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetDeployStatusMessageOk() (*string, bool) { + if o == nil || o.DeployStatusMessage == nil { + return nil, false + } + return o.DeployStatusMessage, true +} + +// HasDeployStatusMessage returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasDeployStatusMessage() bool { + if o != nil && o.DeployStatusMessage != nil { + return true + } + + return false +} + +// SetDeployStatusMessage gets a reference to the given string and assigns it to the DeployStatusMessage field. +func (o *InstanceStatusKubernetes) SetDeployStatusMessage(v string) { + o.DeployStatusMessage = &v +} + +// GetDesiredState returns the DesiredState field value +func (o *InstanceStatusKubernetes) GetDesiredState() string { + if o == nil { + var ret string + return ret + } + + return o.DesiredState +} + +// GetDesiredStateOk returns a tuple with the DesiredState field value +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetDesiredStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DesiredState, true +} + +// SetDesiredState sets field value +func (o *InstanceStatusKubernetes) SetDesiredState(v string) { + o.DesiredState = v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetErrorMessage() string { + if o == nil || o.ErrorMessage == nil { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetErrorMessageOk() (*string, bool) { + if o == nil || o.ErrorMessage == nil { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasErrorMessage() bool { + if o != nil && o.ErrorMessage != nil { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *InstanceStatusKubernetes) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetExpectedInstanceCount returns the ExpectedInstanceCount field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetExpectedInstanceCount() int32 { + if o == nil || o.ExpectedInstanceCount == nil { + var ret int32 + return ret + } + return *o.ExpectedInstanceCount +} + +// GetExpectedInstanceCountOk returns a tuple with the ExpectedInstanceCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetExpectedInstanceCountOk() (*int32, bool) { + if o == nil || o.ExpectedInstanceCount == nil { + return nil, false + } + return o.ExpectedInstanceCount, true +} + +// HasExpectedInstanceCount returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasExpectedInstanceCount() bool { + if o != nil && o.ExpectedInstanceCount != nil { + return true + } + + return false +} + +// SetExpectedInstanceCount gets a reference to the given int32 and assigns it to the ExpectedInstanceCount field. +func (o *InstanceStatusKubernetes) SetExpectedInstanceCount(v int32) { + o.ExpectedInstanceCount = &v +} + +// GetNamespace returns the Namespace field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetNamespace() string { + if o == nil || o.Namespace == nil { + var ret string + return ret + } + return *o.Namespace +} + +// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetNamespaceOk() (*string, bool) { + if o == nil || o.Namespace == nil { + return nil, false + } + return o.Namespace, true +} + +// HasNamespace returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasNamespace() bool { + if o != nil && o.Namespace != nil { + return true + } + + return false +} + +// SetNamespace gets a reference to the given string and assigns it to the Namespace field. +func (o *InstanceStatusKubernetes) SetNamespace(v string) { + o.Namespace = &v +} + +// GetPods returns the Pods field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetPods() []KubernetesPod { + if o == nil || o.Pods == nil { + var ret []KubernetesPod + return ret + } + return *o.Pods +} + +// GetPodsOk returns a tuple with the Pods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetPodsOk() (*[]KubernetesPod, bool) { + if o == nil || o.Pods == nil { + return nil, false + } + return o.Pods, true +} + +// HasPods returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasPods() bool { + if o != nil && o.Pods != nil { + return true + } + + return false +} + +// SetPods gets a reference to the given []KubernetesPod and assigns it to the Pods field. +func (o *InstanceStatusKubernetes) SetPods(v []KubernetesPod) { + o.Pods = &v +} + +// GetReplicasets returns the Replicasets field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetReplicasets() []KubernetesReplicaSet { + if o == nil || o.Replicasets == nil { + var ret []KubernetesReplicaSet + return ret + } + return *o.Replicasets +} + +// GetReplicasetsOk returns a tuple with the Replicasets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetReplicasetsOk() (*[]KubernetesReplicaSet, bool) { + if o == nil || o.Replicasets == nil { + return nil, false + } + return o.Replicasets, true +} + +// HasReplicasets returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasReplicasets() bool { + if o != nil && o.Replicasets != nil { + return true + } + + return false +} + +// SetReplicasets gets a reference to the given []KubernetesReplicaSet and assigns it to the Replicasets field. +func (o *InstanceStatusKubernetes) SetReplicasets(v []KubernetesReplicaSet) { + o.Replicasets = &v +} + +// GetRunningInstanceCount returns the RunningInstanceCount field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetRunningInstanceCount() int32 { + if o == nil || o.RunningInstanceCount == nil { + var ret int32 + return ret + } + return *o.RunningInstanceCount +} + +// GetRunningInstanceCountOk returns a tuple with the RunningInstanceCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetRunningInstanceCountOk() (*int32, bool) { + if o == nil || o.RunningInstanceCount == nil { + return nil, false + } + return o.RunningInstanceCount, true +} + +// HasRunningInstanceCount returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasRunningInstanceCount() bool { + if o != nil && o.RunningInstanceCount != nil { + return true + } + + return false +} + +// SetRunningInstanceCount gets a reference to the given int32 and assigns it to the RunningInstanceCount field. +func (o *InstanceStatusKubernetes) SetRunningInstanceCount(v int32) { + o.RunningInstanceCount = &v +} + +// GetSmartstack returns the Smartstack field value if set, zero value otherwise. +func (o *InstanceStatusKubernetes) GetSmartstack() SmartstackStatus { + if o == nil || o.Smartstack == nil { + var ret SmartstackStatus + return ret + } + return *o.Smartstack +} + +// GetSmartstackOk returns a tuple with the Smartstack field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetes) GetSmartstackOk() (*SmartstackStatus, bool) { + if o == nil || o.Smartstack == nil { + return nil, false + } + return o.Smartstack, true +} + +// HasSmartstack returns a boolean if a field has been set. +func (o *InstanceStatusKubernetes) HasSmartstack() bool { + if o != nil && o.Smartstack != nil { + return true + } + + return false +} + +// SetSmartstack gets a reference to the given SmartstackStatus and assigns it to the Smartstack field. +func (o *InstanceStatusKubernetes) SetSmartstack(v SmartstackStatus) { + o.Smartstack = &v +} + +func (o InstanceStatusKubernetes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["app_count"] = o.AppCount + } + if o.AppId != nil { + toSerialize["app_id"] = o.AppId + } + if o.AutoscalingStatus != nil { + toSerialize["autoscaling_status"] = o.AutoscalingStatus + } + if o.BackoffSeconds != nil { + toSerialize["backoff_seconds"] = o.BackoffSeconds + } + if true { + toSerialize["bounce_method"] = o.BounceMethod + } + if o.CreateTimestamp != nil { + toSerialize["create_timestamp"] = o.CreateTimestamp + } + if o.DeployStatus != nil { + toSerialize["deploy_status"] = o.DeployStatus + } + if o.DeployStatusMessage != nil { + toSerialize["deploy_status_message"] = o.DeployStatusMessage + } + if true { + toSerialize["desired_state"] = o.DesiredState + } + if o.ErrorMessage != nil { + toSerialize["error_message"] = o.ErrorMessage + } + if o.ExpectedInstanceCount != nil { + toSerialize["expected_instance_count"] = o.ExpectedInstanceCount + } + if o.Namespace != nil { + toSerialize["namespace"] = o.Namespace + } + if o.Pods != nil { + toSerialize["pods"] = o.Pods + } + if o.Replicasets != nil { + toSerialize["replicasets"] = o.Replicasets + } + if o.RunningInstanceCount != nil { + toSerialize["running_instance_count"] = o.RunningInstanceCount + } + if o.Smartstack != nil { + toSerialize["smartstack"] = o.Smartstack + } + return json.Marshal(toSerialize) +} + +type NullableInstanceStatusKubernetes struct { + value *InstanceStatusKubernetes + isSet bool +} + +func (v NullableInstanceStatusKubernetes) Get() *InstanceStatusKubernetes { + return v.value +} + +func (v *NullableInstanceStatusKubernetes) Set(val *InstanceStatusKubernetes) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatusKubernetes) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatusKubernetes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatusKubernetes(val *InstanceStatusKubernetes) *NullableInstanceStatusKubernetes { + return &NullableInstanceStatusKubernetes{value: val, isSet: true} +} + +func (v NullableInstanceStatusKubernetes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatusKubernetes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_instance_status_kubernetes_autoscaling_status.go b/pkg/paastaapi/model_instance_status_kubernetes_autoscaling_status.go new file mode 100644 index 0000000..4dee13b --- /dev/null +++ b/pkg/paastaapi/model_instance_status_kubernetes_autoscaling_status.go @@ -0,0 +1,263 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InstanceStatusKubernetesAutoscalingStatus HPA associated to this app +type InstanceStatusKubernetesAutoscalingStatus struct { + // desired number of _instances as calculated by HPA + DesiredReplicas *int32 `json:"desired_replicas,omitempty"` + // timestamp of last autoscale + LastScaleTime *string `json:"last_scale_time,omitempty"` + // min_instances as specified in yelpsoa_configs + MaxInstances *int32 `json:"max_instances,omitempty"` + // Current metrics + Metrics *[]HPAMetric `json:"metrics,omitempty"` + // min_instances as specified in yelpsoa_configs + MinInstances *int32 `json:"min_instances,omitempty"` +} + +// NewInstanceStatusKubernetesAutoscalingStatus instantiates a new InstanceStatusKubernetesAutoscalingStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceStatusKubernetesAutoscalingStatus() *InstanceStatusKubernetesAutoscalingStatus { + this := InstanceStatusKubernetesAutoscalingStatus{} + return &this +} + +// NewInstanceStatusKubernetesAutoscalingStatusWithDefaults instantiates a new InstanceStatusKubernetesAutoscalingStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceStatusKubernetesAutoscalingStatusWithDefaults() *InstanceStatusKubernetesAutoscalingStatus { + this := InstanceStatusKubernetesAutoscalingStatus{} + return &this +} + +// GetDesiredReplicas returns the DesiredReplicas field value if set, zero value otherwise. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetDesiredReplicas() int32 { + if o == nil || o.DesiredReplicas == nil { + var ret int32 + return ret + } + return *o.DesiredReplicas +} + +// GetDesiredReplicasOk returns a tuple with the DesiredReplicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetDesiredReplicasOk() (*int32, bool) { + if o == nil || o.DesiredReplicas == nil { + return nil, false + } + return o.DesiredReplicas, true +} + +// HasDesiredReplicas returns a boolean if a field has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) HasDesiredReplicas() bool { + if o != nil && o.DesiredReplicas != nil { + return true + } + + return false +} + +// SetDesiredReplicas gets a reference to the given int32 and assigns it to the DesiredReplicas field. +func (o *InstanceStatusKubernetesAutoscalingStatus) SetDesiredReplicas(v int32) { + o.DesiredReplicas = &v +} + +// GetLastScaleTime returns the LastScaleTime field value if set, zero value otherwise. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetLastScaleTime() string { + if o == nil || o.LastScaleTime == nil { + var ret string + return ret + } + return *o.LastScaleTime +} + +// GetLastScaleTimeOk returns a tuple with the LastScaleTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetLastScaleTimeOk() (*string, bool) { + if o == nil || o.LastScaleTime == nil { + return nil, false + } + return o.LastScaleTime, true +} + +// HasLastScaleTime returns a boolean if a field has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) HasLastScaleTime() bool { + if o != nil && o.LastScaleTime != nil { + return true + } + + return false +} + +// SetLastScaleTime gets a reference to the given string and assigns it to the LastScaleTime field. +func (o *InstanceStatusKubernetesAutoscalingStatus) SetLastScaleTime(v string) { + o.LastScaleTime = &v +} + +// GetMaxInstances returns the MaxInstances field value if set, zero value otherwise. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetMaxInstances() int32 { + if o == nil || o.MaxInstances == nil { + var ret int32 + return ret + } + return *o.MaxInstances +} + +// GetMaxInstancesOk returns a tuple with the MaxInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetMaxInstancesOk() (*int32, bool) { + if o == nil || o.MaxInstances == nil { + return nil, false + } + return o.MaxInstances, true +} + +// HasMaxInstances returns a boolean if a field has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) HasMaxInstances() bool { + if o != nil && o.MaxInstances != nil { + return true + } + + return false +} + +// SetMaxInstances gets a reference to the given int32 and assigns it to the MaxInstances field. +func (o *InstanceStatusKubernetesAutoscalingStatus) SetMaxInstances(v int32) { + o.MaxInstances = &v +} + +// GetMetrics returns the Metrics field value if set, zero value otherwise. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetMetrics() []HPAMetric { + if o == nil || o.Metrics == nil { + var ret []HPAMetric + return ret + } + return *o.Metrics +} + +// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetMetricsOk() (*[]HPAMetric, bool) { + if o == nil || o.Metrics == nil { + return nil, false + } + return o.Metrics, true +} + +// HasMetrics returns a boolean if a field has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) HasMetrics() bool { + if o != nil && o.Metrics != nil { + return true + } + + return false +} + +// SetMetrics gets a reference to the given []HPAMetric and assigns it to the Metrics field. +func (o *InstanceStatusKubernetesAutoscalingStatus) SetMetrics(v []HPAMetric) { + o.Metrics = &v +} + +// GetMinInstances returns the MinInstances field value if set, zero value otherwise. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetMinInstances() int32 { + if o == nil || o.MinInstances == nil { + var ret int32 + return ret + } + return *o.MinInstances +} + +// GetMinInstancesOk returns a tuple with the MinInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) GetMinInstancesOk() (*int32, bool) { + if o == nil || o.MinInstances == nil { + return nil, false + } + return o.MinInstances, true +} + +// HasMinInstances returns a boolean if a field has been set. +func (o *InstanceStatusKubernetesAutoscalingStatus) HasMinInstances() bool { + if o != nil && o.MinInstances != nil { + return true + } + + return false +} + +// SetMinInstances gets a reference to the given int32 and assigns it to the MinInstances field. +func (o *InstanceStatusKubernetesAutoscalingStatus) SetMinInstances(v int32) { + o.MinInstances = &v +} + +func (o InstanceStatusKubernetesAutoscalingStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.DesiredReplicas != nil { + toSerialize["desired_replicas"] = o.DesiredReplicas + } + if o.LastScaleTime != nil { + toSerialize["last_scale_time"] = o.LastScaleTime + } + if o.MaxInstances != nil { + toSerialize["max_instances"] = o.MaxInstances + } + if o.Metrics != nil { + toSerialize["metrics"] = o.Metrics + } + if o.MinInstances != nil { + toSerialize["min_instances"] = o.MinInstances + } + return json.Marshal(toSerialize) +} + +type NullableInstanceStatusKubernetesAutoscalingStatus struct { + value *InstanceStatusKubernetesAutoscalingStatus + isSet bool +} + +func (v NullableInstanceStatusKubernetesAutoscalingStatus) Get() *InstanceStatusKubernetesAutoscalingStatus { + return v.value +} + +func (v *NullableInstanceStatusKubernetesAutoscalingStatus) Set(val *InstanceStatusKubernetesAutoscalingStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatusKubernetesAutoscalingStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatusKubernetesAutoscalingStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatusKubernetesAutoscalingStatus(val *InstanceStatusKubernetesAutoscalingStatus) *NullableInstanceStatusKubernetesAutoscalingStatus { + return &NullableInstanceStatusKubernetesAutoscalingStatus{value: val, isSet: true} +} + +func (v NullableInstanceStatusKubernetesAutoscalingStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatusKubernetesAutoscalingStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_instance_status_marathon.go b/pkg/paastaapi/model_instance_status_marathon.go new file mode 100644 index 0000000..65b8d50 --- /dev/null +++ b/pkg/paastaapi/model_instance_status_marathon.go @@ -0,0 +1,571 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InstanceStatusMarathon struct for InstanceStatusMarathon +type InstanceStatusMarathon struct { + // The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing) + AppCount int32 `json:"app_count"` + // Statuses of each app of the service + AppStatuses *[]MarathonAppStatus `json:"app_statuses,omitempty"` + AutoscalingInfo *MarathonAutoscalingInfo `json:"autoscaling_info,omitempty"` + // backoff in seconds before launching the next task + BackoffSeconds *int32 `json:"backoff_seconds,omitempty"` + // Method to transit between new and old versions of a service + BounceMethod string `json:"bounce_method"` + // Deploy status of a marathon service + DeployStatus *string `json:"deploy_status,omitempty"` + // ID of the desired version of a service instance + DesiredAppId *string `json:"desired_app_id,omitempty"` + // Desired state of a service, for Marathon + DesiredState string `json:"desired_state"` + Envoy *EnvoyStatus `json:"envoy,omitempty"` + // Error message when a marathon job ID cannot be found + ErrorMessage *string `json:"error_message,omitempty"` + // The number of desired instances of the service + ExpectedInstanceCount *int32 `json:"expected_instance_count,omitempty"` + Mesos *MarathonMesosStatus `json:"mesos,omitempty"` + // The number of actual running instances of the service + RunningInstanceCount *int32 `json:"running_instance_count,omitempty"` + Smartstack *SmartstackStatus `json:"smartstack,omitempty"` +} + +// NewInstanceStatusMarathon instantiates a new InstanceStatusMarathon object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceStatusMarathon(appCount int32, bounceMethod string, desiredState string, ) *InstanceStatusMarathon { + this := InstanceStatusMarathon{} + this.AppCount = appCount + this.BounceMethod = bounceMethod + this.DesiredState = desiredState + return &this +} + +// NewInstanceStatusMarathonWithDefaults instantiates a new InstanceStatusMarathon object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceStatusMarathonWithDefaults() *InstanceStatusMarathon { + this := InstanceStatusMarathon{} + return &this +} + +// GetAppCount returns the AppCount field value +func (o *InstanceStatusMarathon) GetAppCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.AppCount +} + +// GetAppCountOk returns a tuple with the AppCount field value +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetAppCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.AppCount, true +} + +// SetAppCount sets field value +func (o *InstanceStatusMarathon) SetAppCount(v int32) { + o.AppCount = v +} + +// GetAppStatuses returns the AppStatuses field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetAppStatuses() []MarathonAppStatus { + if o == nil || o.AppStatuses == nil { + var ret []MarathonAppStatus + return ret + } + return *o.AppStatuses +} + +// GetAppStatusesOk returns a tuple with the AppStatuses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetAppStatusesOk() (*[]MarathonAppStatus, bool) { + if o == nil || o.AppStatuses == nil { + return nil, false + } + return o.AppStatuses, true +} + +// HasAppStatuses returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasAppStatuses() bool { + if o != nil && o.AppStatuses != nil { + return true + } + + return false +} + +// SetAppStatuses gets a reference to the given []MarathonAppStatus and assigns it to the AppStatuses field. +func (o *InstanceStatusMarathon) SetAppStatuses(v []MarathonAppStatus) { + o.AppStatuses = &v +} + +// GetAutoscalingInfo returns the AutoscalingInfo field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetAutoscalingInfo() MarathonAutoscalingInfo { + if o == nil || o.AutoscalingInfo == nil { + var ret MarathonAutoscalingInfo + return ret + } + return *o.AutoscalingInfo +} + +// GetAutoscalingInfoOk returns a tuple with the AutoscalingInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetAutoscalingInfoOk() (*MarathonAutoscalingInfo, bool) { + if o == nil || o.AutoscalingInfo == nil { + return nil, false + } + return o.AutoscalingInfo, true +} + +// HasAutoscalingInfo returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasAutoscalingInfo() bool { + if o != nil && o.AutoscalingInfo != nil { + return true + } + + return false +} + +// SetAutoscalingInfo gets a reference to the given MarathonAutoscalingInfo and assigns it to the AutoscalingInfo field. +func (o *InstanceStatusMarathon) SetAutoscalingInfo(v MarathonAutoscalingInfo) { + o.AutoscalingInfo = &v +} + +// GetBackoffSeconds returns the BackoffSeconds field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetBackoffSeconds() int32 { + if o == nil || o.BackoffSeconds == nil { + var ret int32 + return ret + } + return *o.BackoffSeconds +} + +// GetBackoffSecondsOk returns a tuple with the BackoffSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetBackoffSecondsOk() (*int32, bool) { + if o == nil || o.BackoffSeconds == nil { + return nil, false + } + return o.BackoffSeconds, true +} + +// HasBackoffSeconds returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasBackoffSeconds() bool { + if o != nil && o.BackoffSeconds != nil { + return true + } + + return false +} + +// SetBackoffSeconds gets a reference to the given int32 and assigns it to the BackoffSeconds field. +func (o *InstanceStatusMarathon) SetBackoffSeconds(v int32) { + o.BackoffSeconds = &v +} + +// GetBounceMethod returns the BounceMethod field value +func (o *InstanceStatusMarathon) GetBounceMethod() string { + if o == nil { + var ret string + return ret + } + + return o.BounceMethod +} + +// GetBounceMethodOk returns a tuple with the BounceMethod field value +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetBounceMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BounceMethod, true +} + +// SetBounceMethod sets field value +func (o *InstanceStatusMarathon) SetBounceMethod(v string) { + o.BounceMethod = v +} + +// GetDeployStatus returns the DeployStatus field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetDeployStatus() string { + if o == nil || o.DeployStatus == nil { + var ret string + return ret + } + return *o.DeployStatus +} + +// GetDeployStatusOk returns a tuple with the DeployStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetDeployStatusOk() (*string, bool) { + if o == nil || o.DeployStatus == nil { + return nil, false + } + return o.DeployStatus, true +} + +// HasDeployStatus returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasDeployStatus() bool { + if o != nil && o.DeployStatus != nil { + return true + } + + return false +} + +// SetDeployStatus gets a reference to the given string and assigns it to the DeployStatus field. +func (o *InstanceStatusMarathon) SetDeployStatus(v string) { + o.DeployStatus = &v +} + +// GetDesiredAppId returns the DesiredAppId field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetDesiredAppId() string { + if o == nil || o.DesiredAppId == nil { + var ret string + return ret + } + return *o.DesiredAppId +} + +// GetDesiredAppIdOk returns a tuple with the DesiredAppId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetDesiredAppIdOk() (*string, bool) { + if o == nil || o.DesiredAppId == nil { + return nil, false + } + return o.DesiredAppId, true +} + +// HasDesiredAppId returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasDesiredAppId() bool { + if o != nil && o.DesiredAppId != nil { + return true + } + + return false +} + +// SetDesiredAppId gets a reference to the given string and assigns it to the DesiredAppId field. +func (o *InstanceStatusMarathon) SetDesiredAppId(v string) { + o.DesiredAppId = &v +} + +// GetDesiredState returns the DesiredState field value +func (o *InstanceStatusMarathon) GetDesiredState() string { + if o == nil { + var ret string + return ret + } + + return o.DesiredState +} + +// GetDesiredStateOk returns a tuple with the DesiredState field value +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetDesiredStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DesiredState, true +} + +// SetDesiredState sets field value +func (o *InstanceStatusMarathon) SetDesiredState(v string) { + o.DesiredState = v +} + +// GetEnvoy returns the Envoy field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetEnvoy() EnvoyStatus { + if o == nil || o.Envoy == nil { + var ret EnvoyStatus + return ret + } + return *o.Envoy +} + +// GetEnvoyOk returns a tuple with the Envoy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetEnvoyOk() (*EnvoyStatus, bool) { + if o == nil || o.Envoy == nil { + return nil, false + } + return o.Envoy, true +} + +// HasEnvoy returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasEnvoy() bool { + if o != nil && o.Envoy != nil { + return true + } + + return false +} + +// SetEnvoy gets a reference to the given EnvoyStatus and assigns it to the Envoy field. +func (o *InstanceStatusMarathon) SetEnvoy(v EnvoyStatus) { + o.Envoy = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetErrorMessage() string { + if o == nil || o.ErrorMessage == nil { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetErrorMessageOk() (*string, bool) { + if o == nil || o.ErrorMessage == nil { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasErrorMessage() bool { + if o != nil && o.ErrorMessage != nil { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *InstanceStatusMarathon) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetExpectedInstanceCount returns the ExpectedInstanceCount field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetExpectedInstanceCount() int32 { + if o == nil || o.ExpectedInstanceCount == nil { + var ret int32 + return ret + } + return *o.ExpectedInstanceCount +} + +// GetExpectedInstanceCountOk returns a tuple with the ExpectedInstanceCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetExpectedInstanceCountOk() (*int32, bool) { + if o == nil || o.ExpectedInstanceCount == nil { + return nil, false + } + return o.ExpectedInstanceCount, true +} + +// HasExpectedInstanceCount returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasExpectedInstanceCount() bool { + if o != nil && o.ExpectedInstanceCount != nil { + return true + } + + return false +} + +// SetExpectedInstanceCount gets a reference to the given int32 and assigns it to the ExpectedInstanceCount field. +func (o *InstanceStatusMarathon) SetExpectedInstanceCount(v int32) { + o.ExpectedInstanceCount = &v +} + +// GetMesos returns the Mesos field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetMesos() MarathonMesosStatus { + if o == nil || o.Mesos == nil { + var ret MarathonMesosStatus + return ret + } + return *o.Mesos +} + +// GetMesosOk returns a tuple with the Mesos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetMesosOk() (*MarathonMesosStatus, bool) { + if o == nil || o.Mesos == nil { + return nil, false + } + return o.Mesos, true +} + +// HasMesos returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasMesos() bool { + if o != nil && o.Mesos != nil { + return true + } + + return false +} + +// SetMesos gets a reference to the given MarathonMesosStatus and assigns it to the Mesos field. +func (o *InstanceStatusMarathon) SetMesos(v MarathonMesosStatus) { + o.Mesos = &v +} + +// GetRunningInstanceCount returns the RunningInstanceCount field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetRunningInstanceCount() int32 { + if o == nil || o.RunningInstanceCount == nil { + var ret int32 + return ret + } + return *o.RunningInstanceCount +} + +// GetRunningInstanceCountOk returns a tuple with the RunningInstanceCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetRunningInstanceCountOk() (*int32, bool) { + if o == nil || o.RunningInstanceCount == nil { + return nil, false + } + return o.RunningInstanceCount, true +} + +// HasRunningInstanceCount returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasRunningInstanceCount() bool { + if o != nil && o.RunningInstanceCount != nil { + return true + } + + return false +} + +// SetRunningInstanceCount gets a reference to the given int32 and assigns it to the RunningInstanceCount field. +func (o *InstanceStatusMarathon) SetRunningInstanceCount(v int32) { + o.RunningInstanceCount = &v +} + +// GetSmartstack returns the Smartstack field value if set, zero value otherwise. +func (o *InstanceStatusMarathon) GetSmartstack() SmartstackStatus { + if o == nil || o.Smartstack == nil { + var ret SmartstackStatus + return ret + } + return *o.Smartstack +} + +// GetSmartstackOk returns a tuple with the Smartstack field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusMarathon) GetSmartstackOk() (*SmartstackStatus, bool) { + if o == nil || o.Smartstack == nil { + return nil, false + } + return o.Smartstack, true +} + +// HasSmartstack returns a boolean if a field has been set. +func (o *InstanceStatusMarathon) HasSmartstack() bool { + if o != nil && o.Smartstack != nil { + return true + } + + return false +} + +// SetSmartstack gets a reference to the given SmartstackStatus and assigns it to the Smartstack field. +func (o *InstanceStatusMarathon) SetSmartstack(v SmartstackStatus) { + o.Smartstack = &v +} + +func (o InstanceStatusMarathon) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["app_count"] = o.AppCount + } + if o.AppStatuses != nil { + toSerialize["app_statuses"] = o.AppStatuses + } + if o.AutoscalingInfo != nil { + toSerialize["autoscaling_info"] = o.AutoscalingInfo + } + if o.BackoffSeconds != nil { + toSerialize["backoff_seconds"] = o.BackoffSeconds + } + if true { + toSerialize["bounce_method"] = o.BounceMethod + } + if o.DeployStatus != nil { + toSerialize["deploy_status"] = o.DeployStatus + } + if o.DesiredAppId != nil { + toSerialize["desired_app_id"] = o.DesiredAppId + } + if true { + toSerialize["desired_state"] = o.DesiredState + } + if o.Envoy != nil { + toSerialize["envoy"] = o.Envoy + } + if o.ErrorMessage != nil { + toSerialize["error_message"] = o.ErrorMessage + } + if o.ExpectedInstanceCount != nil { + toSerialize["expected_instance_count"] = o.ExpectedInstanceCount + } + if o.Mesos != nil { + toSerialize["mesos"] = o.Mesos + } + if o.RunningInstanceCount != nil { + toSerialize["running_instance_count"] = o.RunningInstanceCount + } + if o.Smartstack != nil { + toSerialize["smartstack"] = o.Smartstack + } + return json.Marshal(toSerialize) +} + +type NullableInstanceStatusMarathon struct { + value *InstanceStatusMarathon + isSet bool +} + +func (v NullableInstanceStatusMarathon) Get() *InstanceStatusMarathon { + return v.value +} + +func (v *NullableInstanceStatusMarathon) Set(val *InstanceStatusMarathon) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatusMarathon) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatusMarathon) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatusMarathon(val *InstanceStatusMarathon) *NullableInstanceStatusMarathon { + return &NullableInstanceStatusMarathon{value: val, isSet: true} +} + +func (v NullableInstanceStatusMarathon) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatusMarathon) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_instance_status_tron.go b/pkg/paastaapi/model_instance_status_tron.go new file mode 100644 index 0000000..9f8007c --- /dev/null +++ b/pkg/paastaapi/model_instance_status_tron.go @@ -0,0 +1,471 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// InstanceStatusTron struct for InstanceStatusTron +type InstanceStatusTron struct { + // The command of the action + ActionCommand *string `json:"action_command,omitempty"` + // The name of the action + ActionName *string `json:"action_name,omitempty"` + // The raw command of the action + ActionRawCommand *string `json:"action_raw_command,omitempty"` + // The start time of the action + ActionStartTime *string `json:"action_start_time,omitempty"` + // The state of the action + ActionState *string `json:"action_state,omitempty"` + // The stderr command of the action + ActionStderr *string `json:"action_stderr,omitempty"` + // The stdout command of the action + ActionStdout *string `json:"action_stdout,omitempty"` + // The name of this job + JobName string `json:"job_name"` + // The job schedule of the job + JobSchedule *string `json:"job_schedule,omitempty"` + // The status of the job + JobStatus *string `json:"job_status,omitempty"` + // The dashboard url of the job + JobUrl string `json:"job_url"` +} + +// NewInstanceStatusTron instantiates a new InstanceStatusTron object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceStatusTron(jobName string, jobUrl string, ) *InstanceStatusTron { + this := InstanceStatusTron{} + this.JobName = jobName + this.JobUrl = jobUrl + return &this +} + +// NewInstanceStatusTronWithDefaults instantiates a new InstanceStatusTron object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceStatusTronWithDefaults() *InstanceStatusTron { + this := InstanceStatusTron{} + return &this +} + +// GetActionCommand returns the ActionCommand field value if set, zero value otherwise. +func (o *InstanceStatusTron) GetActionCommand() string { + if o == nil || o.ActionCommand == nil { + var ret string + return ret + } + return *o.ActionCommand +} + +// GetActionCommandOk returns a tuple with the ActionCommand field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetActionCommandOk() (*string, bool) { + if o == nil || o.ActionCommand == nil { + return nil, false + } + return o.ActionCommand, true +} + +// HasActionCommand returns a boolean if a field has been set. +func (o *InstanceStatusTron) HasActionCommand() bool { + if o != nil && o.ActionCommand != nil { + return true + } + + return false +} + +// SetActionCommand gets a reference to the given string and assigns it to the ActionCommand field. +func (o *InstanceStatusTron) SetActionCommand(v string) { + o.ActionCommand = &v +} + +// GetActionName returns the ActionName field value if set, zero value otherwise. +func (o *InstanceStatusTron) GetActionName() string { + if o == nil || o.ActionName == nil { + var ret string + return ret + } + return *o.ActionName +} + +// GetActionNameOk returns a tuple with the ActionName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetActionNameOk() (*string, bool) { + if o == nil || o.ActionName == nil { + return nil, false + } + return o.ActionName, true +} + +// HasActionName returns a boolean if a field has been set. +func (o *InstanceStatusTron) HasActionName() bool { + if o != nil && o.ActionName != nil { + return true + } + + return false +} + +// SetActionName gets a reference to the given string and assigns it to the ActionName field. +func (o *InstanceStatusTron) SetActionName(v string) { + o.ActionName = &v +} + +// GetActionRawCommand returns the ActionRawCommand field value if set, zero value otherwise. +func (o *InstanceStatusTron) GetActionRawCommand() string { + if o == nil || o.ActionRawCommand == nil { + var ret string + return ret + } + return *o.ActionRawCommand +} + +// GetActionRawCommandOk returns a tuple with the ActionRawCommand field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetActionRawCommandOk() (*string, bool) { + if o == nil || o.ActionRawCommand == nil { + return nil, false + } + return o.ActionRawCommand, true +} + +// HasActionRawCommand returns a boolean if a field has been set. +func (o *InstanceStatusTron) HasActionRawCommand() bool { + if o != nil && o.ActionRawCommand != nil { + return true + } + + return false +} + +// SetActionRawCommand gets a reference to the given string and assigns it to the ActionRawCommand field. +func (o *InstanceStatusTron) SetActionRawCommand(v string) { + o.ActionRawCommand = &v +} + +// GetActionStartTime returns the ActionStartTime field value if set, zero value otherwise. +func (o *InstanceStatusTron) GetActionStartTime() string { + if o == nil || o.ActionStartTime == nil { + var ret string + return ret + } + return *o.ActionStartTime +} + +// GetActionStartTimeOk returns a tuple with the ActionStartTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetActionStartTimeOk() (*string, bool) { + if o == nil || o.ActionStartTime == nil { + return nil, false + } + return o.ActionStartTime, true +} + +// HasActionStartTime returns a boolean if a field has been set. +func (o *InstanceStatusTron) HasActionStartTime() bool { + if o != nil && o.ActionStartTime != nil { + return true + } + + return false +} + +// SetActionStartTime gets a reference to the given string and assigns it to the ActionStartTime field. +func (o *InstanceStatusTron) SetActionStartTime(v string) { + o.ActionStartTime = &v +} + +// GetActionState returns the ActionState field value if set, zero value otherwise. +func (o *InstanceStatusTron) GetActionState() string { + if o == nil || o.ActionState == nil { + var ret string + return ret + } + return *o.ActionState +} + +// GetActionStateOk returns a tuple with the ActionState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetActionStateOk() (*string, bool) { + if o == nil || o.ActionState == nil { + return nil, false + } + return o.ActionState, true +} + +// HasActionState returns a boolean if a field has been set. +func (o *InstanceStatusTron) HasActionState() bool { + if o != nil && o.ActionState != nil { + return true + } + + return false +} + +// SetActionState gets a reference to the given string and assigns it to the ActionState field. +func (o *InstanceStatusTron) SetActionState(v string) { + o.ActionState = &v +} + +// GetActionStderr returns the ActionStderr field value if set, zero value otherwise. +func (o *InstanceStatusTron) GetActionStderr() string { + if o == nil || o.ActionStderr == nil { + var ret string + return ret + } + return *o.ActionStderr +} + +// GetActionStderrOk returns a tuple with the ActionStderr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetActionStderrOk() (*string, bool) { + if o == nil || o.ActionStderr == nil { + return nil, false + } + return o.ActionStderr, true +} + +// HasActionStderr returns a boolean if a field has been set. +func (o *InstanceStatusTron) HasActionStderr() bool { + if o != nil && o.ActionStderr != nil { + return true + } + + return false +} + +// SetActionStderr gets a reference to the given string and assigns it to the ActionStderr field. +func (o *InstanceStatusTron) SetActionStderr(v string) { + o.ActionStderr = &v +} + +// GetActionStdout returns the ActionStdout field value if set, zero value otherwise. +func (o *InstanceStatusTron) GetActionStdout() string { + if o == nil || o.ActionStdout == nil { + var ret string + return ret + } + return *o.ActionStdout +} + +// GetActionStdoutOk returns a tuple with the ActionStdout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetActionStdoutOk() (*string, bool) { + if o == nil || o.ActionStdout == nil { + return nil, false + } + return o.ActionStdout, true +} + +// HasActionStdout returns a boolean if a field has been set. +func (o *InstanceStatusTron) HasActionStdout() bool { + if o != nil && o.ActionStdout != nil { + return true + } + + return false +} + +// SetActionStdout gets a reference to the given string and assigns it to the ActionStdout field. +func (o *InstanceStatusTron) SetActionStdout(v string) { + o.ActionStdout = &v +} + +// GetJobName returns the JobName field value +func (o *InstanceStatusTron) GetJobName() string { + if o == nil { + var ret string + return ret + } + + return o.JobName +} + +// GetJobNameOk returns a tuple with the JobName field value +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetJobNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.JobName, true +} + +// SetJobName sets field value +func (o *InstanceStatusTron) SetJobName(v string) { + o.JobName = v +} + +// GetJobSchedule returns the JobSchedule field value if set, zero value otherwise. +func (o *InstanceStatusTron) GetJobSchedule() string { + if o == nil || o.JobSchedule == nil { + var ret string + return ret + } + return *o.JobSchedule +} + +// GetJobScheduleOk returns a tuple with the JobSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetJobScheduleOk() (*string, bool) { + if o == nil || o.JobSchedule == nil { + return nil, false + } + return o.JobSchedule, true +} + +// HasJobSchedule returns a boolean if a field has been set. +func (o *InstanceStatusTron) HasJobSchedule() bool { + if o != nil && o.JobSchedule != nil { + return true + } + + return false +} + +// SetJobSchedule gets a reference to the given string and assigns it to the JobSchedule field. +func (o *InstanceStatusTron) SetJobSchedule(v string) { + o.JobSchedule = &v +} + +// GetJobStatus returns the JobStatus field value if set, zero value otherwise. +func (o *InstanceStatusTron) GetJobStatus() string { + if o == nil || o.JobStatus == nil { + var ret string + return ret + } + return *o.JobStatus +} + +// GetJobStatusOk returns a tuple with the JobStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetJobStatusOk() (*string, bool) { + if o == nil || o.JobStatus == nil { + return nil, false + } + return o.JobStatus, true +} + +// HasJobStatus returns a boolean if a field has been set. +func (o *InstanceStatusTron) HasJobStatus() bool { + if o != nil && o.JobStatus != nil { + return true + } + + return false +} + +// SetJobStatus gets a reference to the given string and assigns it to the JobStatus field. +func (o *InstanceStatusTron) SetJobStatus(v string) { + o.JobStatus = &v +} + +// GetJobUrl returns the JobUrl field value +func (o *InstanceStatusTron) GetJobUrl() string { + if o == nil { + var ret string + return ret + } + + return o.JobUrl +} + +// GetJobUrlOk returns a tuple with the JobUrl field value +// and a boolean to check if the value has been set. +func (o *InstanceStatusTron) GetJobUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.JobUrl, true +} + +// SetJobUrl sets field value +func (o *InstanceStatusTron) SetJobUrl(v string) { + o.JobUrl = v +} + +func (o InstanceStatusTron) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ActionCommand != nil { + toSerialize["action_command"] = o.ActionCommand + } + if o.ActionName != nil { + toSerialize["action_name"] = o.ActionName + } + if o.ActionRawCommand != nil { + toSerialize["action_raw_command"] = o.ActionRawCommand + } + if o.ActionStartTime != nil { + toSerialize["action_start_time"] = o.ActionStartTime + } + if o.ActionState != nil { + toSerialize["action_state"] = o.ActionState + } + if o.ActionStderr != nil { + toSerialize["action_stderr"] = o.ActionStderr + } + if o.ActionStdout != nil { + toSerialize["action_stdout"] = o.ActionStdout + } + if true { + toSerialize["job_name"] = o.JobName + } + if o.JobSchedule != nil { + toSerialize["job_schedule"] = o.JobSchedule + } + if o.JobStatus != nil { + toSerialize["job_status"] = o.JobStatus + } + if true { + toSerialize["job_url"] = o.JobUrl + } + return json.Marshal(toSerialize) +} + +type NullableInstanceStatusTron struct { + value *InstanceStatusTron + isSet bool +} + +func (v NullableInstanceStatusTron) Get() *InstanceStatusTron { + return v.value +} + +func (v *NullableInstanceStatusTron) Set(val *InstanceStatusTron) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStatusTron) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStatusTron) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStatusTron(val *InstanceStatusTron) *NullableInstanceStatusTron { + return &NullableInstanceStatusTron{value: val, isSet: true} +} + +func (v NullableInstanceStatusTron) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStatusTron) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_integer_and_error.go b/pkg/paastaapi/model_integer_and_error.go new file mode 100644 index 0000000..7eceb73 --- /dev/null +++ b/pkg/paastaapi/model_integer_and_error.go @@ -0,0 +1,150 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// IntegerAndError struct for IntegerAndError +type IntegerAndError struct { + ErrorMessage *string `json:"error_message,omitempty"` + Value *int32 `json:"value,omitempty"` +} + +// NewIntegerAndError instantiates a new IntegerAndError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIntegerAndError() *IntegerAndError { + this := IntegerAndError{} + return &this +} + +// NewIntegerAndErrorWithDefaults instantiates a new IntegerAndError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIntegerAndErrorWithDefaults() *IntegerAndError { + this := IntegerAndError{} + return &this +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *IntegerAndError) GetErrorMessage() string { + if o == nil || o.ErrorMessage == nil { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntegerAndError) GetErrorMessageOk() (*string, bool) { + if o == nil || o.ErrorMessage == nil { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *IntegerAndError) HasErrorMessage() bool { + if o != nil && o.ErrorMessage != nil { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *IntegerAndError) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *IntegerAndError) GetValue() int32 { + if o == nil || o.Value == nil { + var ret int32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IntegerAndError) GetValueOk() (*int32, bool) { + if o == nil || o.Value == nil { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *IntegerAndError) HasValue() bool { + if o != nil && o.Value != nil { + return true + } + + return false +} + +// SetValue gets a reference to the given int32 and assigns it to the Value field. +func (o *IntegerAndError) SetValue(v int32) { + o.Value = &v +} + +func (o IntegerAndError) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ErrorMessage != nil { + toSerialize["error_message"] = o.ErrorMessage + } + if o.Value != nil { + toSerialize["value"] = o.Value + } + return json.Marshal(toSerialize) +} + +type NullableIntegerAndError struct { + value *IntegerAndError + isSet bool +} + +func (v NullableIntegerAndError) Get() *IntegerAndError { + return v.value +} + +func (v *NullableIntegerAndError) Set(val *IntegerAndError) { + v.value = val + v.isSet = true +} + +func (v NullableIntegerAndError) IsSet() bool { + return v.isSet +} + +func (v *NullableIntegerAndError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntegerAndError(val *IntegerAndError) *NullableIntegerAndError { + return &NullableIntegerAndError{value: val, isSet: true} +} + +func (v NullableIntegerAndError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntegerAndError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_kubernetes_container.go b/pkg/paastaapi/model_kubernetes_container.go new file mode 100644 index 0000000..60c6a10 --- /dev/null +++ b/pkg/paastaapi/model_kubernetes_container.go @@ -0,0 +1,151 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// KubernetesContainer struct for KubernetesContainer +type KubernetesContainer struct { + // Name of the container + Name *string `json:"name,omitempty"` + TailLines *TaskTailLines `json:"tail_lines,omitempty"` +} + +// NewKubernetesContainer instantiates a new KubernetesContainer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesContainer() *KubernetesContainer { + this := KubernetesContainer{} + return &this +} + +// NewKubernetesContainerWithDefaults instantiates a new KubernetesContainer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesContainerWithDefaults() *KubernetesContainer { + this := KubernetesContainer{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *KubernetesContainer) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesContainer) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *KubernetesContainer) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *KubernetesContainer) SetName(v string) { + o.Name = &v +} + +// GetTailLines returns the TailLines field value if set, zero value otherwise. +func (o *KubernetesContainer) GetTailLines() TaskTailLines { + if o == nil || o.TailLines == nil { + var ret TaskTailLines + return ret + } + return *o.TailLines +} + +// GetTailLinesOk returns a tuple with the TailLines field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesContainer) GetTailLinesOk() (*TaskTailLines, bool) { + if o == nil || o.TailLines == nil { + return nil, false + } + return o.TailLines, true +} + +// HasTailLines returns a boolean if a field has been set. +func (o *KubernetesContainer) HasTailLines() bool { + if o != nil && o.TailLines != nil { + return true + } + + return false +} + +// SetTailLines gets a reference to the given TaskTailLines and assigns it to the TailLines field. +func (o *KubernetesContainer) SetTailLines(v TaskTailLines) { + o.TailLines = &v +} + +func (o KubernetesContainer) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.TailLines != nil { + toSerialize["tail_lines"] = o.TailLines + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesContainer struct { + value *KubernetesContainer + isSet bool +} + +func (v NullableKubernetesContainer) Get() *KubernetesContainer { + return v.value +} + +func (v *NullableKubernetesContainer) Set(val *KubernetesContainer) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesContainer) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesContainer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesContainer(val *KubernetesContainer) *NullableKubernetesContainer { + return &NullableKubernetesContainer{value: val, isSet: true} +} + +func (v NullableKubernetesContainer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesContainer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_kubernetes_pod.go b/pkg/paastaapi/model_kubernetes_pod.go new file mode 100644 index 0000000..6717e31 --- /dev/null +++ b/pkg/paastaapi/model_kubernetes_pod.go @@ -0,0 +1,393 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// KubernetesPod struct for KubernetesPod +type KubernetesPod struct { + Containers *[]KubernetesContainer `json:"containers,omitempty"` + // Time at which the pod was deployed + DeployedTimestamp *float32 `json:"deployed_timestamp,omitempty"` + // name of the pod's host + Host *string `json:"host,omitempty"` + // long message explaining the pod's state + Message NullableString `json:"message,omitempty"` + // name of the pod in Kubernetes + Name *string `json:"name,omitempty"` + // The status of the pod + Phase *string `json:"phase,omitempty"` + // Whether or not the pod is ready (i.e. all containers up) + Ready *bool `json:"ready,omitempty"` + // short message explaining the pod's state + Reason NullableString `json:"reason,omitempty"` +} + +// NewKubernetesPod instantiates a new KubernetesPod object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesPod() *KubernetesPod { + this := KubernetesPod{} + return &this +} + +// NewKubernetesPodWithDefaults instantiates a new KubernetesPod object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesPodWithDefaults() *KubernetesPod { + this := KubernetesPod{} + return &this +} + +// GetContainers returns the Containers field value if set, zero value otherwise. +func (o *KubernetesPod) GetContainers() []KubernetesContainer { + if o == nil || o.Containers == nil { + var ret []KubernetesContainer + return ret + } + return *o.Containers +} + +// GetContainersOk returns a tuple with the Containers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesPod) GetContainersOk() (*[]KubernetesContainer, bool) { + if o == nil || o.Containers == nil { + return nil, false + } + return o.Containers, true +} + +// HasContainers returns a boolean if a field has been set. +func (o *KubernetesPod) HasContainers() bool { + if o != nil && o.Containers != nil { + return true + } + + return false +} + +// SetContainers gets a reference to the given []KubernetesContainer and assigns it to the Containers field. +func (o *KubernetesPod) SetContainers(v []KubernetesContainer) { + o.Containers = &v +} + +// GetDeployedTimestamp returns the DeployedTimestamp field value if set, zero value otherwise. +func (o *KubernetesPod) GetDeployedTimestamp() float32 { + if o == nil || o.DeployedTimestamp == nil { + var ret float32 + return ret + } + return *o.DeployedTimestamp +} + +// GetDeployedTimestampOk returns a tuple with the DeployedTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesPod) GetDeployedTimestampOk() (*float32, bool) { + if o == nil || o.DeployedTimestamp == nil { + return nil, false + } + return o.DeployedTimestamp, true +} + +// HasDeployedTimestamp returns a boolean if a field has been set. +func (o *KubernetesPod) HasDeployedTimestamp() bool { + if o != nil && o.DeployedTimestamp != nil { + return true + } + + return false +} + +// SetDeployedTimestamp gets a reference to the given float32 and assigns it to the DeployedTimestamp field. +func (o *KubernetesPod) SetDeployedTimestamp(v float32) { + o.DeployedTimestamp = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *KubernetesPod) GetHost() string { + if o == nil || o.Host == nil { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesPod) GetHostOk() (*string, bool) { + if o == nil || o.Host == nil { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *KubernetesPod) HasHost() bool { + if o != nil && o.Host != nil { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *KubernetesPod) SetHost(v string) { + o.Host = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KubernetesPod) GetMessage() string { + if o == nil || o.Message.Get() == nil { + var ret string + return ret + } + return *o.Message.Get() +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesPod) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Message.Get(), o.Message.IsSet() +} + +// HasMessage returns a boolean if a field has been set. +func (o *KubernetesPod) HasMessage() bool { + if o != nil && o.Message.IsSet() { + return true + } + + return false +} + +// SetMessage gets a reference to the given NullableString and assigns it to the Message field. +func (o *KubernetesPod) SetMessage(v string) { + o.Message.Set(&v) +} +// SetMessageNil sets the value for Message to be an explicit nil +func (o *KubernetesPod) SetMessageNil() { + o.Message.Set(nil) +} + +// UnsetMessage ensures that no value is present for Message, not even an explicit nil +func (o *KubernetesPod) UnsetMessage() { + o.Message.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *KubernetesPod) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesPod) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *KubernetesPod) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *KubernetesPod) SetName(v string) { + o.Name = &v +} + +// GetPhase returns the Phase field value if set, zero value otherwise. +func (o *KubernetesPod) GetPhase() string { + if o == nil || o.Phase == nil { + var ret string + return ret + } + return *o.Phase +} + +// GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesPod) GetPhaseOk() (*string, bool) { + if o == nil || o.Phase == nil { + return nil, false + } + return o.Phase, true +} + +// HasPhase returns a boolean if a field has been set. +func (o *KubernetesPod) HasPhase() bool { + if o != nil && o.Phase != nil { + return true + } + + return false +} + +// SetPhase gets a reference to the given string and assigns it to the Phase field. +func (o *KubernetesPod) SetPhase(v string) { + o.Phase = &v +} + +// GetReady returns the Ready field value if set, zero value otherwise. +func (o *KubernetesPod) GetReady() bool { + if o == nil || o.Ready == nil { + var ret bool + return ret + } + return *o.Ready +} + +// GetReadyOk returns a tuple with the Ready field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesPod) GetReadyOk() (*bool, bool) { + if o == nil || o.Ready == nil { + return nil, false + } + return o.Ready, true +} + +// HasReady returns a boolean if a field has been set. +func (o *KubernetesPod) HasReady() bool { + if o != nil && o.Ready != nil { + return true + } + + return false +} + +// SetReady gets a reference to the given bool and assigns it to the Ready field. +func (o *KubernetesPod) SetReady(v bool) { + o.Ready = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KubernetesPod) GetReason() string { + if o == nil || o.Reason.Get() == nil { + var ret string + return ret + } + return *o.Reason.Get() +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KubernetesPod) GetReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Reason.Get(), o.Reason.IsSet() +} + +// HasReason returns a boolean if a field has been set. +func (o *KubernetesPod) HasReason() bool { + if o != nil && o.Reason.IsSet() { + return true + } + + return false +} + +// SetReason gets a reference to the given NullableString and assigns it to the Reason field. +func (o *KubernetesPod) SetReason(v string) { + o.Reason.Set(&v) +} +// SetReasonNil sets the value for Reason to be an explicit nil +func (o *KubernetesPod) SetReasonNil() { + o.Reason.Set(nil) +} + +// UnsetReason ensures that no value is present for Reason, not even an explicit nil +func (o *KubernetesPod) UnsetReason() { + o.Reason.Unset() +} + +func (o KubernetesPod) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Containers != nil { + toSerialize["containers"] = o.Containers + } + if o.DeployedTimestamp != nil { + toSerialize["deployed_timestamp"] = o.DeployedTimestamp + } + if o.Host != nil { + toSerialize["host"] = o.Host + } + if o.Message.IsSet() { + toSerialize["message"] = o.Message.Get() + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Phase != nil { + toSerialize["phase"] = o.Phase + } + if o.Ready != nil { + toSerialize["ready"] = o.Ready + } + if o.Reason.IsSet() { + toSerialize["reason"] = o.Reason.Get() + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesPod struct { + value *KubernetesPod + isSet bool +} + +func (v NullableKubernetesPod) Get() *KubernetesPod { + return v.value +} + +func (v *NullableKubernetesPod) Set(val *KubernetesPod) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesPod) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesPod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesPod(val *KubernetesPod) *NullableKubernetesPod { + return &NullableKubernetesPod{value: val, isSet: true} +} + +func (v NullableKubernetesPod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesPod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_kubernetes_replica_set.go b/pkg/paastaapi/model_kubernetes_replica_set.go new file mode 100644 index 0000000..696cf52 --- /dev/null +++ b/pkg/paastaapi/model_kubernetes_replica_set.go @@ -0,0 +1,226 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// KubernetesReplicaSet struct for KubernetesReplicaSet +type KubernetesReplicaSet struct { + // Time at which the replicaset was created + CreateTimestamp *float32 `json:"create_timestamp,omitempty"` + // name of the replicaset in Kubernetes + Name *string `json:"name,omitempty"` + // number of ready replicas for the replicaset + ReadyReplicas *int32 `json:"ready_replicas,omitempty"` + // number of desired replicas for the replicaset + Replicas *int32 `json:"replicas,omitempty"` +} + +// NewKubernetesReplicaSet instantiates a new KubernetesReplicaSet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesReplicaSet() *KubernetesReplicaSet { + this := KubernetesReplicaSet{} + return &this +} + +// NewKubernetesReplicaSetWithDefaults instantiates a new KubernetesReplicaSet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesReplicaSetWithDefaults() *KubernetesReplicaSet { + this := KubernetesReplicaSet{} + return &this +} + +// GetCreateTimestamp returns the CreateTimestamp field value if set, zero value otherwise. +func (o *KubernetesReplicaSet) GetCreateTimestamp() float32 { + if o == nil || o.CreateTimestamp == nil { + var ret float32 + return ret + } + return *o.CreateTimestamp +} + +// GetCreateTimestampOk returns a tuple with the CreateTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesReplicaSet) GetCreateTimestampOk() (*float32, bool) { + if o == nil || o.CreateTimestamp == nil { + return nil, false + } + return o.CreateTimestamp, true +} + +// HasCreateTimestamp returns a boolean if a field has been set. +func (o *KubernetesReplicaSet) HasCreateTimestamp() bool { + if o != nil && o.CreateTimestamp != nil { + return true + } + + return false +} + +// SetCreateTimestamp gets a reference to the given float32 and assigns it to the CreateTimestamp field. +func (o *KubernetesReplicaSet) SetCreateTimestamp(v float32) { + o.CreateTimestamp = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *KubernetesReplicaSet) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesReplicaSet) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *KubernetesReplicaSet) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *KubernetesReplicaSet) SetName(v string) { + o.Name = &v +} + +// GetReadyReplicas returns the ReadyReplicas field value if set, zero value otherwise. +func (o *KubernetesReplicaSet) GetReadyReplicas() int32 { + if o == nil || o.ReadyReplicas == nil { + var ret int32 + return ret + } + return *o.ReadyReplicas +} + +// GetReadyReplicasOk returns a tuple with the ReadyReplicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesReplicaSet) GetReadyReplicasOk() (*int32, bool) { + if o == nil || o.ReadyReplicas == nil { + return nil, false + } + return o.ReadyReplicas, true +} + +// HasReadyReplicas returns a boolean if a field has been set. +func (o *KubernetesReplicaSet) HasReadyReplicas() bool { + if o != nil && o.ReadyReplicas != nil { + return true + } + + return false +} + +// SetReadyReplicas gets a reference to the given int32 and assigns it to the ReadyReplicas field. +func (o *KubernetesReplicaSet) SetReadyReplicas(v int32) { + o.ReadyReplicas = &v +} + +// GetReplicas returns the Replicas field value if set, zero value otherwise. +func (o *KubernetesReplicaSet) GetReplicas() int32 { + if o == nil || o.Replicas == nil { + var ret int32 + return ret + } + return *o.Replicas +} + +// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesReplicaSet) GetReplicasOk() (*int32, bool) { + if o == nil || o.Replicas == nil { + return nil, false + } + return o.Replicas, true +} + +// HasReplicas returns a boolean if a field has been set. +func (o *KubernetesReplicaSet) HasReplicas() bool { + if o != nil && o.Replicas != nil { + return true + } + + return false +} + +// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. +func (o *KubernetesReplicaSet) SetReplicas(v int32) { + o.Replicas = &v +} + +func (o KubernetesReplicaSet) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CreateTimestamp != nil { + toSerialize["create_timestamp"] = o.CreateTimestamp + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.ReadyReplicas != nil { + toSerialize["ready_replicas"] = o.ReadyReplicas + } + if o.Replicas != nil { + toSerialize["replicas"] = o.Replicas + } + return json.Marshal(toSerialize) +} + +type NullableKubernetesReplicaSet struct { + value *KubernetesReplicaSet + isSet bool +} + +func (v NullableKubernetesReplicaSet) Get() *KubernetesReplicaSet { + return v.value +} + +func (v *NullableKubernetesReplicaSet) Set(val *KubernetesReplicaSet) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesReplicaSet) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesReplicaSet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesReplicaSet(val *KubernetesReplicaSet) *NullableKubernetesReplicaSet { + return &NullableKubernetesReplicaSet{value: val, isSet: true} +} + +func (v NullableKubernetesReplicaSet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesReplicaSet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_marathon_app_status.go b/pkg/paastaapi/model_marathon_app_status.go new file mode 100644 index 0000000..065a7cd --- /dev/null +++ b/pkg/paastaapi/model_marathon_app_status.go @@ -0,0 +1,448 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// MarathonAppStatus struct for MarathonAppStatus +type MarathonAppStatus struct { + // Backoff in seconds before launching next task + BackoffSeconds *int32 `json:"backoff_seconds,omitempty"` + // Unix timestamp when this app was created + CreateTimestamp *float32 `json:"create_timestamp,omitempty"` + // Marathon dashboard URL for this app + DashboardUrl *string `json:"dashboard_url,omitempty"` + // Deploy status of this app + DeployStatus *string `json:"deploy_status,omitempty"` + // Tasks associated to this app + Tasks *[]MarathonTask `json:"tasks,omitempty"` + // Number of healthy tasks for this app + TasksHealthy *int32 `json:"tasks_healthy,omitempty"` + // Number running tasks for this app + TasksRunning *int32 `json:"tasks_running,omitempty"` + // Number of staged tasks for this app + TasksStaged *int32 `json:"tasks_staged,omitempty"` + // Total number of tasks for this app + TasksTotal *int32 `json:"tasks_total,omitempty"` + // Mapping of reason offer was refused to the number of times that type of refusal was seen + UnusedOfferReasonCounts *map[string]interface{} `json:"unused_offer_reason_counts,omitempty"` +} + +// NewMarathonAppStatus instantiates a new MarathonAppStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMarathonAppStatus() *MarathonAppStatus { + this := MarathonAppStatus{} + return &this +} + +// NewMarathonAppStatusWithDefaults instantiates a new MarathonAppStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMarathonAppStatusWithDefaults() *MarathonAppStatus { + this := MarathonAppStatus{} + return &this +} + +// GetBackoffSeconds returns the BackoffSeconds field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetBackoffSeconds() int32 { + if o == nil || o.BackoffSeconds == nil { + var ret int32 + return ret + } + return *o.BackoffSeconds +} + +// GetBackoffSecondsOk returns a tuple with the BackoffSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetBackoffSecondsOk() (*int32, bool) { + if o == nil || o.BackoffSeconds == nil { + return nil, false + } + return o.BackoffSeconds, true +} + +// HasBackoffSeconds returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasBackoffSeconds() bool { + if o != nil && o.BackoffSeconds != nil { + return true + } + + return false +} + +// SetBackoffSeconds gets a reference to the given int32 and assigns it to the BackoffSeconds field. +func (o *MarathonAppStatus) SetBackoffSeconds(v int32) { + o.BackoffSeconds = &v +} + +// GetCreateTimestamp returns the CreateTimestamp field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetCreateTimestamp() float32 { + if o == nil || o.CreateTimestamp == nil { + var ret float32 + return ret + } + return *o.CreateTimestamp +} + +// GetCreateTimestampOk returns a tuple with the CreateTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetCreateTimestampOk() (*float32, bool) { + if o == nil || o.CreateTimestamp == nil { + return nil, false + } + return o.CreateTimestamp, true +} + +// HasCreateTimestamp returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasCreateTimestamp() bool { + if o != nil && o.CreateTimestamp != nil { + return true + } + + return false +} + +// SetCreateTimestamp gets a reference to the given float32 and assigns it to the CreateTimestamp field. +func (o *MarathonAppStatus) SetCreateTimestamp(v float32) { + o.CreateTimestamp = &v +} + +// GetDashboardUrl returns the DashboardUrl field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetDashboardUrl() string { + if o == nil || o.DashboardUrl == nil { + var ret string + return ret + } + return *o.DashboardUrl +} + +// GetDashboardUrlOk returns a tuple with the DashboardUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetDashboardUrlOk() (*string, bool) { + if o == nil || o.DashboardUrl == nil { + return nil, false + } + return o.DashboardUrl, true +} + +// HasDashboardUrl returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasDashboardUrl() bool { + if o != nil && o.DashboardUrl != nil { + return true + } + + return false +} + +// SetDashboardUrl gets a reference to the given string and assigns it to the DashboardUrl field. +func (o *MarathonAppStatus) SetDashboardUrl(v string) { + o.DashboardUrl = &v +} + +// GetDeployStatus returns the DeployStatus field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetDeployStatus() string { + if o == nil || o.DeployStatus == nil { + var ret string + return ret + } + return *o.DeployStatus +} + +// GetDeployStatusOk returns a tuple with the DeployStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetDeployStatusOk() (*string, bool) { + if o == nil || o.DeployStatus == nil { + return nil, false + } + return o.DeployStatus, true +} + +// HasDeployStatus returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasDeployStatus() bool { + if o != nil && o.DeployStatus != nil { + return true + } + + return false +} + +// SetDeployStatus gets a reference to the given string and assigns it to the DeployStatus field. +func (o *MarathonAppStatus) SetDeployStatus(v string) { + o.DeployStatus = &v +} + +// GetTasks returns the Tasks field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetTasks() []MarathonTask { + if o == nil || o.Tasks == nil { + var ret []MarathonTask + return ret + } + return *o.Tasks +} + +// GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetTasksOk() (*[]MarathonTask, bool) { + if o == nil || o.Tasks == nil { + return nil, false + } + return o.Tasks, true +} + +// HasTasks returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasTasks() bool { + if o != nil && o.Tasks != nil { + return true + } + + return false +} + +// SetTasks gets a reference to the given []MarathonTask and assigns it to the Tasks field. +func (o *MarathonAppStatus) SetTasks(v []MarathonTask) { + o.Tasks = &v +} + +// GetTasksHealthy returns the TasksHealthy field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetTasksHealthy() int32 { + if o == nil || o.TasksHealthy == nil { + var ret int32 + return ret + } + return *o.TasksHealthy +} + +// GetTasksHealthyOk returns a tuple with the TasksHealthy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetTasksHealthyOk() (*int32, bool) { + if o == nil || o.TasksHealthy == nil { + return nil, false + } + return o.TasksHealthy, true +} + +// HasTasksHealthy returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasTasksHealthy() bool { + if o != nil && o.TasksHealthy != nil { + return true + } + + return false +} + +// SetTasksHealthy gets a reference to the given int32 and assigns it to the TasksHealthy field. +func (o *MarathonAppStatus) SetTasksHealthy(v int32) { + o.TasksHealthy = &v +} + +// GetTasksRunning returns the TasksRunning field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetTasksRunning() int32 { + if o == nil || o.TasksRunning == nil { + var ret int32 + return ret + } + return *o.TasksRunning +} + +// GetTasksRunningOk returns a tuple with the TasksRunning field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetTasksRunningOk() (*int32, bool) { + if o == nil || o.TasksRunning == nil { + return nil, false + } + return o.TasksRunning, true +} + +// HasTasksRunning returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasTasksRunning() bool { + if o != nil && o.TasksRunning != nil { + return true + } + + return false +} + +// SetTasksRunning gets a reference to the given int32 and assigns it to the TasksRunning field. +func (o *MarathonAppStatus) SetTasksRunning(v int32) { + o.TasksRunning = &v +} + +// GetTasksStaged returns the TasksStaged field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetTasksStaged() int32 { + if o == nil || o.TasksStaged == nil { + var ret int32 + return ret + } + return *o.TasksStaged +} + +// GetTasksStagedOk returns a tuple with the TasksStaged field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetTasksStagedOk() (*int32, bool) { + if o == nil || o.TasksStaged == nil { + return nil, false + } + return o.TasksStaged, true +} + +// HasTasksStaged returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasTasksStaged() bool { + if o != nil && o.TasksStaged != nil { + return true + } + + return false +} + +// SetTasksStaged gets a reference to the given int32 and assigns it to the TasksStaged field. +func (o *MarathonAppStatus) SetTasksStaged(v int32) { + o.TasksStaged = &v +} + +// GetTasksTotal returns the TasksTotal field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetTasksTotal() int32 { + if o == nil || o.TasksTotal == nil { + var ret int32 + return ret + } + return *o.TasksTotal +} + +// GetTasksTotalOk returns a tuple with the TasksTotal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetTasksTotalOk() (*int32, bool) { + if o == nil || o.TasksTotal == nil { + return nil, false + } + return o.TasksTotal, true +} + +// HasTasksTotal returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasTasksTotal() bool { + if o != nil && o.TasksTotal != nil { + return true + } + + return false +} + +// SetTasksTotal gets a reference to the given int32 and assigns it to the TasksTotal field. +func (o *MarathonAppStatus) SetTasksTotal(v int32) { + o.TasksTotal = &v +} + +// GetUnusedOfferReasonCounts returns the UnusedOfferReasonCounts field value if set, zero value otherwise. +func (o *MarathonAppStatus) GetUnusedOfferReasonCounts() map[string]interface{} { + if o == nil || o.UnusedOfferReasonCounts == nil { + var ret map[string]interface{} + return ret + } + return *o.UnusedOfferReasonCounts +} + +// GetUnusedOfferReasonCountsOk returns a tuple with the UnusedOfferReasonCounts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAppStatus) GetUnusedOfferReasonCountsOk() (*map[string]interface{}, bool) { + if o == nil || o.UnusedOfferReasonCounts == nil { + return nil, false + } + return o.UnusedOfferReasonCounts, true +} + +// HasUnusedOfferReasonCounts returns a boolean if a field has been set. +func (o *MarathonAppStatus) HasUnusedOfferReasonCounts() bool { + if o != nil && o.UnusedOfferReasonCounts != nil { + return true + } + + return false +} + +// SetUnusedOfferReasonCounts gets a reference to the given map[string]interface{} and assigns it to the UnusedOfferReasonCounts field. +func (o *MarathonAppStatus) SetUnusedOfferReasonCounts(v map[string]interface{}) { + o.UnusedOfferReasonCounts = &v +} + +func (o MarathonAppStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.BackoffSeconds != nil { + toSerialize["backoff_seconds"] = o.BackoffSeconds + } + if o.CreateTimestamp != nil { + toSerialize["create_timestamp"] = o.CreateTimestamp + } + if o.DashboardUrl != nil { + toSerialize["dashboard_url"] = o.DashboardUrl + } + if o.DeployStatus != nil { + toSerialize["deploy_status"] = o.DeployStatus + } + if o.Tasks != nil { + toSerialize["tasks"] = o.Tasks + } + if o.TasksHealthy != nil { + toSerialize["tasks_healthy"] = o.TasksHealthy + } + if o.TasksRunning != nil { + toSerialize["tasks_running"] = o.TasksRunning + } + if o.TasksStaged != nil { + toSerialize["tasks_staged"] = o.TasksStaged + } + if o.TasksTotal != nil { + toSerialize["tasks_total"] = o.TasksTotal + } + if o.UnusedOfferReasonCounts != nil { + toSerialize["unused_offer_reason_counts"] = o.UnusedOfferReasonCounts + } + return json.Marshal(toSerialize) +} + +type NullableMarathonAppStatus struct { + value *MarathonAppStatus + isSet bool +} + +func (v NullableMarathonAppStatus) Get() *MarathonAppStatus { + return v.value +} + +func (v *NullableMarathonAppStatus) Set(val *MarathonAppStatus) { + v.value = val + v.isSet = true +} + +func (v NullableMarathonAppStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableMarathonAppStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMarathonAppStatus(val *MarathonAppStatus) *NullableMarathonAppStatus { + return &NullableMarathonAppStatus{value: val, isSet: true} +} + +func (v NullableMarathonAppStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMarathonAppStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_marathon_autoscaling_info.go b/pkg/paastaapi/model_marathon_autoscaling_info.go new file mode 100644 index 0000000..0a11bd1 --- /dev/null +++ b/pkg/paastaapi/model_marathon_autoscaling_info.go @@ -0,0 +1,263 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// MarathonAutoscalingInfo struct for MarathonAutoscalingInfo +type MarathonAutoscalingInfo struct { + // The number of instances of the service currently running + CurrentInstances *int32 `json:"current_instances,omitempty"` + // The current utilization of the instances' allocated resources + CurrentUtilization *float32 `json:"current_utilization,omitempty"` + // The maximum number of instances that the autoscaler will scale to + MaxInstances *int32 `json:"max_instances,omitempty"` + // The minimum number of instances that the autoscaler will scale to + MinInstances *int32 `json:"min_instances,omitempty"` + // The autoscaler's current target number of instances of this service to run + TargetInstances *int32 `json:"target_instances,omitempty"` +} + +// NewMarathonAutoscalingInfo instantiates a new MarathonAutoscalingInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMarathonAutoscalingInfo() *MarathonAutoscalingInfo { + this := MarathonAutoscalingInfo{} + return &this +} + +// NewMarathonAutoscalingInfoWithDefaults instantiates a new MarathonAutoscalingInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMarathonAutoscalingInfoWithDefaults() *MarathonAutoscalingInfo { + this := MarathonAutoscalingInfo{} + return &this +} + +// GetCurrentInstances returns the CurrentInstances field value if set, zero value otherwise. +func (o *MarathonAutoscalingInfo) GetCurrentInstances() int32 { + if o == nil || o.CurrentInstances == nil { + var ret int32 + return ret + } + return *o.CurrentInstances +} + +// GetCurrentInstancesOk returns a tuple with the CurrentInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAutoscalingInfo) GetCurrentInstancesOk() (*int32, bool) { + if o == nil || o.CurrentInstances == nil { + return nil, false + } + return o.CurrentInstances, true +} + +// HasCurrentInstances returns a boolean if a field has been set. +func (o *MarathonAutoscalingInfo) HasCurrentInstances() bool { + if o != nil && o.CurrentInstances != nil { + return true + } + + return false +} + +// SetCurrentInstances gets a reference to the given int32 and assigns it to the CurrentInstances field. +func (o *MarathonAutoscalingInfo) SetCurrentInstances(v int32) { + o.CurrentInstances = &v +} + +// GetCurrentUtilization returns the CurrentUtilization field value if set, zero value otherwise. +func (o *MarathonAutoscalingInfo) GetCurrentUtilization() float32 { + if o == nil || o.CurrentUtilization == nil { + var ret float32 + return ret + } + return *o.CurrentUtilization +} + +// GetCurrentUtilizationOk returns a tuple with the CurrentUtilization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAutoscalingInfo) GetCurrentUtilizationOk() (*float32, bool) { + if o == nil || o.CurrentUtilization == nil { + return nil, false + } + return o.CurrentUtilization, true +} + +// HasCurrentUtilization returns a boolean if a field has been set. +func (o *MarathonAutoscalingInfo) HasCurrentUtilization() bool { + if o != nil && o.CurrentUtilization != nil { + return true + } + + return false +} + +// SetCurrentUtilization gets a reference to the given float32 and assigns it to the CurrentUtilization field. +func (o *MarathonAutoscalingInfo) SetCurrentUtilization(v float32) { + o.CurrentUtilization = &v +} + +// GetMaxInstances returns the MaxInstances field value if set, zero value otherwise. +func (o *MarathonAutoscalingInfo) GetMaxInstances() int32 { + if o == nil || o.MaxInstances == nil { + var ret int32 + return ret + } + return *o.MaxInstances +} + +// GetMaxInstancesOk returns a tuple with the MaxInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAutoscalingInfo) GetMaxInstancesOk() (*int32, bool) { + if o == nil || o.MaxInstances == nil { + return nil, false + } + return o.MaxInstances, true +} + +// HasMaxInstances returns a boolean if a field has been set. +func (o *MarathonAutoscalingInfo) HasMaxInstances() bool { + if o != nil && o.MaxInstances != nil { + return true + } + + return false +} + +// SetMaxInstances gets a reference to the given int32 and assigns it to the MaxInstances field. +func (o *MarathonAutoscalingInfo) SetMaxInstances(v int32) { + o.MaxInstances = &v +} + +// GetMinInstances returns the MinInstances field value if set, zero value otherwise. +func (o *MarathonAutoscalingInfo) GetMinInstances() int32 { + if o == nil || o.MinInstances == nil { + var ret int32 + return ret + } + return *o.MinInstances +} + +// GetMinInstancesOk returns a tuple with the MinInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAutoscalingInfo) GetMinInstancesOk() (*int32, bool) { + if o == nil || o.MinInstances == nil { + return nil, false + } + return o.MinInstances, true +} + +// HasMinInstances returns a boolean if a field has been set. +func (o *MarathonAutoscalingInfo) HasMinInstances() bool { + if o != nil && o.MinInstances != nil { + return true + } + + return false +} + +// SetMinInstances gets a reference to the given int32 and assigns it to the MinInstances field. +func (o *MarathonAutoscalingInfo) SetMinInstances(v int32) { + o.MinInstances = &v +} + +// GetTargetInstances returns the TargetInstances field value if set, zero value otherwise. +func (o *MarathonAutoscalingInfo) GetTargetInstances() int32 { + if o == nil || o.TargetInstances == nil { + var ret int32 + return ret + } + return *o.TargetInstances +} + +// GetTargetInstancesOk returns a tuple with the TargetInstances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonAutoscalingInfo) GetTargetInstancesOk() (*int32, bool) { + if o == nil || o.TargetInstances == nil { + return nil, false + } + return o.TargetInstances, true +} + +// HasTargetInstances returns a boolean if a field has been set. +func (o *MarathonAutoscalingInfo) HasTargetInstances() bool { + if o != nil && o.TargetInstances != nil { + return true + } + + return false +} + +// SetTargetInstances gets a reference to the given int32 and assigns it to the TargetInstances field. +func (o *MarathonAutoscalingInfo) SetTargetInstances(v int32) { + o.TargetInstances = &v +} + +func (o MarathonAutoscalingInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CurrentInstances != nil { + toSerialize["current_instances"] = o.CurrentInstances + } + if o.CurrentUtilization != nil { + toSerialize["current_utilization"] = o.CurrentUtilization + } + if o.MaxInstances != nil { + toSerialize["max_instances"] = o.MaxInstances + } + if o.MinInstances != nil { + toSerialize["min_instances"] = o.MinInstances + } + if o.TargetInstances != nil { + toSerialize["target_instances"] = o.TargetInstances + } + return json.Marshal(toSerialize) +} + +type NullableMarathonAutoscalingInfo struct { + value *MarathonAutoscalingInfo + isSet bool +} + +func (v NullableMarathonAutoscalingInfo) Get() *MarathonAutoscalingInfo { + return v.value +} + +func (v *NullableMarathonAutoscalingInfo) Set(val *MarathonAutoscalingInfo) { + v.value = val + v.isSet = true +} + +func (v NullableMarathonAutoscalingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableMarathonAutoscalingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMarathonAutoscalingInfo(val *MarathonAutoscalingInfo) *NullableMarathonAutoscalingInfo { + return &NullableMarathonAutoscalingInfo{value: val, isSet: true} +} + +func (v NullableMarathonAutoscalingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMarathonAutoscalingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_marathon_dashboard_item.go b/pkg/paastaapi/model_marathon_dashboard_item.go new file mode 100644 index 0000000..9422a0e --- /dev/null +++ b/pkg/paastaapi/model_marathon_dashboard_item.go @@ -0,0 +1,189 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// MarathonDashboardItem Marathon service, instance, and shard url +type MarathonDashboardItem struct { + // Instance name + Instance *string `json:"instance,omitempty"` + // Service name + Service *string `json:"service,omitempty"` + // Marathon Shard URL + ShardUrl *string `json:"shard_url,omitempty"` +} + +// NewMarathonDashboardItem instantiates a new MarathonDashboardItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMarathonDashboardItem() *MarathonDashboardItem { + this := MarathonDashboardItem{} + return &this +} + +// NewMarathonDashboardItemWithDefaults instantiates a new MarathonDashboardItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMarathonDashboardItemWithDefaults() *MarathonDashboardItem { + this := MarathonDashboardItem{} + return &this +} + +// GetInstance returns the Instance field value if set, zero value otherwise. +func (o *MarathonDashboardItem) GetInstance() string { + if o == nil || o.Instance == nil { + var ret string + return ret + } + return *o.Instance +} + +// GetInstanceOk returns a tuple with the Instance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonDashboardItem) GetInstanceOk() (*string, bool) { + if o == nil || o.Instance == nil { + return nil, false + } + return o.Instance, true +} + +// HasInstance returns a boolean if a field has been set. +func (o *MarathonDashboardItem) HasInstance() bool { + if o != nil && o.Instance != nil { + return true + } + + return false +} + +// SetInstance gets a reference to the given string and assigns it to the Instance field. +func (o *MarathonDashboardItem) SetInstance(v string) { + o.Instance = &v +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *MarathonDashboardItem) GetService() string { + if o == nil || o.Service == nil { + var ret string + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonDashboardItem) GetServiceOk() (*string, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *MarathonDashboardItem) HasService() bool { + if o != nil && o.Service != nil { + return true + } + + return false +} + +// SetService gets a reference to the given string and assigns it to the Service field. +func (o *MarathonDashboardItem) SetService(v string) { + o.Service = &v +} + +// GetShardUrl returns the ShardUrl field value if set, zero value otherwise. +func (o *MarathonDashboardItem) GetShardUrl() string { + if o == nil || o.ShardUrl == nil { + var ret string + return ret + } + return *o.ShardUrl +} + +// GetShardUrlOk returns a tuple with the ShardUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonDashboardItem) GetShardUrlOk() (*string, bool) { + if o == nil || o.ShardUrl == nil { + return nil, false + } + return o.ShardUrl, true +} + +// HasShardUrl returns a boolean if a field has been set. +func (o *MarathonDashboardItem) HasShardUrl() bool { + if o != nil && o.ShardUrl != nil { + return true + } + + return false +} + +// SetShardUrl gets a reference to the given string and assigns it to the ShardUrl field. +func (o *MarathonDashboardItem) SetShardUrl(v string) { + o.ShardUrl = &v +} + +func (o MarathonDashboardItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Instance != nil { + toSerialize["instance"] = o.Instance + } + if o.Service != nil { + toSerialize["service"] = o.Service + } + if o.ShardUrl != nil { + toSerialize["shard_url"] = o.ShardUrl + } + return json.Marshal(toSerialize) +} + +type NullableMarathonDashboardItem struct { + value *MarathonDashboardItem + isSet bool +} + +func (v NullableMarathonDashboardItem) Get() *MarathonDashboardItem { + return v.value +} + +func (v *NullableMarathonDashboardItem) Set(val *MarathonDashboardItem) { + v.value = val + v.isSet = true +} + +func (v NullableMarathonDashboardItem) IsSet() bool { + return v.isSet +} + +func (v *NullableMarathonDashboardItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMarathonDashboardItem(val *MarathonDashboardItem) *NullableMarathonDashboardItem { + return &NullableMarathonDashboardItem{value: val, isSet: true} +} + +func (v NullableMarathonDashboardItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMarathonDashboardItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_marathon_mesos_nonrunning_task.go b/pkg/paastaapi/model_marathon_mesos_nonrunning_task.go new file mode 100644 index 0000000..1d4877c --- /dev/null +++ b/pkg/paastaapi/model_marathon_mesos_nonrunning_task.go @@ -0,0 +1,262 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// MarathonMesosNonrunningTask struct for MarathonMesosNonrunningTask +type MarathonMesosNonrunningTask struct { + // The unix timestamp at which the task was deployed + DeployedTimestamp *float32 `json:"deployed_timestamp,omitempty"` + // Name of the Mesos agent on which this task is running + Hostname *string `json:"hostname,omitempty"` + // The ID of the task in Mesos + Id *string `json:"id,omitempty"` + // The current state of the task + State *string `json:"state,omitempty"` + TailLines *TaskTailLines `json:"tail_lines,omitempty"` +} + +// NewMarathonMesosNonrunningTask instantiates a new MarathonMesosNonrunningTask object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMarathonMesosNonrunningTask() *MarathonMesosNonrunningTask { + this := MarathonMesosNonrunningTask{} + return &this +} + +// NewMarathonMesosNonrunningTaskWithDefaults instantiates a new MarathonMesosNonrunningTask object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMarathonMesosNonrunningTaskWithDefaults() *MarathonMesosNonrunningTask { + this := MarathonMesosNonrunningTask{} + return &this +} + +// GetDeployedTimestamp returns the DeployedTimestamp field value if set, zero value otherwise. +func (o *MarathonMesosNonrunningTask) GetDeployedTimestamp() float32 { + if o == nil || o.DeployedTimestamp == nil { + var ret float32 + return ret + } + return *o.DeployedTimestamp +} + +// GetDeployedTimestampOk returns a tuple with the DeployedTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosNonrunningTask) GetDeployedTimestampOk() (*float32, bool) { + if o == nil || o.DeployedTimestamp == nil { + return nil, false + } + return o.DeployedTimestamp, true +} + +// HasDeployedTimestamp returns a boolean if a field has been set. +func (o *MarathonMesosNonrunningTask) HasDeployedTimestamp() bool { + if o != nil && o.DeployedTimestamp != nil { + return true + } + + return false +} + +// SetDeployedTimestamp gets a reference to the given float32 and assigns it to the DeployedTimestamp field. +func (o *MarathonMesosNonrunningTask) SetDeployedTimestamp(v float32) { + o.DeployedTimestamp = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *MarathonMesosNonrunningTask) GetHostname() string { + if o == nil || o.Hostname == nil { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosNonrunningTask) GetHostnameOk() (*string, bool) { + if o == nil || o.Hostname == nil { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *MarathonMesosNonrunningTask) HasHostname() bool { + if o != nil && o.Hostname != nil { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *MarathonMesosNonrunningTask) SetHostname(v string) { + o.Hostname = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MarathonMesosNonrunningTask) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosNonrunningTask) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MarathonMesosNonrunningTask) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MarathonMesosNonrunningTask) SetId(v string) { + o.Id = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *MarathonMesosNonrunningTask) GetState() string { + if o == nil || o.State == nil { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosNonrunningTask) GetStateOk() (*string, bool) { + if o == nil || o.State == nil { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *MarathonMesosNonrunningTask) HasState() bool { + if o != nil && o.State != nil { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *MarathonMesosNonrunningTask) SetState(v string) { + o.State = &v +} + +// GetTailLines returns the TailLines field value if set, zero value otherwise. +func (o *MarathonMesosNonrunningTask) GetTailLines() TaskTailLines { + if o == nil || o.TailLines == nil { + var ret TaskTailLines + return ret + } + return *o.TailLines +} + +// GetTailLinesOk returns a tuple with the TailLines field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosNonrunningTask) GetTailLinesOk() (*TaskTailLines, bool) { + if o == nil || o.TailLines == nil { + return nil, false + } + return o.TailLines, true +} + +// HasTailLines returns a boolean if a field has been set. +func (o *MarathonMesosNonrunningTask) HasTailLines() bool { + if o != nil && o.TailLines != nil { + return true + } + + return false +} + +// SetTailLines gets a reference to the given TaskTailLines and assigns it to the TailLines field. +func (o *MarathonMesosNonrunningTask) SetTailLines(v TaskTailLines) { + o.TailLines = &v +} + +func (o MarathonMesosNonrunningTask) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.DeployedTimestamp != nil { + toSerialize["deployed_timestamp"] = o.DeployedTimestamp + } + if o.Hostname != nil { + toSerialize["hostname"] = o.Hostname + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.State != nil { + toSerialize["state"] = o.State + } + if o.TailLines != nil { + toSerialize["tail_lines"] = o.TailLines + } + return json.Marshal(toSerialize) +} + +type NullableMarathonMesosNonrunningTask struct { + value *MarathonMesosNonrunningTask + isSet bool +} + +func (v NullableMarathonMesosNonrunningTask) Get() *MarathonMesosNonrunningTask { + return v.value +} + +func (v *NullableMarathonMesosNonrunningTask) Set(val *MarathonMesosNonrunningTask) { + v.value = val + v.isSet = true +} + +func (v NullableMarathonMesosNonrunningTask) IsSet() bool { + return v.isSet +} + +func (v *NullableMarathonMesosNonrunningTask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMarathonMesosNonrunningTask(val *MarathonMesosNonrunningTask) *NullableMarathonMesosNonrunningTask { + return &NullableMarathonMesosNonrunningTask{value: val, isSet: true} +} + +func (v NullableMarathonMesosNonrunningTask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMarathonMesosNonrunningTask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_marathon_mesos_running_task.go b/pkg/paastaapi/model_marathon_mesos_running_task.go new file mode 100644 index 0000000..9c47ad3 --- /dev/null +++ b/pkg/paastaapi/model_marathon_mesos_running_task.go @@ -0,0 +1,406 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// MarathonMesosRunningTask struct for MarathonMesosRunningTask +type MarathonMesosRunningTask struct { + CpuShares *FloatAndError `json:"cpu_shares,omitempty"` + CpuUsedSeconds *FloatAndError `json:"cpu_used_seconds,omitempty"` + // The unix timestamp at which the task was deployed + DeployedTimestamp *float32 `json:"deployed_timestamp,omitempty"` + // The duration over which the task has been running in seconds + DurationSeconds *int32 `json:"duration_seconds,omitempty"` + // Name of the Mesos agent on which this task is running + Hostname *string `json:"hostname,omitempty"` + // The ID of the task in Mesos + Id *string `json:"id,omitempty"` + MemLimit *IntegerAndError `json:"mem_limit,omitempty"` + Rss *IntegerAndError `json:"rss,omitempty"` + TailLines *TaskTailLines `json:"tail_lines,omitempty"` +} + +// NewMarathonMesosRunningTask instantiates a new MarathonMesosRunningTask object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMarathonMesosRunningTask() *MarathonMesosRunningTask { + this := MarathonMesosRunningTask{} + return &this +} + +// NewMarathonMesosRunningTaskWithDefaults instantiates a new MarathonMesosRunningTask object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMarathonMesosRunningTaskWithDefaults() *MarathonMesosRunningTask { + this := MarathonMesosRunningTask{} + return &this +} + +// GetCpuShares returns the CpuShares field value if set, zero value otherwise. +func (o *MarathonMesosRunningTask) GetCpuShares() FloatAndError { + if o == nil || o.CpuShares == nil { + var ret FloatAndError + return ret + } + return *o.CpuShares +} + +// GetCpuSharesOk returns a tuple with the CpuShares field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosRunningTask) GetCpuSharesOk() (*FloatAndError, bool) { + if o == nil || o.CpuShares == nil { + return nil, false + } + return o.CpuShares, true +} + +// HasCpuShares returns a boolean if a field has been set. +func (o *MarathonMesosRunningTask) HasCpuShares() bool { + if o != nil && o.CpuShares != nil { + return true + } + + return false +} + +// SetCpuShares gets a reference to the given FloatAndError and assigns it to the CpuShares field. +func (o *MarathonMesosRunningTask) SetCpuShares(v FloatAndError) { + o.CpuShares = &v +} + +// GetCpuUsedSeconds returns the CpuUsedSeconds field value if set, zero value otherwise. +func (o *MarathonMesosRunningTask) GetCpuUsedSeconds() FloatAndError { + if o == nil || o.CpuUsedSeconds == nil { + var ret FloatAndError + return ret + } + return *o.CpuUsedSeconds +} + +// GetCpuUsedSecondsOk returns a tuple with the CpuUsedSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosRunningTask) GetCpuUsedSecondsOk() (*FloatAndError, bool) { + if o == nil || o.CpuUsedSeconds == nil { + return nil, false + } + return o.CpuUsedSeconds, true +} + +// HasCpuUsedSeconds returns a boolean if a field has been set. +func (o *MarathonMesosRunningTask) HasCpuUsedSeconds() bool { + if o != nil && o.CpuUsedSeconds != nil { + return true + } + + return false +} + +// SetCpuUsedSeconds gets a reference to the given FloatAndError and assigns it to the CpuUsedSeconds field. +func (o *MarathonMesosRunningTask) SetCpuUsedSeconds(v FloatAndError) { + o.CpuUsedSeconds = &v +} + +// GetDeployedTimestamp returns the DeployedTimestamp field value if set, zero value otherwise. +func (o *MarathonMesosRunningTask) GetDeployedTimestamp() float32 { + if o == nil || o.DeployedTimestamp == nil { + var ret float32 + return ret + } + return *o.DeployedTimestamp +} + +// GetDeployedTimestampOk returns a tuple with the DeployedTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosRunningTask) GetDeployedTimestampOk() (*float32, bool) { + if o == nil || o.DeployedTimestamp == nil { + return nil, false + } + return o.DeployedTimestamp, true +} + +// HasDeployedTimestamp returns a boolean if a field has been set. +func (o *MarathonMesosRunningTask) HasDeployedTimestamp() bool { + if o != nil && o.DeployedTimestamp != nil { + return true + } + + return false +} + +// SetDeployedTimestamp gets a reference to the given float32 and assigns it to the DeployedTimestamp field. +func (o *MarathonMesosRunningTask) SetDeployedTimestamp(v float32) { + o.DeployedTimestamp = &v +} + +// GetDurationSeconds returns the DurationSeconds field value if set, zero value otherwise. +func (o *MarathonMesosRunningTask) GetDurationSeconds() int32 { + if o == nil || o.DurationSeconds == nil { + var ret int32 + return ret + } + return *o.DurationSeconds +} + +// GetDurationSecondsOk returns a tuple with the DurationSeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosRunningTask) GetDurationSecondsOk() (*int32, bool) { + if o == nil || o.DurationSeconds == nil { + return nil, false + } + return o.DurationSeconds, true +} + +// HasDurationSeconds returns a boolean if a field has been set. +func (o *MarathonMesosRunningTask) HasDurationSeconds() bool { + if o != nil && o.DurationSeconds != nil { + return true + } + + return false +} + +// SetDurationSeconds gets a reference to the given int32 and assigns it to the DurationSeconds field. +func (o *MarathonMesosRunningTask) SetDurationSeconds(v int32) { + o.DurationSeconds = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *MarathonMesosRunningTask) GetHostname() string { + if o == nil || o.Hostname == nil { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosRunningTask) GetHostnameOk() (*string, bool) { + if o == nil || o.Hostname == nil { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *MarathonMesosRunningTask) HasHostname() bool { + if o != nil && o.Hostname != nil { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *MarathonMesosRunningTask) SetHostname(v string) { + o.Hostname = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MarathonMesosRunningTask) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosRunningTask) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MarathonMesosRunningTask) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MarathonMesosRunningTask) SetId(v string) { + o.Id = &v +} + +// GetMemLimit returns the MemLimit field value if set, zero value otherwise. +func (o *MarathonMesosRunningTask) GetMemLimit() IntegerAndError { + if o == nil || o.MemLimit == nil { + var ret IntegerAndError + return ret + } + return *o.MemLimit +} + +// GetMemLimitOk returns a tuple with the MemLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosRunningTask) GetMemLimitOk() (*IntegerAndError, bool) { + if o == nil || o.MemLimit == nil { + return nil, false + } + return o.MemLimit, true +} + +// HasMemLimit returns a boolean if a field has been set. +func (o *MarathonMesosRunningTask) HasMemLimit() bool { + if o != nil && o.MemLimit != nil { + return true + } + + return false +} + +// SetMemLimit gets a reference to the given IntegerAndError and assigns it to the MemLimit field. +func (o *MarathonMesosRunningTask) SetMemLimit(v IntegerAndError) { + o.MemLimit = &v +} + +// GetRss returns the Rss field value if set, zero value otherwise. +func (o *MarathonMesosRunningTask) GetRss() IntegerAndError { + if o == nil || o.Rss == nil { + var ret IntegerAndError + return ret + } + return *o.Rss +} + +// GetRssOk returns a tuple with the Rss field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosRunningTask) GetRssOk() (*IntegerAndError, bool) { + if o == nil || o.Rss == nil { + return nil, false + } + return o.Rss, true +} + +// HasRss returns a boolean if a field has been set. +func (o *MarathonMesosRunningTask) HasRss() bool { + if o != nil && o.Rss != nil { + return true + } + + return false +} + +// SetRss gets a reference to the given IntegerAndError and assigns it to the Rss field. +func (o *MarathonMesosRunningTask) SetRss(v IntegerAndError) { + o.Rss = &v +} + +// GetTailLines returns the TailLines field value if set, zero value otherwise. +func (o *MarathonMesosRunningTask) GetTailLines() TaskTailLines { + if o == nil || o.TailLines == nil { + var ret TaskTailLines + return ret + } + return *o.TailLines +} + +// GetTailLinesOk returns a tuple with the TailLines field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosRunningTask) GetTailLinesOk() (*TaskTailLines, bool) { + if o == nil || o.TailLines == nil { + return nil, false + } + return o.TailLines, true +} + +// HasTailLines returns a boolean if a field has been set. +func (o *MarathonMesosRunningTask) HasTailLines() bool { + if o != nil && o.TailLines != nil { + return true + } + + return false +} + +// SetTailLines gets a reference to the given TaskTailLines and assigns it to the TailLines field. +func (o *MarathonMesosRunningTask) SetTailLines(v TaskTailLines) { + o.TailLines = &v +} + +func (o MarathonMesosRunningTask) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CpuShares != nil { + toSerialize["cpu_shares"] = o.CpuShares + } + if o.CpuUsedSeconds != nil { + toSerialize["cpu_used_seconds"] = o.CpuUsedSeconds + } + if o.DeployedTimestamp != nil { + toSerialize["deployed_timestamp"] = o.DeployedTimestamp + } + if o.DurationSeconds != nil { + toSerialize["duration_seconds"] = o.DurationSeconds + } + if o.Hostname != nil { + toSerialize["hostname"] = o.Hostname + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.MemLimit != nil { + toSerialize["mem_limit"] = o.MemLimit + } + if o.Rss != nil { + toSerialize["rss"] = o.Rss + } + if o.TailLines != nil { + toSerialize["tail_lines"] = o.TailLines + } + return json.Marshal(toSerialize) +} + +type NullableMarathonMesosRunningTask struct { + value *MarathonMesosRunningTask + isSet bool +} + +func (v NullableMarathonMesosRunningTask) Get() *MarathonMesosRunningTask { + return v.value +} + +func (v *NullableMarathonMesosRunningTask) Set(val *MarathonMesosRunningTask) { + v.value = val + v.isSet = true +} + +func (v NullableMarathonMesosRunningTask) IsSet() bool { + return v.isSet +} + +func (v *NullableMarathonMesosRunningTask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMarathonMesosRunningTask(val *MarathonMesosRunningTask) *NullableMarathonMesosRunningTask { + return &NullableMarathonMesosRunningTask{value: val, isSet: true} +} + +func (v NullableMarathonMesosRunningTask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMarathonMesosRunningTask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_marathon_mesos_status.go b/pkg/paastaapi/model_marathon_mesos_status.go new file mode 100644 index 0000000..0b1723d --- /dev/null +++ b/pkg/paastaapi/model_marathon_mesos_status.go @@ -0,0 +1,226 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// MarathonMesosStatus struct for MarathonMesosStatus +type MarathonMesosStatus struct { + // Error message when Mesos tasks cannot be queried + ErrorMessage *string `json:"error_message,omitempty"` + // Non-running tasks associated to this service + NonRunningTasks *[]MarathonMesosNonrunningTask `json:"non_running_tasks,omitempty"` + // The number of running Mesos tasks associated to this service + RunningTaskCount *int32 `json:"running_task_count,omitempty"` + // Currently running tasks associated to this service + RunningTasks *[]MarathonMesosRunningTask `json:"running_tasks,omitempty"` +} + +// NewMarathonMesosStatus instantiates a new MarathonMesosStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMarathonMesosStatus() *MarathonMesosStatus { + this := MarathonMesosStatus{} + return &this +} + +// NewMarathonMesosStatusWithDefaults instantiates a new MarathonMesosStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMarathonMesosStatusWithDefaults() *MarathonMesosStatus { + this := MarathonMesosStatus{} + return &this +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *MarathonMesosStatus) GetErrorMessage() string { + if o == nil || o.ErrorMessage == nil { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosStatus) GetErrorMessageOk() (*string, bool) { + if o == nil || o.ErrorMessage == nil { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *MarathonMesosStatus) HasErrorMessage() bool { + if o != nil && o.ErrorMessage != nil { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *MarathonMesosStatus) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetNonRunningTasks returns the NonRunningTasks field value if set, zero value otherwise. +func (o *MarathonMesosStatus) GetNonRunningTasks() []MarathonMesosNonrunningTask { + if o == nil || o.NonRunningTasks == nil { + var ret []MarathonMesosNonrunningTask + return ret + } + return *o.NonRunningTasks +} + +// GetNonRunningTasksOk returns a tuple with the NonRunningTasks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosStatus) GetNonRunningTasksOk() (*[]MarathonMesosNonrunningTask, bool) { + if o == nil || o.NonRunningTasks == nil { + return nil, false + } + return o.NonRunningTasks, true +} + +// HasNonRunningTasks returns a boolean if a field has been set. +func (o *MarathonMesosStatus) HasNonRunningTasks() bool { + if o != nil && o.NonRunningTasks != nil { + return true + } + + return false +} + +// SetNonRunningTasks gets a reference to the given []MarathonMesosNonrunningTask and assigns it to the NonRunningTasks field. +func (o *MarathonMesosStatus) SetNonRunningTasks(v []MarathonMesosNonrunningTask) { + o.NonRunningTasks = &v +} + +// GetRunningTaskCount returns the RunningTaskCount field value if set, zero value otherwise. +func (o *MarathonMesosStatus) GetRunningTaskCount() int32 { + if o == nil || o.RunningTaskCount == nil { + var ret int32 + return ret + } + return *o.RunningTaskCount +} + +// GetRunningTaskCountOk returns a tuple with the RunningTaskCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosStatus) GetRunningTaskCountOk() (*int32, bool) { + if o == nil || o.RunningTaskCount == nil { + return nil, false + } + return o.RunningTaskCount, true +} + +// HasRunningTaskCount returns a boolean if a field has been set. +func (o *MarathonMesosStatus) HasRunningTaskCount() bool { + if o != nil && o.RunningTaskCount != nil { + return true + } + + return false +} + +// SetRunningTaskCount gets a reference to the given int32 and assigns it to the RunningTaskCount field. +func (o *MarathonMesosStatus) SetRunningTaskCount(v int32) { + o.RunningTaskCount = &v +} + +// GetRunningTasks returns the RunningTasks field value if set, zero value otherwise. +func (o *MarathonMesosStatus) GetRunningTasks() []MarathonMesosRunningTask { + if o == nil || o.RunningTasks == nil { + var ret []MarathonMesosRunningTask + return ret + } + return *o.RunningTasks +} + +// GetRunningTasksOk returns a tuple with the RunningTasks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonMesosStatus) GetRunningTasksOk() (*[]MarathonMesosRunningTask, bool) { + if o == nil || o.RunningTasks == nil { + return nil, false + } + return o.RunningTasks, true +} + +// HasRunningTasks returns a boolean if a field has been set. +func (o *MarathonMesosStatus) HasRunningTasks() bool { + if o != nil && o.RunningTasks != nil { + return true + } + + return false +} + +// SetRunningTasks gets a reference to the given []MarathonMesosRunningTask and assigns it to the RunningTasks field. +func (o *MarathonMesosStatus) SetRunningTasks(v []MarathonMesosRunningTask) { + o.RunningTasks = &v +} + +func (o MarathonMesosStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ErrorMessage != nil { + toSerialize["error_message"] = o.ErrorMessage + } + if o.NonRunningTasks != nil { + toSerialize["non_running_tasks"] = o.NonRunningTasks + } + if o.RunningTaskCount != nil { + toSerialize["running_task_count"] = o.RunningTaskCount + } + if o.RunningTasks != nil { + toSerialize["running_tasks"] = o.RunningTasks + } + return json.Marshal(toSerialize) +} + +type NullableMarathonMesosStatus struct { + value *MarathonMesosStatus + isSet bool +} + +func (v NullableMarathonMesosStatus) Get() *MarathonMesosStatus { + return v.value +} + +func (v *NullableMarathonMesosStatus) Set(val *MarathonMesosStatus) { + v.value = val + v.isSet = true +} + +func (v NullableMarathonMesosStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableMarathonMesosStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMarathonMesosStatus(val *MarathonMesosStatus) *NullableMarathonMesosStatus { + return &NullableMarathonMesosStatus{value: val, isSet: true} +} + +func (v NullableMarathonMesosStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMarathonMesosStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_marathon_task.go b/pkg/paastaapi/model_marathon_task.go new file mode 100644 index 0000000..7341f96 --- /dev/null +++ b/pkg/paastaapi/model_marathon_task.go @@ -0,0 +1,263 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// MarathonTask struct for MarathonTask +type MarathonTask struct { + // Time at which the task was deployed + DeployedTimestamp *float32 `json:"deployed_timestamp,omitempty"` + // Name of the host on which the task is running + Host *string `json:"host,omitempty"` + // ID of the task in Mesos + Id *string `json:"id,omitempty"` + // Whether Marathon thinks the task is healthy + IsHealthy *bool `json:"is_healthy,omitempty"` + // Port on which the task is listening + Port *int32 `json:"port,omitempty"` +} + +// NewMarathonTask instantiates a new MarathonTask object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMarathonTask() *MarathonTask { + this := MarathonTask{} + return &this +} + +// NewMarathonTaskWithDefaults instantiates a new MarathonTask object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMarathonTaskWithDefaults() *MarathonTask { + this := MarathonTask{} + return &this +} + +// GetDeployedTimestamp returns the DeployedTimestamp field value if set, zero value otherwise. +func (o *MarathonTask) GetDeployedTimestamp() float32 { + if o == nil || o.DeployedTimestamp == nil { + var ret float32 + return ret + } + return *o.DeployedTimestamp +} + +// GetDeployedTimestampOk returns a tuple with the DeployedTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonTask) GetDeployedTimestampOk() (*float32, bool) { + if o == nil || o.DeployedTimestamp == nil { + return nil, false + } + return o.DeployedTimestamp, true +} + +// HasDeployedTimestamp returns a boolean if a field has been set. +func (o *MarathonTask) HasDeployedTimestamp() bool { + if o != nil && o.DeployedTimestamp != nil { + return true + } + + return false +} + +// SetDeployedTimestamp gets a reference to the given float32 and assigns it to the DeployedTimestamp field. +func (o *MarathonTask) SetDeployedTimestamp(v float32) { + o.DeployedTimestamp = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *MarathonTask) GetHost() string { + if o == nil || o.Host == nil { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonTask) GetHostOk() (*string, bool) { + if o == nil || o.Host == nil { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *MarathonTask) HasHost() bool { + if o != nil && o.Host != nil { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *MarathonTask) SetHost(v string) { + o.Host = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MarathonTask) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonTask) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MarathonTask) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MarathonTask) SetId(v string) { + o.Id = &v +} + +// GetIsHealthy returns the IsHealthy field value if set, zero value otherwise. +func (o *MarathonTask) GetIsHealthy() bool { + if o == nil || o.IsHealthy == nil { + var ret bool + return ret + } + return *o.IsHealthy +} + +// GetIsHealthyOk returns a tuple with the IsHealthy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonTask) GetIsHealthyOk() (*bool, bool) { + if o == nil || o.IsHealthy == nil { + return nil, false + } + return o.IsHealthy, true +} + +// HasIsHealthy returns a boolean if a field has been set. +func (o *MarathonTask) HasIsHealthy() bool { + if o != nil && o.IsHealthy != nil { + return true + } + + return false +} + +// SetIsHealthy gets a reference to the given bool and assigns it to the IsHealthy field. +func (o *MarathonTask) SetIsHealthy(v bool) { + o.IsHealthy = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *MarathonTask) GetPort() int32 { + if o == nil || o.Port == nil { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MarathonTask) GetPortOk() (*int32, bool) { + if o == nil || o.Port == nil { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *MarathonTask) HasPort() bool { + if o != nil && o.Port != nil { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *MarathonTask) SetPort(v int32) { + o.Port = &v +} + +func (o MarathonTask) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.DeployedTimestamp != nil { + toSerialize["deployed_timestamp"] = o.DeployedTimestamp + } + if o.Host != nil { + toSerialize["host"] = o.Host + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.IsHealthy != nil { + toSerialize["is_healthy"] = o.IsHealthy + } + if o.Port != nil { + toSerialize["port"] = o.Port + } + return json.Marshal(toSerialize) +} + +type NullableMarathonTask struct { + value *MarathonTask + isSet bool +} + +func (v NullableMarathonTask) Get() *MarathonTask { + return v.value +} + +func (v *NullableMarathonTask) Set(val *MarathonTask) { + v.value = val + v.isSet = true +} + +func (v NullableMarathonTask) IsSet() bool { + return v.isSet +} + +func (v *NullableMarathonTask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMarathonTask(val *MarathonTask) *NullableMarathonTask { + return &NullableMarathonTask{value: val, isSet: true} +} + +func (v NullableMarathonTask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMarathonTask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_meta_status.go b/pkg/paastaapi/model_meta_status.go new file mode 100644 index 0000000..d8d09b0 --- /dev/null +++ b/pkg/paastaapi/model_meta_status.go @@ -0,0 +1,152 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// MetaStatus Result of `paasta metastatus` command +type MetaStatus struct { + // Exit code from `paasta metastatus` command + ExitCode *int32 `json:"exit_code,omitempty"` + // Output from `paasta metastatus` command + Output *string `json:"output,omitempty"` +} + +// NewMetaStatus instantiates a new MetaStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetaStatus() *MetaStatus { + this := MetaStatus{} + return &this +} + +// NewMetaStatusWithDefaults instantiates a new MetaStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetaStatusWithDefaults() *MetaStatus { + this := MetaStatus{} + return &this +} + +// GetExitCode returns the ExitCode field value if set, zero value otherwise. +func (o *MetaStatus) GetExitCode() int32 { + if o == nil || o.ExitCode == nil { + var ret int32 + return ret + } + return *o.ExitCode +} + +// GetExitCodeOk returns a tuple with the ExitCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetaStatus) GetExitCodeOk() (*int32, bool) { + if o == nil || o.ExitCode == nil { + return nil, false + } + return o.ExitCode, true +} + +// HasExitCode returns a boolean if a field has been set. +func (o *MetaStatus) HasExitCode() bool { + if o != nil && o.ExitCode != nil { + return true + } + + return false +} + +// SetExitCode gets a reference to the given int32 and assigns it to the ExitCode field. +func (o *MetaStatus) SetExitCode(v int32) { + o.ExitCode = &v +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *MetaStatus) GetOutput() string { + if o == nil || o.Output == nil { + var ret string + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetaStatus) GetOutputOk() (*string, bool) { + if o == nil || o.Output == nil { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *MetaStatus) HasOutput() bool { + if o != nil && o.Output != nil { + return true + } + + return false +} + +// SetOutput gets a reference to the given string and assigns it to the Output field. +func (o *MetaStatus) SetOutput(v string) { + o.Output = &v +} + +func (o MetaStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ExitCode != nil { + toSerialize["exit_code"] = o.ExitCode + } + if o.Output != nil { + toSerialize["output"] = o.Output + } + return json.Marshal(toSerialize) +} + +type NullableMetaStatus struct { + value *MetaStatus + isSet bool +} + +func (v NullableMetaStatus) Get() *MetaStatus { + return v.value +} + +func (v *NullableMetaStatus) Set(val *MetaStatus) { + v.value = val + v.isSet = true +} + +func (v NullableMetaStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableMetaStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetaStatus(val *MetaStatus) *NullableMetaStatus { + return &NullableMetaStatus{value: val, isSet: true} +} + +func (v NullableMetaStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetaStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_resource_item.go b/pkg/paastaapi/model_resource_item.go new file mode 100644 index 0000000..a606ae9 --- /dev/null +++ b/pkg/paastaapi/model_resource_item.go @@ -0,0 +1,222 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// ResourceItem struct for ResourceItem +type ResourceItem struct { + Cpus *ResourceValue `json:"cpus,omitempty"` + Disk *ResourceValue `json:"disk,omitempty"` + Groupings *map[string]interface{} `json:"groupings,omitempty"` + Mem *ResourceValue `json:"mem,omitempty"` +} + +// NewResourceItem instantiates a new ResourceItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceItem() *ResourceItem { + this := ResourceItem{} + return &this +} + +// NewResourceItemWithDefaults instantiates a new ResourceItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceItemWithDefaults() *ResourceItem { + this := ResourceItem{} + return &this +} + +// GetCpus returns the Cpus field value if set, zero value otherwise. +func (o *ResourceItem) GetCpus() ResourceValue { + if o == nil || o.Cpus == nil { + var ret ResourceValue + return ret + } + return *o.Cpus +} + +// GetCpusOk returns a tuple with the Cpus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceItem) GetCpusOk() (*ResourceValue, bool) { + if o == nil || o.Cpus == nil { + return nil, false + } + return o.Cpus, true +} + +// HasCpus returns a boolean if a field has been set. +func (o *ResourceItem) HasCpus() bool { + if o != nil && o.Cpus != nil { + return true + } + + return false +} + +// SetCpus gets a reference to the given ResourceValue and assigns it to the Cpus field. +func (o *ResourceItem) SetCpus(v ResourceValue) { + o.Cpus = &v +} + +// GetDisk returns the Disk field value if set, zero value otherwise. +func (o *ResourceItem) GetDisk() ResourceValue { + if o == nil || o.Disk == nil { + var ret ResourceValue + return ret + } + return *o.Disk +} + +// GetDiskOk returns a tuple with the Disk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceItem) GetDiskOk() (*ResourceValue, bool) { + if o == nil || o.Disk == nil { + return nil, false + } + return o.Disk, true +} + +// HasDisk returns a boolean if a field has been set. +func (o *ResourceItem) HasDisk() bool { + if o != nil && o.Disk != nil { + return true + } + + return false +} + +// SetDisk gets a reference to the given ResourceValue and assigns it to the Disk field. +func (o *ResourceItem) SetDisk(v ResourceValue) { + o.Disk = &v +} + +// GetGroupings returns the Groupings field value if set, zero value otherwise. +func (o *ResourceItem) GetGroupings() map[string]interface{} { + if o == nil || o.Groupings == nil { + var ret map[string]interface{} + return ret + } + return *o.Groupings +} + +// GetGroupingsOk returns a tuple with the Groupings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceItem) GetGroupingsOk() (*map[string]interface{}, bool) { + if o == nil || o.Groupings == nil { + return nil, false + } + return o.Groupings, true +} + +// HasGroupings returns a boolean if a field has been set. +func (o *ResourceItem) HasGroupings() bool { + if o != nil && o.Groupings != nil { + return true + } + + return false +} + +// SetGroupings gets a reference to the given map[string]interface{} and assigns it to the Groupings field. +func (o *ResourceItem) SetGroupings(v map[string]interface{}) { + o.Groupings = &v +} + +// GetMem returns the Mem field value if set, zero value otherwise. +func (o *ResourceItem) GetMem() ResourceValue { + if o == nil || o.Mem == nil { + var ret ResourceValue + return ret + } + return *o.Mem +} + +// GetMemOk returns a tuple with the Mem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceItem) GetMemOk() (*ResourceValue, bool) { + if o == nil || o.Mem == nil { + return nil, false + } + return o.Mem, true +} + +// HasMem returns a boolean if a field has been set. +func (o *ResourceItem) HasMem() bool { + if o != nil && o.Mem != nil { + return true + } + + return false +} + +// SetMem gets a reference to the given ResourceValue and assigns it to the Mem field. +func (o *ResourceItem) SetMem(v ResourceValue) { + o.Mem = &v +} + +func (o ResourceItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Cpus != nil { + toSerialize["cpus"] = o.Cpus + } + if o.Disk != nil { + toSerialize["disk"] = o.Disk + } + if o.Groupings != nil { + toSerialize["groupings"] = o.Groupings + } + if o.Mem != nil { + toSerialize["mem"] = o.Mem + } + return json.Marshal(toSerialize) +} + +type NullableResourceItem struct { + value *ResourceItem + isSet bool +} + +func (v NullableResourceItem) Get() *ResourceItem { + return v.value +} + +func (v *NullableResourceItem) Set(val *ResourceItem) { + v.value = val + v.isSet = true +} + +func (v NullableResourceItem) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceItem(val *ResourceItem) *NullableResourceItem { + return &NullableResourceItem{value: val, isSet: true} +} + +func (v NullableResourceItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_resource_value.go b/pkg/paastaapi/model_resource_value.go new file mode 100644 index 0000000..8151e52 --- /dev/null +++ b/pkg/paastaapi/model_resource_value.go @@ -0,0 +1,186 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// ResourceValue struct for ResourceValue +type ResourceValue struct { + Free *float32 `json:"free,omitempty"` + Total *float32 `json:"total,omitempty"` + Used *float32 `json:"used,omitempty"` +} + +// NewResourceValue instantiates a new ResourceValue object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceValue() *ResourceValue { + this := ResourceValue{} + return &this +} + +// NewResourceValueWithDefaults instantiates a new ResourceValue object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceValueWithDefaults() *ResourceValue { + this := ResourceValue{} + return &this +} + +// GetFree returns the Free field value if set, zero value otherwise. +func (o *ResourceValue) GetFree() float32 { + if o == nil || o.Free == nil { + var ret float32 + return ret + } + return *o.Free +} + +// GetFreeOk returns a tuple with the Free field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceValue) GetFreeOk() (*float32, bool) { + if o == nil || o.Free == nil { + return nil, false + } + return o.Free, true +} + +// HasFree returns a boolean if a field has been set. +func (o *ResourceValue) HasFree() bool { + if o != nil && o.Free != nil { + return true + } + + return false +} + +// SetFree gets a reference to the given float32 and assigns it to the Free field. +func (o *ResourceValue) SetFree(v float32) { + o.Free = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *ResourceValue) GetTotal() float32 { + if o == nil || o.Total == nil { + var ret float32 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceValue) GetTotalOk() (*float32, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *ResourceValue) HasTotal() bool { + if o != nil && o.Total != nil { + return true + } + + return false +} + +// SetTotal gets a reference to the given float32 and assigns it to the Total field. +func (o *ResourceValue) SetTotal(v float32) { + o.Total = &v +} + +// GetUsed returns the Used field value if set, zero value otherwise. +func (o *ResourceValue) GetUsed() float32 { + if o == nil || o.Used == nil { + var ret float32 + return ret + } + return *o.Used +} + +// GetUsedOk returns a tuple with the Used field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceValue) GetUsedOk() (*float32, bool) { + if o == nil || o.Used == nil { + return nil, false + } + return o.Used, true +} + +// HasUsed returns a boolean if a field has been set. +func (o *ResourceValue) HasUsed() bool { + if o != nil && o.Used != nil { + return true + } + + return false +} + +// SetUsed gets a reference to the given float32 and assigns it to the Used field. +func (o *ResourceValue) SetUsed(v float32) { + o.Used = &v +} + +func (o ResourceValue) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Free != nil { + toSerialize["free"] = o.Free + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Used != nil { + toSerialize["used"] = o.Used + } + return json.Marshal(toSerialize) +} + +type NullableResourceValue struct { + value *ResourceValue + isSet bool +} + +func (v NullableResourceValue) Get() *ResourceValue { + return v.value +} + +func (v *NullableResourceValue) Set(val *ResourceValue) { + v.value = val + v.isSet = true +} + +func (v NullableResourceValue) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceValue(val *ResourceValue) *NullableResourceValue { + return &NullableResourceValue{value: val, isSet: true} +} + +func (v NullableResourceValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_smartstack_backend.go b/pkg/paastaapi/model_smartstack_backend.go new file mode 100644 index 0000000..cd9e7d4 --- /dev/null +++ b/pkg/paastaapi/model_smartstack_backend.go @@ -0,0 +1,374 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// SmartstackBackend struct for SmartstackBackend +type SmartstackBackend struct { + // Check code reported by HAProxy + CheckCode *string `json:"check_code,omitempty"` + // Duration in ms of the last health check performed by HAProxy + CheckDuration *int32 `json:"check_duration,omitempty"` + // Status of last health check of the backend + CheckStatus *string `json:"check_status,omitempty"` + // Whether this backend has an associated task running + HasAssociatedTask *bool `json:"has_associated_task,omitempty"` + // Name of the host on which the backend is running + Hostname *string `json:"hostname,omitempty"` + // Seconds since last change in backend status + LastChange *int32 `json:"last_change,omitempty"` + // Port number on which the backend responds + Port *int32 `json:"port,omitempty"` + // Status of the backend in HAProxy + Status *string `json:"status,omitempty"` +} + +// NewSmartstackBackend instantiates a new SmartstackBackend object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSmartstackBackend() *SmartstackBackend { + this := SmartstackBackend{} + return &this +} + +// NewSmartstackBackendWithDefaults instantiates a new SmartstackBackend object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSmartstackBackendWithDefaults() *SmartstackBackend { + this := SmartstackBackend{} + return &this +} + +// GetCheckCode returns the CheckCode field value if set, zero value otherwise. +func (o *SmartstackBackend) GetCheckCode() string { + if o == nil || o.CheckCode == nil { + var ret string + return ret + } + return *o.CheckCode +} + +// GetCheckCodeOk returns a tuple with the CheckCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackBackend) GetCheckCodeOk() (*string, bool) { + if o == nil || o.CheckCode == nil { + return nil, false + } + return o.CheckCode, true +} + +// HasCheckCode returns a boolean if a field has been set. +func (o *SmartstackBackend) HasCheckCode() bool { + if o != nil && o.CheckCode != nil { + return true + } + + return false +} + +// SetCheckCode gets a reference to the given string and assigns it to the CheckCode field. +func (o *SmartstackBackend) SetCheckCode(v string) { + o.CheckCode = &v +} + +// GetCheckDuration returns the CheckDuration field value if set, zero value otherwise. +func (o *SmartstackBackend) GetCheckDuration() int32 { + if o == nil || o.CheckDuration == nil { + var ret int32 + return ret + } + return *o.CheckDuration +} + +// GetCheckDurationOk returns a tuple with the CheckDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackBackend) GetCheckDurationOk() (*int32, bool) { + if o == nil || o.CheckDuration == nil { + return nil, false + } + return o.CheckDuration, true +} + +// HasCheckDuration returns a boolean if a field has been set. +func (o *SmartstackBackend) HasCheckDuration() bool { + if o != nil && o.CheckDuration != nil { + return true + } + + return false +} + +// SetCheckDuration gets a reference to the given int32 and assigns it to the CheckDuration field. +func (o *SmartstackBackend) SetCheckDuration(v int32) { + o.CheckDuration = &v +} + +// GetCheckStatus returns the CheckStatus field value if set, zero value otherwise. +func (o *SmartstackBackend) GetCheckStatus() string { + if o == nil || o.CheckStatus == nil { + var ret string + return ret + } + return *o.CheckStatus +} + +// GetCheckStatusOk returns a tuple with the CheckStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackBackend) GetCheckStatusOk() (*string, bool) { + if o == nil || o.CheckStatus == nil { + return nil, false + } + return o.CheckStatus, true +} + +// HasCheckStatus returns a boolean if a field has been set. +func (o *SmartstackBackend) HasCheckStatus() bool { + if o != nil && o.CheckStatus != nil { + return true + } + + return false +} + +// SetCheckStatus gets a reference to the given string and assigns it to the CheckStatus field. +func (o *SmartstackBackend) SetCheckStatus(v string) { + o.CheckStatus = &v +} + +// GetHasAssociatedTask returns the HasAssociatedTask field value if set, zero value otherwise. +func (o *SmartstackBackend) GetHasAssociatedTask() bool { + if o == nil || o.HasAssociatedTask == nil { + var ret bool + return ret + } + return *o.HasAssociatedTask +} + +// GetHasAssociatedTaskOk returns a tuple with the HasAssociatedTask field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackBackend) GetHasAssociatedTaskOk() (*bool, bool) { + if o == nil || o.HasAssociatedTask == nil { + return nil, false + } + return o.HasAssociatedTask, true +} + +// HasHasAssociatedTask returns a boolean if a field has been set. +func (o *SmartstackBackend) HasHasAssociatedTask() bool { + if o != nil && o.HasAssociatedTask != nil { + return true + } + + return false +} + +// SetHasAssociatedTask gets a reference to the given bool and assigns it to the HasAssociatedTask field. +func (o *SmartstackBackend) SetHasAssociatedTask(v bool) { + o.HasAssociatedTask = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *SmartstackBackend) GetHostname() string { + if o == nil || o.Hostname == nil { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackBackend) GetHostnameOk() (*string, bool) { + if o == nil || o.Hostname == nil { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *SmartstackBackend) HasHostname() bool { + if o != nil && o.Hostname != nil { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *SmartstackBackend) SetHostname(v string) { + o.Hostname = &v +} + +// GetLastChange returns the LastChange field value if set, zero value otherwise. +func (o *SmartstackBackend) GetLastChange() int32 { + if o == nil || o.LastChange == nil { + var ret int32 + return ret + } + return *o.LastChange +} + +// GetLastChangeOk returns a tuple with the LastChange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackBackend) GetLastChangeOk() (*int32, bool) { + if o == nil || o.LastChange == nil { + return nil, false + } + return o.LastChange, true +} + +// HasLastChange returns a boolean if a field has been set. +func (o *SmartstackBackend) HasLastChange() bool { + if o != nil && o.LastChange != nil { + return true + } + + return false +} + +// SetLastChange gets a reference to the given int32 and assigns it to the LastChange field. +func (o *SmartstackBackend) SetLastChange(v int32) { + o.LastChange = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *SmartstackBackend) GetPort() int32 { + if o == nil || o.Port == nil { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackBackend) GetPortOk() (*int32, bool) { + if o == nil || o.Port == nil { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *SmartstackBackend) HasPort() bool { + if o != nil && o.Port != nil { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *SmartstackBackend) SetPort(v int32) { + o.Port = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SmartstackBackend) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackBackend) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SmartstackBackend) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *SmartstackBackend) SetStatus(v string) { + o.Status = &v +} + +func (o SmartstackBackend) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.CheckCode != nil { + toSerialize["check_code"] = o.CheckCode + } + if o.CheckDuration != nil { + toSerialize["check_duration"] = o.CheckDuration + } + if o.CheckStatus != nil { + toSerialize["check_status"] = o.CheckStatus + } + if o.HasAssociatedTask != nil { + toSerialize["has_associated_task"] = o.HasAssociatedTask + } + if o.Hostname != nil { + toSerialize["hostname"] = o.Hostname + } + if o.LastChange != nil { + toSerialize["last_change"] = o.LastChange + } + if o.Port != nil { + toSerialize["port"] = o.Port + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableSmartstackBackend struct { + value *SmartstackBackend + isSet bool +} + +func (v NullableSmartstackBackend) Get() *SmartstackBackend { + return v.value +} + +func (v *NullableSmartstackBackend) Set(val *SmartstackBackend) { + v.value = val + v.isSet = true +} + +func (v NullableSmartstackBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableSmartstackBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSmartstackBackend(val *SmartstackBackend) *NullableSmartstackBackend { + return &NullableSmartstackBackend{value: val, isSet: true} +} + +func (v NullableSmartstackBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSmartstackBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_smartstack_location.go b/pkg/paastaapi/model_smartstack_location.go new file mode 100644 index 0000000..89dd626 --- /dev/null +++ b/pkg/paastaapi/model_smartstack_location.go @@ -0,0 +1,189 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// SmartstackLocation struct for SmartstackLocation +type SmartstackLocation struct { + // Smartstack backends running in this location + Backends *[]SmartstackBackend `json:"backends,omitempty"` + // Name of the location + Name *string `json:"name,omitempty"` + // Number of running backends for the service in this location + RunningBackendsCount *int32 `json:"running_backends_count,omitempty"` +} + +// NewSmartstackLocation instantiates a new SmartstackLocation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSmartstackLocation() *SmartstackLocation { + this := SmartstackLocation{} + return &this +} + +// NewSmartstackLocationWithDefaults instantiates a new SmartstackLocation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSmartstackLocationWithDefaults() *SmartstackLocation { + this := SmartstackLocation{} + return &this +} + +// GetBackends returns the Backends field value if set, zero value otherwise. +func (o *SmartstackLocation) GetBackends() []SmartstackBackend { + if o == nil || o.Backends == nil { + var ret []SmartstackBackend + return ret + } + return *o.Backends +} + +// GetBackendsOk returns a tuple with the Backends field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackLocation) GetBackendsOk() (*[]SmartstackBackend, bool) { + if o == nil || o.Backends == nil { + return nil, false + } + return o.Backends, true +} + +// HasBackends returns a boolean if a field has been set. +func (o *SmartstackLocation) HasBackends() bool { + if o != nil && o.Backends != nil { + return true + } + + return false +} + +// SetBackends gets a reference to the given []SmartstackBackend and assigns it to the Backends field. +func (o *SmartstackLocation) SetBackends(v []SmartstackBackend) { + o.Backends = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SmartstackLocation) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackLocation) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SmartstackLocation) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SmartstackLocation) SetName(v string) { + o.Name = &v +} + +// GetRunningBackendsCount returns the RunningBackendsCount field value if set, zero value otherwise. +func (o *SmartstackLocation) GetRunningBackendsCount() int32 { + if o == nil || o.RunningBackendsCount == nil { + var ret int32 + return ret + } + return *o.RunningBackendsCount +} + +// GetRunningBackendsCountOk returns a tuple with the RunningBackendsCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackLocation) GetRunningBackendsCountOk() (*int32, bool) { + if o == nil || o.RunningBackendsCount == nil { + return nil, false + } + return o.RunningBackendsCount, true +} + +// HasRunningBackendsCount returns a boolean if a field has been set. +func (o *SmartstackLocation) HasRunningBackendsCount() bool { + if o != nil && o.RunningBackendsCount != nil { + return true + } + + return false +} + +// SetRunningBackendsCount gets a reference to the given int32 and assigns it to the RunningBackendsCount field. +func (o *SmartstackLocation) SetRunningBackendsCount(v int32) { + o.RunningBackendsCount = &v +} + +func (o SmartstackLocation) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Backends != nil { + toSerialize["backends"] = o.Backends + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.RunningBackendsCount != nil { + toSerialize["running_backends_count"] = o.RunningBackendsCount + } + return json.Marshal(toSerialize) +} + +type NullableSmartstackLocation struct { + value *SmartstackLocation + isSet bool +} + +func (v NullableSmartstackLocation) Get() *SmartstackLocation { + return v.value +} + +func (v *NullableSmartstackLocation) Set(val *SmartstackLocation) { + v.value = val + v.isSet = true +} + +func (v NullableSmartstackLocation) IsSet() bool { + return v.isSet +} + +func (v *NullableSmartstackLocation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSmartstackLocation(val *SmartstackLocation) *NullableSmartstackLocation { + return &NullableSmartstackLocation{value: val, isSet: true} +} + +func (v NullableSmartstackLocation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSmartstackLocation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_smartstack_status.go b/pkg/paastaapi/model_smartstack_status.go new file mode 100644 index 0000000..614167d --- /dev/null +++ b/pkg/paastaapi/model_smartstack_status.go @@ -0,0 +1,189 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// SmartstackStatus struct for SmartstackStatus +type SmartstackStatus struct { + // Number of backends expected to be present in each location + ExpectedBackendsPerLocation *int32 `json:"expected_backends_per_location,omitempty"` + // Locations the service is deployed + Locations *[]SmartstackLocation `json:"locations,omitempty"` + // Registration name of the service in Smartstack + Registration *string `json:"registration,omitempty"` +} + +// NewSmartstackStatus instantiates a new SmartstackStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSmartstackStatus() *SmartstackStatus { + this := SmartstackStatus{} + return &this +} + +// NewSmartstackStatusWithDefaults instantiates a new SmartstackStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSmartstackStatusWithDefaults() *SmartstackStatus { + this := SmartstackStatus{} + return &this +} + +// GetExpectedBackendsPerLocation returns the ExpectedBackendsPerLocation field value if set, zero value otherwise. +func (o *SmartstackStatus) GetExpectedBackendsPerLocation() int32 { + if o == nil || o.ExpectedBackendsPerLocation == nil { + var ret int32 + return ret + } + return *o.ExpectedBackendsPerLocation +} + +// GetExpectedBackendsPerLocationOk returns a tuple with the ExpectedBackendsPerLocation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackStatus) GetExpectedBackendsPerLocationOk() (*int32, bool) { + if o == nil || o.ExpectedBackendsPerLocation == nil { + return nil, false + } + return o.ExpectedBackendsPerLocation, true +} + +// HasExpectedBackendsPerLocation returns a boolean if a field has been set. +func (o *SmartstackStatus) HasExpectedBackendsPerLocation() bool { + if o != nil && o.ExpectedBackendsPerLocation != nil { + return true + } + + return false +} + +// SetExpectedBackendsPerLocation gets a reference to the given int32 and assigns it to the ExpectedBackendsPerLocation field. +func (o *SmartstackStatus) SetExpectedBackendsPerLocation(v int32) { + o.ExpectedBackendsPerLocation = &v +} + +// GetLocations returns the Locations field value if set, zero value otherwise. +func (o *SmartstackStatus) GetLocations() []SmartstackLocation { + if o == nil || o.Locations == nil { + var ret []SmartstackLocation + return ret + } + return *o.Locations +} + +// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackStatus) GetLocationsOk() (*[]SmartstackLocation, bool) { + if o == nil || o.Locations == nil { + return nil, false + } + return o.Locations, true +} + +// HasLocations returns a boolean if a field has been set. +func (o *SmartstackStatus) HasLocations() bool { + if o != nil && o.Locations != nil { + return true + } + + return false +} + +// SetLocations gets a reference to the given []SmartstackLocation and assigns it to the Locations field. +func (o *SmartstackStatus) SetLocations(v []SmartstackLocation) { + o.Locations = &v +} + +// GetRegistration returns the Registration field value if set, zero value otherwise. +func (o *SmartstackStatus) GetRegistration() string { + if o == nil || o.Registration == nil { + var ret string + return ret + } + return *o.Registration +} + +// GetRegistrationOk returns a tuple with the Registration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SmartstackStatus) GetRegistrationOk() (*string, bool) { + if o == nil || o.Registration == nil { + return nil, false + } + return o.Registration, true +} + +// HasRegistration returns a boolean if a field has been set. +func (o *SmartstackStatus) HasRegistration() bool { + if o != nil && o.Registration != nil { + return true + } + + return false +} + +// SetRegistration gets a reference to the given string and assigns it to the Registration field. +func (o *SmartstackStatus) SetRegistration(v string) { + o.Registration = &v +} + +func (o SmartstackStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ExpectedBackendsPerLocation != nil { + toSerialize["expected_backends_per_location"] = o.ExpectedBackendsPerLocation + } + if o.Locations != nil { + toSerialize["locations"] = o.Locations + } + if o.Registration != nil { + toSerialize["registration"] = o.Registration + } + return json.Marshal(toSerialize) +} + +type NullableSmartstackStatus struct { + value *SmartstackStatus + isSet bool +} + +func (v NullableSmartstackStatus) Get() *SmartstackStatus { + return v.value +} + +func (v *NullableSmartstackStatus) Set(val *SmartstackStatus) { + v.value = val + v.isSet = true +} + +func (v NullableSmartstackStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableSmartstackStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSmartstackStatus(val *SmartstackStatus) *NullableSmartstackStatus { + return &NullableSmartstackStatus{value: val, isSet: true} +} + +func (v NullableSmartstackStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSmartstackStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/model_task_tail_lines.go b/pkg/paastaapi/model_task_tail_lines.go new file mode 100644 index 0000000..acb841c --- /dev/null +++ b/pkg/paastaapi/model_task_tail_lines.go @@ -0,0 +1,189 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" +) + +// TaskTailLines struct for TaskTailLines +type TaskTailLines struct { + // Error message when fetching tail lines fails + ErrorMessage *string `json:"error_message,omitempty"` + // The requested number of lines from the task's stderr + Stderr *[]string `json:"stderr,omitempty"` + // The requested number of lines from the task's stdout + Stdout *[]string `json:"stdout,omitempty"` +} + +// NewTaskTailLines instantiates a new TaskTailLines object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskTailLines() *TaskTailLines { + this := TaskTailLines{} + return &this +} + +// NewTaskTailLinesWithDefaults instantiates a new TaskTailLines object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskTailLinesWithDefaults() *TaskTailLines { + this := TaskTailLines{} + return &this +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *TaskTailLines) GetErrorMessage() string { + if o == nil || o.ErrorMessage == nil { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskTailLines) GetErrorMessageOk() (*string, bool) { + if o == nil || o.ErrorMessage == nil { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *TaskTailLines) HasErrorMessage() bool { + if o != nil && o.ErrorMessage != nil { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *TaskTailLines) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetStderr returns the Stderr field value if set, zero value otherwise. +func (o *TaskTailLines) GetStderr() []string { + if o == nil || o.Stderr == nil { + var ret []string + return ret + } + return *o.Stderr +} + +// GetStderrOk returns a tuple with the Stderr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskTailLines) GetStderrOk() (*[]string, bool) { + if o == nil || o.Stderr == nil { + return nil, false + } + return o.Stderr, true +} + +// HasStderr returns a boolean if a field has been set. +func (o *TaskTailLines) HasStderr() bool { + if o != nil && o.Stderr != nil { + return true + } + + return false +} + +// SetStderr gets a reference to the given []string and assigns it to the Stderr field. +func (o *TaskTailLines) SetStderr(v []string) { + o.Stderr = &v +} + +// GetStdout returns the Stdout field value if set, zero value otherwise. +func (o *TaskTailLines) GetStdout() []string { + if o == nil || o.Stdout == nil { + var ret []string + return ret + } + return *o.Stdout +} + +// GetStdoutOk returns a tuple with the Stdout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskTailLines) GetStdoutOk() (*[]string, bool) { + if o == nil || o.Stdout == nil { + return nil, false + } + return o.Stdout, true +} + +// HasStdout returns a boolean if a field has been set. +func (o *TaskTailLines) HasStdout() bool { + if o != nil && o.Stdout != nil { + return true + } + + return false +} + +// SetStdout gets a reference to the given []string and assigns it to the Stdout field. +func (o *TaskTailLines) SetStdout(v []string) { + o.Stdout = &v +} + +func (o TaskTailLines) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ErrorMessage != nil { + toSerialize["error_message"] = o.ErrorMessage + } + if o.Stderr != nil { + toSerialize["stderr"] = o.Stderr + } + if o.Stdout != nil { + toSerialize["stdout"] = o.Stdout + } + return json.Marshal(toSerialize) +} + +type NullableTaskTailLines struct { + value *TaskTailLines + isSet bool +} + +func (v NullableTaskTailLines) Get() *TaskTailLines { + return v.value +} + +func (v *NullableTaskTailLines) Set(val *TaskTailLines) { + v.value = val + v.isSet = true +} + +func (v NullableTaskTailLines) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskTailLines) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskTailLines(val *TaskTailLines) *NullableTaskTailLines { + return &NullableTaskTailLines{value: val, isSet: true} +} + +func (v NullableTaskTailLines) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskTailLines) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/pkg/paastaapi/models/adhoc_launch_history.go b/pkg/paastaapi/models/adhoc_launch_history.go deleted file mode 100644 index eb964a3..0000000 --- a/pkg/paastaapi/models/adhoc_launch_history.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AdhocLaunchHistory A single run -// -// swagger:model AdhocLaunchHistory -type AdhocLaunchHistory struct { - - // framework id - FrameworkID string `json:"framework_id,omitempty"` - - // when the job was launched - LaunchTime string `json:"launch_time,omitempty"` - - // id of the single run - RunID string `json:"run_id,omitempty"` -} - -// Validate validates this adhoc launch history -func (m *AdhocLaunchHistory) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AdhocLaunchHistory) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AdhocLaunchHistory) UnmarshalBinary(b []byte) error { - var res AdhocLaunchHistory - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/deploy_queue.go b/pkg/paastaapi/models/deploy_queue.go deleted file mode 100644 index bb48b42..0000000 --- a/pkg/paastaapi/models/deploy_queue.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DeployQueue Current state of the deployd queue -// -// swagger:model DeployQueue -type DeployQueue struct { - - // Service instances that are ready to be acted on by deployd - AvailableServiceInstances []*DeployQueueServiceInstance `json:"available_service_instances"` - - // Service instances that deployd is waiting to act on - UnavailableServiceInstances []*DeployQueueServiceInstance `json:"unavailable_service_instances"` -} - -// Validate validates this deploy queue -func (m *DeployQueue) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAvailableServiceInstances(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUnavailableServiceInstances(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeployQueue) validateAvailableServiceInstances(formats strfmt.Registry) error { - - if swag.IsZero(m.AvailableServiceInstances) { // not required - return nil - } - - for i := 0; i < len(m.AvailableServiceInstances); i++ { - if swag.IsZero(m.AvailableServiceInstances[i]) { // not required - continue - } - - if m.AvailableServiceInstances[i] != nil { - if err := m.AvailableServiceInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("available_service_instances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *DeployQueue) validateUnavailableServiceInstances(formats strfmt.Registry) error { - - if swag.IsZero(m.UnavailableServiceInstances) { // not required - return nil - } - - for i := 0; i < len(m.UnavailableServiceInstances); i++ { - if swag.IsZero(m.UnavailableServiceInstances[i]) { // not required - continue - } - - if m.UnavailableServiceInstances[i] != nil { - if err := m.UnavailableServiceInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("unavailable_service_instances" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DeployQueue) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeployQueue) UnmarshalBinary(b []byte) error { - var res DeployQueue - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/deploy_queue_service_instance.go b/pkg/paastaapi/models/deploy_queue_service_instance.go deleted file mode 100644 index 993a8c5..0000000 --- a/pkg/paastaapi/models/deploy_queue_service_instance.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DeployQueueServiceInstance An instance of a service in the deploy queue -// -// swagger:model DeployQueueServiceInstance -type DeployQueueServiceInstance struct { - - // Desired timestamp by which the service instance should be bounced - BounceBy float32 `json:"bounce_by,omitempty"` - - // Timestamp at which service instance was first added to the queue - BounceStartTime float32 `json:"bounce_start_time,omitempty"` - - // Timestamp at which the service instance was last added to the queue - EnqueueTime float32 `json:"enqueue_time,omitempty"` - - // Number of times deployment actions have failed on this service instance - Failures int32 `json:"failures,omitempty"` - - // Name of the instance of the service - Instance string `json:"instance,omitempty"` - - // Number of times any deployment action has been taken on this service instance - ProcessedCount int32 `json:"processed_count,omitempty"` - - // Name of the service - Service string `json:"service,omitempty"` - - // Timestamp before which no action should be taken on this service instance - WaitUntil float32 `json:"wait_until,omitempty"` - - // The process that enqueued the task - Watcher string `json:"watcher,omitempty"` -} - -// Validate validates this deploy queue service instance -func (m *DeployQueueServiceInstance) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DeployQueueServiceInstance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeployQueueServiceInstance) UnmarshalBinary(b []byte) error { - var res DeployQueueServiceInstance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/envoy_backend.go b/pkg/paastaapi/models/envoy_backend.go deleted file mode 100644 index b22c1bf..0000000 --- a/pkg/paastaapi/models/envoy_backend.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnvoyBackend envoy backend -// -// swagger:model EnvoyBackend -type EnvoyBackend struct { - - // Address of the host on which the backend is running - Address string `json:"address,omitempty"` - - // Status of the backend in Envoy as reported by the EDS - EdsHealthStatus string `json:"eds_health_status,omitempty"` - - // Whether this backend has an associated task running - HasAssociatedTask bool `json:"has_associated_task,omitempty"` - - // Name of the host on which the backend is running - Hostname string `json:"hostname,omitempty"` - - // Port number on which the backend responds - PortValue int32 `json:"port_value,omitempty"` - - // The weight of this backend in the cluster - Weight int32 `json:"weight,omitempty"` -} - -// Validate validates this envoy backend -func (m *EnvoyBackend) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EnvoyBackend) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnvoyBackend) UnmarshalBinary(b []byte) error { - var res EnvoyBackend - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/envoy_location.go b/pkg/paastaapi/models/envoy_location.go deleted file mode 100644 index ff76861..0000000 --- a/pkg/paastaapi/models/envoy_location.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnvoyLocation envoy location -// -// swagger:model EnvoyLocation -type EnvoyLocation struct { - - // Envoy backends running in this location - Backends []*EnvoyBackend `json:"backends"` - - // Whether this backend is proxied through Casper - IsProxiedThroughCasper bool `json:"is_proxied_through_casper,omitempty"` - - // Name of the location - Name string `json:"name,omitempty"` - - // Number of running backends for the service in this location - RunningBackendsCount int32 `json:"running_backends_count,omitempty"` -} - -// Validate validates this envoy location -func (m *EnvoyLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackends(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnvoyLocation) validateBackends(formats strfmt.Registry) error { - - if swag.IsZero(m.Backends) { // not required - return nil - } - - for i := 0; i < len(m.Backends); i++ { - if swag.IsZero(m.Backends[i]) { // not required - continue - } - - if m.Backends[i] != nil { - if err := m.Backends[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backends" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EnvoyLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnvoyLocation) UnmarshalBinary(b []byte) error { - var res EnvoyLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/envoy_status.go b/pkg/paastaapi/models/envoy_status.go deleted file mode 100644 index b58fae1..0000000 --- a/pkg/paastaapi/models/envoy_status.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnvoyStatus envoy status -// -// swagger:model EnvoyStatus -type EnvoyStatus struct { - - // Number of backends expected to be present in each location - ExpectedBackendsPerLocation int32 `json:"expected_backends_per_location,omitempty"` - - // Locations the service is deployed - Locations []*EnvoyLocation `json:"locations"` - - // Registration name of the service in Smartstack - Registration string `json:"registration,omitempty"` -} - -// Validate validates this envoy status -func (m *EnvoyStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLocations(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnvoyStatus) validateLocations(formats strfmt.Registry) error { - - if swag.IsZero(m.Locations) { // not required - return nil - } - - for i := 0; i < len(m.Locations); i++ { - if swag.IsZero(m.Locations[i]) { // not required - continue - } - - if m.Locations[i] != nil { - if err := m.Locations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("locations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EnvoyStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnvoyStatus) UnmarshalBinary(b []byte) error { - var res EnvoyStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/float_and_error.go b/pkg/paastaapi/models/float_and_error.go deleted file mode 100644 index 659a1d6..0000000 --- a/pkg/paastaapi/models/float_and_error.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// FloatAndError float and error -// -// swagger:model FloatAndError -type FloatAndError struct { - - // error message - ErrorMessage string `json:"error_message,omitempty"` - - // value - Value float32 `json:"value,omitempty"` -} - -// Validate validates this float and error -func (m *FloatAndError) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *FloatAndError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FloatAndError) UnmarshalBinary(b []byte) error { - var res FloatAndError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/h_p_a_metric.go b/pkg/paastaapi/models/h_p_a_metric.go deleted file mode 100644 index ba03710..0000000 --- a/pkg/paastaapi/models/h_p_a_metric.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HPAMetric h p a metric -// -// swagger:model HPAMetric -type HPAMetric struct { - - // setpoint/target_value as specified in yelpsoa_configs - CurrentValue string `json:"current_value,omitempty"` - - // name of the metric - Name string `json:"name,omitempty"` - - // setpoint/target_value as specified in yelpsoa_configs - TargetValue string `json:"target_value,omitempty"` -} - -// Validate validates this h p a metric -func (m *HPAMetric) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HPAMetric) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HPAMetric) UnmarshalBinary(b []byte) error { - var res HPAMetric - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/instance_delay.go b/pkg/paastaapi/models/instance_delay.go deleted file mode 100644 index d30b602..0000000 --- a/pkg/paastaapi/models/instance_delay.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceDelay instance delay -// -// swagger:model InstanceDelay -type InstanceDelay interface{} diff --git a/pkg/paastaapi/models/instance_metadata_kafka_cluster.go b/pkg/paastaapi/models/instance_metadata_kafka_cluster.go deleted file mode 100644 index 7c2359d..0000000 --- a/pkg/paastaapi/models/instance_metadata_kafka_cluster.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceMetadataKafkaCluster Kafka instance metadata -// -// swagger:model InstanceMetadataKafkaCluster -type InstanceMetadataKafkaCluster interface{} diff --git a/pkg/paastaapi/models/instance_spec_kafka_cluster.go b/pkg/paastaapi/models/instance_spec_kafka_cluster.go deleted file mode 100644 index 826905b..0000000 --- a/pkg/paastaapi/models/instance_spec_kafka_cluster.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceSpecKafkaCluster Kafka instance spec -// -// swagger:model InstanceSpecKafkaCluster -type InstanceSpecKafkaCluster interface{} diff --git a/pkg/paastaapi/models/instance_status.go b/pkg/paastaapi/models/instance_status.go deleted file mode 100644 index fc74692..0000000 --- a/pkg/paastaapi/models/instance_status.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// InstanceStatus instance status -// -// swagger:model InstanceStatus -type InstanceStatus struct { - - // Adhoc instance status - Adhoc InstanceStatusAdhoc `json:"adhoc,omitempty"` - - // flink - Flink *InstanceStatusFlink `json:"flink,omitempty"` - - // Git sha of a service - GitSha string `json:"git_sha,omitempty"` - - // Instance name - Instance string `json:"instance,omitempty"` - - // kafkacluster - Kafkacluster *InstanceStatusKafkacluster `json:"kafkacluster,omitempty"` - - // Kubernetes instance status - Kubernetes *InstanceStatusKubernetes `json:"kubernetes,omitempty"` - - // Marathon instance status - Marathon *InstanceStatusMarathon `json:"marathon,omitempty"` - - // Service name - Service string `json:"service,omitempty"` - - // Tron instance status - Tron *InstanceStatusTron `json:"tron,omitempty"` -} - -// Validate validates this instance status -func (m *InstanceStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdhoc(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFlink(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKafkacluster(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKubernetes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarathon(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTron(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatus) validateAdhoc(formats strfmt.Registry) error { - - if swag.IsZero(m.Adhoc) { // not required - return nil - } - - if err := m.Adhoc.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("adhoc") - } - return err - } - - return nil -} - -func (m *InstanceStatus) validateFlink(formats strfmt.Registry) error { - - if swag.IsZero(m.Flink) { // not required - return nil - } - - if m.Flink != nil { - if err := m.Flink.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("flink") - } - return err - } - } - - return nil -} - -func (m *InstanceStatus) validateKafkacluster(formats strfmt.Registry) error { - - if swag.IsZero(m.Kafkacluster) { // not required - return nil - } - - if m.Kafkacluster != nil { - if err := m.Kafkacluster.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("kafkacluster") - } - return err - } - } - - return nil -} - -func (m *InstanceStatus) validateKubernetes(formats strfmt.Registry) error { - - if swag.IsZero(m.Kubernetes) { // not required - return nil - } - - if m.Kubernetes != nil { - if err := m.Kubernetes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("kubernetes") - } - return err - } - } - - return nil -} - -func (m *InstanceStatus) validateMarathon(formats strfmt.Registry) error { - - if swag.IsZero(m.Marathon) { // not required - return nil - } - - if m.Marathon != nil { - if err := m.Marathon.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("marathon") - } - return err - } - } - - return nil -} - -func (m *InstanceStatus) validateTron(formats strfmt.Registry) error { - - if swag.IsZero(m.Tron) { // not required - return nil - } - - if m.Tron != nil { - if err := m.Tron.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tron") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatus) UnmarshalBinary(b []byte) error { - var res InstanceStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// InstanceStatusFlink Nullable Flink instance status and metadata -// -// swagger:model InstanceStatusFlink -type InstanceStatusFlink struct { - - // metadata - Metadata InstanceStatusFlinkMetadata `json:"metadata,omitempty"` - - // status - Status InstanceStatusFlinkStatus `json:"status,omitempty"` -} - -// Validate validates this instance status flink -func (m *InstanceStatusFlink) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusFlink) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusFlink) UnmarshalBinary(b []byte) error { - var res InstanceStatusFlink - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// InstanceStatusKafkacluster Nullable KafkaCluster instance status and metadata -// -// swagger:model InstanceStatusKafkacluster -type InstanceStatusKafkacluster struct { - - // metadata - Metadata InstanceMetadataKafkaCluster `json:"metadata,omitempty"` - - // status - Status InstanceStatusKafkaCluster `json:"status,omitempty"` -} - -// Validate validates this instance status kafkacluster -func (m *InstanceStatusKafkacluster) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusKafkacluster) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusKafkacluster) UnmarshalBinary(b []byte) error { - var res InstanceStatusKafkacluster - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/instance_status_adhoc.go b/pkg/paastaapi/models/instance_status_adhoc.go deleted file mode 100644 index 4dd30a9..0000000 --- a/pkg/paastaapi/models/instance_status_adhoc.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// InstanceStatusAdhoc List of runs associated with job -// -// swagger:model InstanceStatusAdhoc -type InstanceStatusAdhoc []*AdhocLaunchHistory - -// Validate validates this instance status adhoc -func (m InstanceStatusAdhoc) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/models/instance_status_flink_metadata.go b/pkg/paastaapi/models/instance_status_flink_metadata.go deleted file mode 100644 index 056359b..0000000 --- a/pkg/paastaapi/models/instance_status_flink_metadata.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceStatusFlinkMetadata Flink instance metadata -// -// swagger:model InstanceStatusFlinkMetadata -type InstanceStatusFlinkMetadata interface{} diff --git a/pkg/paastaapi/models/instance_status_flink_status.go b/pkg/paastaapi/models/instance_status_flink_status.go deleted file mode 100644 index a6a0617..0000000 --- a/pkg/paastaapi/models/instance_status_flink_status.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceStatusFlinkStatus Flink instance status -// -// swagger:model InstanceStatusFlinkStatus -type InstanceStatusFlinkStatus interface{} diff --git a/pkg/paastaapi/models/instance_status_kafka_cluster.go b/pkg/paastaapi/models/instance_status_kafka_cluster.go deleted file mode 100644 index 1ce0abc..0000000 --- a/pkg/paastaapi/models/instance_status_kafka_cluster.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceStatusKafkaCluster Kafka instance status -// -// swagger:model InstanceStatusKafkaCluster -type InstanceStatusKafkaCluster interface{} diff --git a/pkg/paastaapi/models/instance_status_kubernetes.go b/pkg/paastaapi/models/instance_status_kubernetes.go deleted file mode 100644 index 8984d28..0000000 --- a/pkg/paastaapi/models/instance_status_kubernetes.go +++ /dev/null @@ -1,456 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InstanceStatusKubernetes instance status kubernetes -// -// swagger:model InstanceStatusKubernetes -type InstanceStatusKubernetes struct { - - // The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing) - // Required: true - AppCount *int32 `json:"app_count"` - - // ID of the desired version of a service instance - AppID string `json:"app_id,omitempty"` - - // autoscaling status - AutoscalingStatus *InstanceStatusKubernetesAutoscalingStatus `json:"autoscaling_status,omitempty"` - - // backoff in seconds before launching the next task - BackoffSeconds int32 `json:"backoff_seconds,omitempty"` - - // Method to transit between new and old versions of a service - // Required: true - // Enum: [brutal upthendown downthenup crossover] - BounceMethod *string `json:"bounce_method"` - - // Unix timestamp when this app was created - CreateTimestamp float32 `json:"create_timestamp,omitempty"` - - // Deploy status of a Kubernetes service - // Enum: [Running Deploying Stopped Delayed Waiting NotRunning] - DeployStatus string `json:"deploy_status,omitempty"` - - // Reason for the deploy status - DeployStatusMessage string `json:"deploy_status_message,omitempty"` - - // Desired state of a service, for Kubernetes - // Required: true - // Enum: [start stop] - DesiredState *string `json:"desired_state"` - - // Error message when a kubernetes object (Deployment/Statefulset) cannot be found - ErrorMessage string `json:"error_message,omitempty"` - - // The number of desired instances of the service - ExpectedInstanceCount int32 `json:"expected_instance_count,omitempty"` - - // The namespace this app is running - Namespace string `json:"namespace,omitempty"` - - // Pods associated to this app - Pods []*KubernetesPod `json:"pods"` - - // ReplicaSets associated to this app - Replicasets []*KubernetesReplicaSet `json:"replicasets"` - - // The number of actual running instances of the service - RunningInstanceCount int32 `json:"running_instance_count,omitempty"` - - // Status of the service in smartstack - Smartstack *SmartstackStatus `json:"smartstack,omitempty"` -} - -// Validate validates this instance status kubernetes -func (m *InstanceStatusKubernetes) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppCount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAutoscalingStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBounceMethod(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeployStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDesiredState(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePods(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReplicasets(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSmartstack(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusKubernetes) validateAppCount(formats strfmt.Registry) error { - - if err := validate.Required("app_count", "body", m.AppCount); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusKubernetes) validateAutoscalingStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.AutoscalingStatus) { // not required - return nil - } - - if m.AutoscalingStatus != nil { - if err := m.AutoscalingStatus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("autoscaling_status") - } - return err - } - } - - return nil -} - -var instanceStatusKubernetesTypeBounceMethodPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["brutal","upthendown","downthenup","crossover"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusKubernetesTypeBounceMethodPropEnum = append(instanceStatusKubernetesTypeBounceMethodPropEnum, v) - } -} - -const ( - - // InstanceStatusKubernetesBounceMethodBrutal captures enum value "brutal" - InstanceStatusKubernetesBounceMethodBrutal string = "brutal" - - // InstanceStatusKubernetesBounceMethodUpthendown captures enum value "upthendown" - InstanceStatusKubernetesBounceMethodUpthendown string = "upthendown" - - // InstanceStatusKubernetesBounceMethodDownthenup captures enum value "downthenup" - InstanceStatusKubernetesBounceMethodDownthenup string = "downthenup" - - // InstanceStatusKubernetesBounceMethodCrossover captures enum value "crossover" - InstanceStatusKubernetesBounceMethodCrossover string = "crossover" -) - -// prop value enum -func (m *InstanceStatusKubernetes) validateBounceMethodEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusKubernetesTypeBounceMethodPropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusKubernetes) validateBounceMethod(formats strfmt.Registry) error { - - if err := validate.Required("bounce_method", "body", m.BounceMethod); err != nil { - return err - } - - // value enum - if err := m.validateBounceMethodEnum("bounce_method", "body", *m.BounceMethod); err != nil { - return err - } - - return nil -} - -var instanceStatusKubernetesTypeDeployStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["Running","Deploying","Stopped","Delayed","Waiting","NotRunning"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusKubernetesTypeDeployStatusPropEnum = append(instanceStatusKubernetesTypeDeployStatusPropEnum, v) - } -} - -const ( - - // InstanceStatusKubernetesDeployStatusRunning captures enum value "Running" - InstanceStatusKubernetesDeployStatusRunning string = "Running" - - // InstanceStatusKubernetesDeployStatusDeploying captures enum value "Deploying" - InstanceStatusKubernetesDeployStatusDeploying string = "Deploying" - - // InstanceStatusKubernetesDeployStatusStopped captures enum value "Stopped" - InstanceStatusKubernetesDeployStatusStopped string = "Stopped" - - // InstanceStatusKubernetesDeployStatusDelayed captures enum value "Delayed" - InstanceStatusKubernetesDeployStatusDelayed string = "Delayed" - - // InstanceStatusKubernetesDeployStatusWaiting captures enum value "Waiting" - InstanceStatusKubernetesDeployStatusWaiting string = "Waiting" - - // InstanceStatusKubernetesDeployStatusNotRunning captures enum value "NotRunning" - InstanceStatusKubernetesDeployStatusNotRunning string = "NotRunning" -) - -// prop value enum -func (m *InstanceStatusKubernetes) validateDeployStatusEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusKubernetesTypeDeployStatusPropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusKubernetes) validateDeployStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.DeployStatus) { // not required - return nil - } - - // value enum - if err := m.validateDeployStatusEnum("deploy_status", "body", m.DeployStatus); err != nil { - return err - } - - return nil -} - -var instanceStatusKubernetesTypeDesiredStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["start","stop"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusKubernetesTypeDesiredStatePropEnum = append(instanceStatusKubernetesTypeDesiredStatePropEnum, v) - } -} - -const ( - - // InstanceStatusKubernetesDesiredStateStart captures enum value "start" - InstanceStatusKubernetesDesiredStateStart string = "start" - - // InstanceStatusKubernetesDesiredStateStop captures enum value "stop" - InstanceStatusKubernetesDesiredStateStop string = "stop" -) - -// prop value enum -func (m *InstanceStatusKubernetes) validateDesiredStateEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusKubernetesTypeDesiredStatePropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusKubernetes) validateDesiredState(formats strfmt.Registry) error { - - if err := validate.Required("desired_state", "body", m.DesiredState); err != nil { - return err - } - - // value enum - if err := m.validateDesiredStateEnum("desired_state", "body", *m.DesiredState); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusKubernetes) validatePods(formats strfmt.Registry) error { - - if swag.IsZero(m.Pods) { // not required - return nil - } - - for i := 0; i < len(m.Pods); i++ { - if swag.IsZero(m.Pods[i]) { // not required - continue - } - - if m.Pods[i] != nil { - if err := m.Pods[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pods" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *InstanceStatusKubernetes) validateReplicasets(formats strfmt.Registry) error { - - if swag.IsZero(m.Replicasets) { // not required - return nil - } - - for i := 0; i < len(m.Replicasets); i++ { - if swag.IsZero(m.Replicasets[i]) { // not required - continue - } - - if m.Replicasets[i] != nil { - if err := m.Replicasets[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("replicasets" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *InstanceStatusKubernetes) validateSmartstack(formats strfmt.Registry) error { - - if swag.IsZero(m.Smartstack) { // not required - return nil - } - - if m.Smartstack != nil { - if err := m.Smartstack.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("smartstack") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusKubernetes) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusKubernetes) UnmarshalBinary(b []byte) error { - var res InstanceStatusKubernetes - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// InstanceStatusKubernetesAutoscalingStatus HPA associated to this app -// -// swagger:model InstanceStatusKubernetesAutoscalingStatus -type InstanceStatusKubernetesAutoscalingStatus struct { - - // desired number of _instances as calculated by HPA - DesiredReplicas int64 `json:"desired_replicas,omitempty"` - - // timestamp of last autoscale - LastScaleTime string `json:"last_scale_time,omitempty"` - - // min_instances as specified in yelpsoa_configs - MaxInstances int64 `json:"max_instances,omitempty"` - - // Current metrics - Metrics []*HPAMetric `json:"metrics"` - - // min_instances as specified in yelpsoa_configs - MinInstances int64 `json:"min_instances,omitempty"` -} - -// Validate validates this instance status kubernetes autoscaling status -func (m *InstanceStatusKubernetesAutoscalingStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMetrics(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusKubernetesAutoscalingStatus) validateMetrics(formats strfmt.Registry) error { - - if swag.IsZero(m.Metrics) { // not required - return nil - } - - for i := 0; i < len(m.Metrics); i++ { - if swag.IsZero(m.Metrics[i]) { // not required - continue - } - - if m.Metrics[i] != nil { - if err := m.Metrics[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("autoscaling_status" + "." + "metrics" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusKubernetesAutoscalingStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusKubernetesAutoscalingStatus) UnmarshalBinary(b []byte) error { - var res InstanceStatusKubernetesAutoscalingStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/instance_status_marathon.go b/pkg/paastaapi/models/instance_status_marathon.go deleted file mode 100644 index 6ce4f42..0000000 --- a/pkg/paastaapi/models/instance_status_marathon.go +++ /dev/null @@ -1,390 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InstanceStatusMarathon instance status marathon -// -// swagger:model InstanceStatusMarathon -type InstanceStatusMarathon struct { - - // The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing) - // Required: true - AppCount *int32 `json:"app_count"` - - // Statuses of each app of the service - AppStatuses []*MarathonAppStatus `json:"app_statuses"` - - // Autoscaling information for the service - AutoscalingInfo *MarathonAutoscalingInfo `json:"autoscaling_info,omitempty"` - - // backoff in seconds before launching the next task - BackoffSeconds int32 `json:"backoff_seconds,omitempty"` - - // Method to transit between new and old versions of a service - // Required: true - // Enum: [brutal upthendown downthenup crossover] - BounceMethod *string `json:"bounce_method"` - - // Deploy status of a marathon service - // Enum: [Running Deploying Stopped Delayed Waiting Waiting for bounce NotRunning] - DeployStatus string `json:"deploy_status,omitempty"` - - // ID of the desired version of a service instance - DesiredAppID string `json:"desired_app_id,omitempty"` - - // Desired state of a service, for Marathon - // Required: true - // Enum: [start stop] - DesiredState *string `json:"desired_state"` - - // Status of the service in Envoy - Envoy *EnvoyStatus `json:"envoy,omitempty"` - - // Error message when a marathon job ID cannot be found - ErrorMessage string `json:"error_message,omitempty"` - - // The number of desired instances of the service - ExpectedInstanceCount int32 `json:"expected_instance_count,omitempty"` - - // Status of the service in Mesos - Mesos *MarathonMesosStatus `json:"mesos,omitempty"` - - // The number of actual running instances of the service - RunningInstanceCount int32 `json:"running_instance_count,omitempty"` - - // Status of the service in smartstack - Smartstack *SmartstackStatus `json:"smartstack,omitempty"` -} - -// Validate validates this instance status marathon -func (m *InstanceStatusMarathon) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppCount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAppStatuses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAutoscalingInfo(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBounceMethod(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeployStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDesiredState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnvoy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMesos(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSmartstack(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusMarathon) validateAppCount(formats strfmt.Registry) error { - - if err := validate.Required("app_count", "body", m.AppCount); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusMarathon) validateAppStatuses(formats strfmt.Registry) error { - - if swag.IsZero(m.AppStatuses) { // not required - return nil - } - - for i := 0; i < len(m.AppStatuses); i++ { - if swag.IsZero(m.AppStatuses[i]) { // not required - continue - } - - if m.AppStatuses[i] != nil { - if err := m.AppStatuses[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("app_statuses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *InstanceStatusMarathon) validateAutoscalingInfo(formats strfmt.Registry) error { - - if swag.IsZero(m.AutoscalingInfo) { // not required - return nil - } - - if m.AutoscalingInfo != nil { - if err := m.AutoscalingInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("autoscaling_info") - } - return err - } - } - - return nil -} - -var instanceStatusMarathonTypeBounceMethodPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["brutal","upthendown","downthenup","crossover"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusMarathonTypeBounceMethodPropEnum = append(instanceStatusMarathonTypeBounceMethodPropEnum, v) - } -} - -const ( - - // InstanceStatusMarathonBounceMethodBrutal captures enum value "brutal" - InstanceStatusMarathonBounceMethodBrutal string = "brutal" - - // InstanceStatusMarathonBounceMethodUpthendown captures enum value "upthendown" - InstanceStatusMarathonBounceMethodUpthendown string = "upthendown" - - // InstanceStatusMarathonBounceMethodDownthenup captures enum value "downthenup" - InstanceStatusMarathonBounceMethodDownthenup string = "downthenup" - - // InstanceStatusMarathonBounceMethodCrossover captures enum value "crossover" - InstanceStatusMarathonBounceMethodCrossover string = "crossover" -) - -// prop value enum -func (m *InstanceStatusMarathon) validateBounceMethodEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusMarathonTypeBounceMethodPropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusMarathon) validateBounceMethod(formats strfmt.Registry) error { - - if err := validate.Required("bounce_method", "body", m.BounceMethod); err != nil { - return err - } - - // value enum - if err := m.validateBounceMethodEnum("bounce_method", "body", *m.BounceMethod); err != nil { - return err - } - - return nil -} - -var instanceStatusMarathonTypeDeployStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["Running","Deploying","Stopped","Delayed","Waiting","Waiting for bounce","NotRunning"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusMarathonTypeDeployStatusPropEnum = append(instanceStatusMarathonTypeDeployStatusPropEnum, v) - } -} - -const ( - - // InstanceStatusMarathonDeployStatusRunning captures enum value "Running" - InstanceStatusMarathonDeployStatusRunning string = "Running" - - // InstanceStatusMarathonDeployStatusDeploying captures enum value "Deploying" - InstanceStatusMarathonDeployStatusDeploying string = "Deploying" - - // InstanceStatusMarathonDeployStatusStopped captures enum value "Stopped" - InstanceStatusMarathonDeployStatusStopped string = "Stopped" - - // InstanceStatusMarathonDeployStatusDelayed captures enum value "Delayed" - InstanceStatusMarathonDeployStatusDelayed string = "Delayed" - - // InstanceStatusMarathonDeployStatusWaiting captures enum value "Waiting" - InstanceStatusMarathonDeployStatusWaiting string = "Waiting" - - // InstanceStatusMarathonDeployStatusWaitingForBounce captures enum value "Waiting for bounce" - InstanceStatusMarathonDeployStatusWaitingForBounce string = "Waiting for bounce" - - // InstanceStatusMarathonDeployStatusNotRunning captures enum value "NotRunning" - InstanceStatusMarathonDeployStatusNotRunning string = "NotRunning" -) - -// prop value enum -func (m *InstanceStatusMarathon) validateDeployStatusEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusMarathonTypeDeployStatusPropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusMarathon) validateDeployStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.DeployStatus) { // not required - return nil - } - - // value enum - if err := m.validateDeployStatusEnum("deploy_status", "body", m.DeployStatus); err != nil { - return err - } - - return nil -} - -var instanceStatusMarathonTypeDesiredStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["start","stop"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - instanceStatusMarathonTypeDesiredStatePropEnum = append(instanceStatusMarathonTypeDesiredStatePropEnum, v) - } -} - -const ( - - // InstanceStatusMarathonDesiredStateStart captures enum value "start" - InstanceStatusMarathonDesiredStateStart string = "start" - - // InstanceStatusMarathonDesiredStateStop captures enum value "stop" - InstanceStatusMarathonDesiredStateStop string = "stop" -) - -// prop value enum -func (m *InstanceStatusMarathon) validateDesiredStateEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, instanceStatusMarathonTypeDesiredStatePropEnum); err != nil { - return err - } - return nil -} - -func (m *InstanceStatusMarathon) validateDesiredState(formats strfmt.Registry) error { - - if err := validate.Required("desired_state", "body", m.DesiredState); err != nil { - return err - } - - // value enum - if err := m.validateDesiredStateEnum("desired_state", "body", *m.DesiredState); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusMarathon) validateEnvoy(formats strfmt.Registry) error { - - if swag.IsZero(m.Envoy) { // not required - return nil - } - - if m.Envoy != nil { - if err := m.Envoy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("envoy") - } - return err - } - } - - return nil -} - -func (m *InstanceStatusMarathon) validateMesos(formats strfmt.Registry) error { - - if swag.IsZero(m.Mesos) { // not required - return nil - } - - if m.Mesos != nil { - if err := m.Mesos.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mesos") - } - return err - } - } - - return nil -} - -func (m *InstanceStatusMarathon) validateSmartstack(formats strfmt.Registry) error { - - if swag.IsZero(m.Smartstack) { // not required - return nil - } - - if m.Smartstack != nil { - if err := m.Smartstack.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("smartstack") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusMarathon) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusMarathon) UnmarshalBinary(b []byte) error { - var res InstanceStatusMarathon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/instance_status_tron.go b/pkg/paastaapi/models/instance_status_tron.go deleted file mode 100644 index dda087b..0000000 --- a/pkg/paastaapi/models/instance_status_tron.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InstanceStatusTron instance status tron -// -// swagger:model InstanceStatusTron -type InstanceStatusTron struct { - - // The command of the action - ActionCommand string `json:"action_command,omitempty"` - - // The name of the action - ActionName string `json:"action_name,omitempty"` - - // The raw command of the action - ActionRawCommand string `json:"action_raw_command,omitempty"` - - // The start time of the action - ActionStartTime string `json:"action_start_time,omitempty"` - - // The state of the action - ActionState string `json:"action_state,omitempty"` - - // The stderr command of the action - ActionStderr string `json:"action_stderr,omitempty"` - - // The stdout command of the action - ActionStdout string `json:"action_stdout,omitempty"` - - // The name of this job - // Required: true - JobName *string `json:"job_name"` - - // The job schedule of the job - JobSchedule string `json:"job_schedule,omitempty"` - - // The status of the job - JobStatus string `json:"job_status,omitempty"` - - // The dashboard url of the job - // Required: true - JobURL *string `json:"job_url"` -} - -// Validate validates this instance status tron -func (m *InstanceStatusTron) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateJobName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJobURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InstanceStatusTron) validateJobName(formats strfmt.Registry) error { - - if err := validate.Required("job_name", "body", m.JobName); err != nil { - return err - } - - return nil -} - -func (m *InstanceStatusTron) validateJobURL(formats strfmt.Registry) error { - - if err := validate.Required("job_url", "body", m.JobURL); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InstanceStatusTron) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InstanceStatusTron) UnmarshalBinary(b []byte) error { - var res InstanceStatusTron - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/instance_task.go b/pkg/paastaapi/models/instance_task.go deleted file mode 100644 index b7cfd25..0000000 --- a/pkg/paastaapi/models/instance_task.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -// InstanceTask instance task -// -// swagger:model InstanceTask -type InstanceTask interface{} diff --git a/pkg/paastaapi/models/instance_tasks.go b/pkg/paastaapi/models/instance_tasks.go deleted file mode 100644 index 3f29281..0000000 --- a/pkg/paastaapi/models/instance_tasks.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" -) - -// InstanceTasks List of tasks associated with instance -// -// swagger:model InstanceTasks -type InstanceTasks []InstanceTask - -// Validate validates this instance tasks -func (m InstanceTasks) Validate(formats strfmt.Registry) error { - return nil -} diff --git a/pkg/paastaapi/models/integer_and_error.go b/pkg/paastaapi/models/integer_and_error.go deleted file mode 100644 index 61636f3..0000000 --- a/pkg/paastaapi/models/integer_and_error.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IntegerAndError integer and error -// -// swagger:model IntegerAndError -type IntegerAndError struct { - - // error message - ErrorMessage string `json:"error_message,omitempty"` - - // value - Value int32 `json:"value,omitempty"` -} - -// Validate validates this integer and error -func (m *IntegerAndError) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IntegerAndError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IntegerAndError) UnmarshalBinary(b []byte) error { - var res IntegerAndError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/kubernetes_container.go b/pkg/paastaapi/models/kubernetes_container.go deleted file mode 100644 index 5b3a66b..0000000 --- a/pkg/paastaapi/models/kubernetes_container.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// KubernetesContainer kubernetes container -// -// swagger:model KubernetesContainer -type KubernetesContainer struct { - - // Name of the container - Name string `json:"name,omitempty"` - - // Stdout and stderr tail of the container - TailLines *TaskTailLines `json:"tail_lines,omitempty"` -} - -// Validate validates this kubernetes container -func (m *KubernetesContainer) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTailLines(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *KubernetesContainer) validateTailLines(formats strfmt.Registry) error { - - if swag.IsZero(m.TailLines) { // not required - return nil - } - - if m.TailLines != nil { - if err := m.TailLines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tail_lines") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *KubernetesContainer) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *KubernetesContainer) UnmarshalBinary(b []byte) error { - var res KubernetesContainer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/kubernetes_pod.go b/pkg/paastaapi/models/kubernetes_pod.go deleted file mode 100644 index 648f35d..0000000 --- a/pkg/paastaapi/models/kubernetes_pod.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// KubernetesPod kubernetes pod -// -// swagger:model KubernetesPod -type KubernetesPod struct { - - // containers - Containers []*KubernetesContainer `json:"containers"` - - // Time at which the pod was deployed - DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` - - // name of the pod's host - Host string `json:"host,omitempty"` - - // long message explaining the pod's state - Message *string `json:"message,omitempty"` - - // name of the pod in Kubernetes - Name string `json:"name,omitempty"` - - // The status of the pod - Phase string `json:"phase,omitempty"` - - // Whether or not the pod is ready (i.e. all containers up) - Ready bool `json:"ready,omitempty"` - - // short message explaining the pod's state - Reason *string `json:"reason,omitempty"` -} - -// Validate validates this kubernetes pod -func (m *KubernetesPod) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContainers(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *KubernetesPod) validateContainers(formats strfmt.Registry) error { - - if swag.IsZero(m.Containers) { // not required - return nil - } - - for i := 0; i < len(m.Containers); i++ { - if swag.IsZero(m.Containers[i]) { // not required - continue - } - - if m.Containers[i] != nil { - if err := m.Containers[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("containers" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *KubernetesPod) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *KubernetesPod) UnmarshalBinary(b []byte) error { - var res KubernetesPod - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/kubernetes_replica_set.go b/pkg/paastaapi/models/kubernetes_replica_set.go deleted file mode 100644 index 015b9e4..0000000 --- a/pkg/paastaapi/models/kubernetes_replica_set.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// KubernetesReplicaSet kubernetes replica set -// -// swagger:model KubernetesReplicaSet -type KubernetesReplicaSet struct { - - // Time at which the replicaset was created - CreateTimestamp float32 `json:"create_timestamp,omitempty"` - - // name of the replicaset in Kubernetes - Name string `json:"name,omitempty"` - - // number of ready replicas for the replicaset - ReadyReplicas int32 `json:"ready_replicas,omitempty"` - - // number of desired replicas for the replicaset - Replicas int32 `json:"replicas,omitempty"` -} - -// Validate validates this kubernetes replica set -func (m *KubernetesReplicaSet) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *KubernetesReplicaSet) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *KubernetesReplicaSet) UnmarshalBinary(b []byte) error { - var res KubernetesReplicaSet - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/marathon_app_status.go b/pkg/paastaapi/models/marathon_app_status.go deleted file mode 100644 index e04b0bc..0000000 --- a/pkg/paastaapi/models/marathon_app_status.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonAppStatus marathon app status -// -// swagger:model MarathonAppStatus -type MarathonAppStatus struct { - - // Backoff in seconds before launching next task - BackoffSeconds int32 `json:"backoff_seconds,omitempty"` - - // Unix timestamp when this app was created - CreateTimestamp float32 `json:"create_timestamp,omitempty"` - - // Marathon dashboard URL for this app - DashboardURL string `json:"dashboard_url,omitempty"` - - // Deploy status of this app - DeployStatus string `json:"deploy_status,omitempty"` - - // Tasks associated to this app - Tasks []*MarathonTask `json:"tasks"` - - // Number of healthy tasks for this app - TasksHealthy int32 `json:"tasks_healthy,omitempty"` - - // Number running tasks for this app - TasksRunning int32 `json:"tasks_running,omitempty"` - - // Number of staged tasks for this app - TasksStaged int32 `json:"tasks_staged,omitempty"` - - // Total number of tasks for this app - TasksTotal int32 `json:"tasks_total,omitempty"` - - // Mapping of reason offer was refused to the number of times that type of refusal was seen - UnusedOfferReasonCounts interface{} `json:"unused_offer_reason_counts,omitempty"` -} - -// Validate validates this marathon app status -func (m *MarathonAppStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTasks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MarathonAppStatus) validateTasks(formats strfmt.Registry) error { - - if swag.IsZero(m.Tasks) { // not required - return nil - } - - for i := 0; i < len(m.Tasks); i++ { - if swag.IsZero(m.Tasks[i]) { // not required - continue - } - - if m.Tasks[i] != nil { - if err := m.Tasks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tasks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonAppStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonAppStatus) UnmarshalBinary(b []byte) error { - var res MarathonAppStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/marathon_autoscaling_info.go b/pkg/paastaapi/models/marathon_autoscaling_info.go deleted file mode 100644 index cfe69c0..0000000 --- a/pkg/paastaapi/models/marathon_autoscaling_info.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonAutoscalingInfo marathon autoscaling info -// -// swagger:model MarathonAutoscalingInfo -type MarathonAutoscalingInfo struct { - - // The number of instances of the service currently running - CurrentInstances int32 `json:"current_instances,omitempty"` - - // The current utilization of the instances' allocated resources - CurrentUtilization float32 `json:"current_utilization,omitempty"` - - // The maximum number of instances that the autoscaler will scale to - MaxInstances int32 `json:"max_instances,omitempty"` - - // The minimum number of instances that the autoscaler will scale to - MinInstances int32 `json:"min_instances,omitempty"` - - // The autoscaler's current target number of instances of this service to run - TargetInstances int32 `json:"target_instances,omitempty"` -} - -// Validate validates this marathon autoscaling info -func (m *MarathonAutoscalingInfo) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonAutoscalingInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonAutoscalingInfo) UnmarshalBinary(b []byte) error { - var res MarathonAutoscalingInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/marathon_dashboard.go b/pkg/paastaapi/models/marathon_dashboard.go deleted file mode 100644 index 090d427..0000000 --- a/pkg/paastaapi/models/marathon_dashboard.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MarathonDashboard A list of Marathon service, instance, and shard url for one or more clusters -// -// swagger:model MarathonDashboard -type MarathonDashboard map[string]MarathonDashboardCluster - -// Validate validates this marathon dashboard -func (m MarathonDashboard) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - - if err := m[k].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/models/marathon_dashboard_cluster.go b/pkg/paastaapi/models/marathon_dashboard_cluster.go deleted file mode 100644 index c72ca00..0000000 --- a/pkg/paastaapi/models/marathon_dashboard_cluster.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonDashboardCluster List of all the MarathonDashboardItems for a cluster -// -// swagger:model MarathonDashboardCluster -type MarathonDashboardCluster []*MarathonDashboardItem - -// Validate validates this marathon dashboard cluster -func (m MarathonDashboardCluster) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/models/marathon_dashboard_item.go b/pkg/paastaapi/models/marathon_dashboard_item.go deleted file mode 100644 index 7a3d453..0000000 --- a/pkg/paastaapi/models/marathon_dashboard_item.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonDashboardItem Marathon service, instance, and shard url -// -// swagger:model MarathonDashboardItem -type MarathonDashboardItem struct { - - // Instance name - Instance string `json:"instance,omitempty"` - - // Service name - Service string `json:"service,omitempty"` - - // Marathon Shard URL - ShardURL string `json:"shard_url,omitempty"` -} - -// Validate validates this marathon dashboard item -func (m *MarathonDashboardItem) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonDashboardItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonDashboardItem) UnmarshalBinary(b []byte) error { - var res MarathonDashboardItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/marathon_mesos_nonrunning_task.go b/pkg/paastaapi/models/marathon_mesos_nonrunning_task.go deleted file mode 100644 index 79f6711..0000000 --- a/pkg/paastaapi/models/marathon_mesos_nonrunning_task.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonMesosNonrunningTask marathon mesos nonrunning task -// -// swagger:model MarathonMesosNonrunningTask -type MarathonMesosNonrunningTask struct { - - // The unix timestamp at which the task was deployed - DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` - - // Name of the Mesos agent on which this task is running - Hostname string `json:"hostname,omitempty"` - - // The ID of the task in Mesos - ID string `json:"id,omitempty"` - - // The current state of the task - State string `json:"state,omitempty"` - - // Stdout and stderr tail of the task - TailLines *TaskTailLines `json:"tail_lines,omitempty"` -} - -// Validate validates this marathon mesos nonrunning task -func (m *MarathonMesosNonrunningTask) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTailLines(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MarathonMesosNonrunningTask) validateTailLines(formats strfmt.Registry) error { - - if swag.IsZero(m.TailLines) { // not required - return nil - } - - if m.TailLines != nil { - if err := m.TailLines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tail_lines") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonMesosNonrunningTask) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonMesosNonrunningTask) UnmarshalBinary(b []byte) error { - var res MarathonMesosNonrunningTask - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/marathon_mesos_running_task.go b/pkg/paastaapi/models/marathon_mesos_running_task.go deleted file mode 100644 index 0f0f2b1..0000000 --- a/pkg/paastaapi/models/marathon_mesos_running_task.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonMesosRunningTask marathon mesos running task -// -// swagger:model MarathonMesosRunningTask -type MarathonMesosRunningTask struct { - - // The portion of a CPU that the task can use - CPUShares *FloatAndError `json:"cpu_shares,omitempty"` - - // The number of seconds of CPU time the task has used - CPUUsedSeconds *FloatAndError `json:"cpu_used_seconds,omitempty"` - - // The unix timestamp at which the task was deployed - DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` - - // The duration over which the task has been running in seconds - DurationSeconds int32 `json:"duration_seconds,omitempty"` - - // Name of the Mesos agent on which this task is running - Hostname string `json:"hostname,omitempty"` - - // The ID of the task in Mesos - ID string `json:"id,omitempty"` - - // The maximum amount of memory the task is allowed to use - MemLimit *IntegerAndError `json:"mem_limit,omitempty"` - - // The tasks's resident set size - Rss *IntegerAndError `json:"rss,omitempty"` - - // Stdout and stderr tail of the task - TailLines *TaskTailLines `json:"tail_lines,omitempty"` -} - -// Validate validates this marathon mesos running task -func (m *MarathonMesosRunningTask) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCPUShares(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCPUUsedSeconds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMemLimit(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRss(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTailLines(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MarathonMesosRunningTask) validateCPUShares(formats strfmt.Registry) error { - - if swag.IsZero(m.CPUShares) { // not required - return nil - } - - if m.CPUShares != nil { - if err := m.CPUShares.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cpu_shares") - } - return err - } - } - - return nil -} - -func (m *MarathonMesosRunningTask) validateCPUUsedSeconds(formats strfmt.Registry) error { - - if swag.IsZero(m.CPUUsedSeconds) { // not required - return nil - } - - if m.CPUUsedSeconds != nil { - if err := m.CPUUsedSeconds.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cpu_used_seconds") - } - return err - } - } - - return nil -} - -func (m *MarathonMesosRunningTask) validateMemLimit(formats strfmt.Registry) error { - - if swag.IsZero(m.MemLimit) { // not required - return nil - } - - if m.MemLimit != nil { - if err := m.MemLimit.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mem_limit") - } - return err - } - } - - return nil -} - -func (m *MarathonMesosRunningTask) validateRss(formats strfmt.Registry) error { - - if swag.IsZero(m.Rss) { // not required - return nil - } - - if m.Rss != nil { - if err := m.Rss.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rss") - } - return err - } - } - - return nil -} - -func (m *MarathonMesosRunningTask) validateTailLines(formats strfmt.Registry) error { - - if swag.IsZero(m.TailLines) { // not required - return nil - } - - if m.TailLines != nil { - if err := m.TailLines.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tail_lines") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonMesosRunningTask) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonMesosRunningTask) UnmarshalBinary(b []byte) error { - var res MarathonMesosRunningTask - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/marathon_mesos_status.go b/pkg/paastaapi/models/marathon_mesos_status.go deleted file mode 100644 index 2fcffac..0000000 --- a/pkg/paastaapi/models/marathon_mesos_status.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonMesosStatus marathon mesos status -// -// swagger:model MarathonMesosStatus -type MarathonMesosStatus struct { - - // Error message when Mesos tasks cannot be queried - ErrorMessage string `json:"error_message,omitempty"` - - // Non-running tasks associated to this service - NonRunningTasks []*MarathonMesosNonrunningTask `json:"non_running_tasks"` - - // The number of running Mesos tasks associated to this service - RunningTaskCount int32 `json:"running_task_count,omitempty"` - - // Currently running tasks associated to this service - RunningTasks []*MarathonMesosRunningTask `json:"running_tasks"` -} - -// Validate validates this marathon mesos status -func (m *MarathonMesosStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateNonRunningTasks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRunningTasks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MarathonMesosStatus) validateNonRunningTasks(formats strfmt.Registry) error { - - if swag.IsZero(m.NonRunningTasks) { // not required - return nil - } - - for i := 0; i < len(m.NonRunningTasks); i++ { - if swag.IsZero(m.NonRunningTasks[i]) { // not required - continue - } - - if m.NonRunningTasks[i] != nil { - if err := m.NonRunningTasks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("non_running_tasks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *MarathonMesosStatus) validateRunningTasks(formats strfmt.Registry) error { - - if swag.IsZero(m.RunningTasks) { // not required - return nil - } - - for i := 0; i < len(m.RunningTasks); i++ { - if swag.IsZero(m.RunningTasks[i]) { // not required - continue - } - - if m.RunningTasks[i] != nil { - if err := m.RunningTasks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("running_tasks" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonMesosStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonMesosStatus) UnmarshalBinary(b []byte) error { - var res MarathonMesosStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/marathon_task.go b/pkg/paastaapi/models/marathon_task.go deleted file mode 100644 index 903c1f0..0000000 --- a/pkg/paastaapi/models/marathon_task.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MarathonTask marathon task -// -// swagger:model MarathonTask -type MarathonTask struct { - - // Time at which the task was deployed - DeployedTimestamp float32 `json:"deployed_timestamp,omitempty"` - - // Name of the host on which the task is running - Host string `json:"host,omitempty"` - - // ID of the task in Mesos - ID string `json:"id,omitempty"` - - // Whether Marathon thinks the task is healthy - IsHealthy bool `json:"is_healthy,omitempty"` - - // Port on which the task is listening - Port int32 `json:"port,omitempty"` -} - -// Validate validates this marathon task -func (m *MarathonTask) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MarathonTask) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MarathonTask) UnmarshalBinary(b []byte) error { - var res MarathonTask - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/meta_status.go b/pkg/paastaapi/models/meta_status.go deleted file mode 100644 index 3257987..0000000 --- a/pkg/paastaapi/models/meta_status.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MetaStatus Result of `paasta metastatus` command -// -// swagger:model MetaStatus -type MetaStatus struct { - - // Exit code from `paasta metastatus` command - ExitCode int64 `json:"exit_code,omitempty"` - - // Output from `paasta metastatus` command - Output string `json:"output,omitempty"` -} - -// Validate validates this meta status -func (m *MetaStatus) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MetaStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MetaStatus) UnmarshalBinary(b []byte) error { - var res MetaStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/resource.go b/pkg/paastaapi/models/resource.go deleted file mode 100644 index aa529c6..0000000 --- a/pkg/paastaapi/models/resource.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Resource resource -// -// swagger:model Resource -type Resource []*ResourceItem - -// Validate validates this resource -func (m Resource) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/paastaapi/models/resource_item.go b/pkg/paastaapi/models/resource_item.go deleted file mode 100644 index b63b20b..0000000 --- a/pkg/paastaapi/models/resource_item.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResourceItem resource item -// -// swagger:model ResourceItem -type ResourceItem struct { - - // cpus - Cpus *ResourceValue `json:"cpus,omitempty"` - - // disk - Disk *ResourceValue `json:"disk,omitempty"` - - // groupings - Groupings interface{} `json:"groupings,omitempty"` - - // mem - Mem *ResourceValue `json:"mem,omitempty"` -} - -// Validate validates this resource item -func (m *ResourceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCpus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDisk(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMem(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ResourceItem) validateCpus(formats strfmt.Registry) error { - - if swag.IsZero(m.Cpus) { // not required - return nil - } - - if m.Cpus != nil { - if err := m.Cpus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cpus") - } - return err - } - } - - return nil -} - -func (m *ResourceItem) validateDisk(formats strfmt.Registry) error { - - if swag.IsZero(m.Disk) { // not required - return nil - } - - if m.Disk != nil { - if err := m.Disk.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("disk") - } - return err - } - } - - return nil -} - -func (m *ResourceItem) validateMem(formats strfmt.Registry) error { - - if swag.IsZero(m.Mem) { // not required - return nil - } - - if m.Mem != nil { - if err := m.Mem.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mem") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ResourceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResourceItem) UnmarshalBinary(b []byte) error { - var res ResourceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/resource_value.go b/pkg/paastaapi/models/resource_value.go deleted file mode 100644 index 4569060..0000000 --- a/pkg/paastaapi/models/resource_value.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ResourceValue resource value -// -// swagger:model ResourceValue -type ResourceValue struct { - - // free - Free float64 `json:"free,omitempty"` - - // total - Total float64 `json:"total,omitempty"` - - // used - Used float64 `json:"used,omitempty"` -} - -// Validate validates this resource value -func (m *ResourceValue) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ResourceValue) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ResourceValue) UnmarshalBinary(b []byte) error { - var res ResourceValue - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/smartstack_backend.go b/pkg/paastaapi/models/smartstack_backend.go deleted file mode 100644 index 74301d4..0000000 --- a/pkg/paastaapi/models/smartstack_backend.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SmartstackBackend smartstack backend -// -// swagger:model SmartstackBackend -type SmartstackBackend struct { - - // Check code reported by HAProxy - CheckCode string `json:"check_code,omitempty"` - - // Duration in ms of the last health check performed by HAProxy - CheckDuration int32 `json:"check_duration,omitempty"` - - // Status of last health check of the backend - CheckStatus string `json:"check_status,omitempty"` - - // Whether this backend has an associated task running - HasAssociatedTask bool `json:"has_associated_task,omitempty"` - - // Name of the host on which the backend is running - Hostname string `json:"hostname,omitempty"` - - // Seconds since last change in backend status - LastChange int32 `json:"last_change,omitempty"` - - // Port number on which the backend responds - Port int32 `json:"port,omitempty"` - - // Status of the backend in HAProxy - Status string `json:"status,omitempty"` -} - -// Validate validates this smartstack backend -func (m *SmartstackBackend) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SmartstackBackend) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmartstackBackend) UnmarshalBinary(b []byte) error { - var res SmartstackBackend - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/smartstack_location.go b/pkg/paastaapi/models/smartstack_location.go deleted file mode 100644 index fdc8b13..0000000 --- a/pkg/paastaapi/models/smartstack_location.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SmartstackLocation smartstack location -// -// swagger:model SmartstackLocation -type SmartstackLocation struct { - - // Smartstack backends running in this location - Backends []*SmartstackBackend `json:"backends"` - - // Name of the location - Name string `json:"name,omitempty"` - - // Number of running backends for the service in this location - RunningBackendsCount int32 `json:"running_backends_count,omitempty"` -} - -// Validate validates this smartstack location -func (m *SmartstackLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackends(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmartstackLocation) validateBackends(formats strfmt.Registry) error { - - if swag.IsZero(m.Backends) { // not required - return nil - } - - for i := 0; i < len(m.Backends); i++ { - if swag.IsZero(m.Backends[i]) { // not required - continue - } - - if m.Backends[i] != nil { - if err := m.Backends[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backends" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SmartstackLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmartstackLocation) UnmarshalBinary(b []byte) error { - var res SmartstackLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/smartstack_status.go b/pkg/paastaapi/models/smartstack_status.go deleted file mode 100644 index 15f963e..0000000 --- a/pkg/paastaapi/models/smartstack_status.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SmartstackStatus smartstack status -// -// swagger:model SmartstackStatus -type SmartstackStatus struct { - - // Number of backends expected to be present in each location - ExpectedBackendsPerLocation int32 `json:"expected_backends_per_location,omitempty"` - - // Locations the service is deployed - Locations []*SmartstackLocation `json:"locations"` - - // Registration name of the service in Smartstack - Registration string `json:"registration,omitempty"` -} - -// Validate validates this smartstack status -func (m *SmartstackStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLocations(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SmartstackStatus) validateLocations(formats strfmt.Registry) error { - - if swag.IsZero(m.Locations) { // not required - return nil - } - - for i := 0; i < len(m.Locations); i++ { - if swag.IsZero(m.Locations[i]) { // not required - continue - } - - if m.Locations[i] != nil { - if err := m.Locations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("locations" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SmartstackStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SmartstackStatus) UnmarshalBinary(b []byte) error { - var res SmartstackStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/models/task_tail_lines.go b/pkg/paastaapi/models/task_tail_lines.go deleted file mode 100644 index 1166d9d..0000000 --- a/pkg/paastaapi/models/task_tail_lines.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TaskTailLines task tail lines -// -// swagger:model TaskTailLines -type TaskTailLines struct { - - // Error message when fetching tail lines fails - ErrorMessage string `json:"error_message,omitempty"` - - // The requested number of lines from the task's stderr - Stderr []string `json:"stderr"` - - // The requested number of lines from the task's stdout - Stdout []string `json:"stdout"` -} - -// Validate validates this task tail lines -func (m *TaskTailLines) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TaskTailLines) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TaskTailLines) UnmarshalBinary(b []byte) error { - var res TaskTailLines - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/paastaapi/response.go b/pkg/paastaapi/response.go new file mode 100644 index 0000000..806df5b --- /dev/null +++ b/pkg/paastaapi/response.go @@ -0,0 +1,46 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResonse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/pkg/paastaapi/utils.go b/pkg/paastaapi/utils.go new file mode 100644 index 0000000..4439a45 --- /dev/null +++ b/pkg/paastaapi/utils.go @@ -0,0 +1,334 @@ +/* + * Paasta API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package paastaapi + +import ( + "encoding/json" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given integer value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/swagger.json b/swagger.json deleted file mode 100644 index ced2b17..0000000 --- a/swagger.json +++ /dev/null @@ -1,1682 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Paasta API", - "version": "1.0.0" - }, - "basePath": "/v1", - "schemes": [ - "http" - ], - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "tags": [ - { - "name": "service", - "description": "information about a paasta service" - } - ], - "paths": { - "/version": { - "get": { - "responses": { - "200": { - "description": "Version of paasta_tools package", - "schema": { - "type": "string" - } - } - }, - "summary": "Version of paasta_tools package", - "operationId": "showVersion" - } - }, - "/metastatus": { - "get": { - "parameters": [ - { - "in": "query", - "description": "comma separated list of command arguments", - "name": "cmd_args", - "required": true, - "type": "array", - "collectionFormat": "csv", - "items": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Detailed metastatus", - "schema": { - "$ref": "#/definitions/MetaStatus" - } - }, - "500": { - "description": "Metastatus failure" - } - }, - "summary": "Get metastatus", - "operationId": "metastatus" - } - }, - "/deploy_queue": { - "get": { - "responses": { - "200": { - "description": "Contents of deploy queue", - "schema": { - "$ref": "#/definitions/DeployQueue" - } - } - }, - "summary": "Get deploy queue contents", - "operationId": "deploy_queue" - } - }, - "/service_autoscaler/pause": { - "get": { - "responses": { - "200": { - "description": "The time until which the servcie autoscaler is paused for", - "schema": { - "type": "string" - } - }, - "500": { - "description": "Unable to talk to zookeeper" - } - }, - "summary": "Get autoscaling pause time", - "operationId": "get_service_autoscaler_pause" - }, - "post": { - "responses": { - "200": { - "description": "Service autoscaler successfully paused" - }, - "500": { - "description": "Unable to talk to zookeeper" - } - }, - "operationId": "update_service_autoscaler_pause", - "parameters": [ - { - "in": "body", - "name": "json_body", - "required": true, - "schema": { - "type": "object", - "properties": { - "minutes": { - "type": "integer" - } - } - } - } - ] - }, - "delete": { - "responses": { - "200": { - "description": "Service autoscaler successfully unpaused" - }, - "500": { - "description": "Unable to talk to zookeeper" - } - }, - "summary": "Unpause the autoscaler", - "operationId": "delete_service_autoscaler_pause" - } - }, - "/marathon_dashboard": { - "get": { - "responses": { - "200": { - "description": "List of service instances and information on their Marathon shard", - "schema": { - "$ref": "#/definitions/MarathonDashboard" - } - } - }, - "summary": "Get marathon service instances and their shards", - "operationId": "marathon_dashboard", - "tags": [ - "marathon_dashboard" - ] - } - }, - "/resources/utilization": { - "get": { - "responses": { - "200": { - "description": "Resources in the cluster, filtered and grouped by parameters", - "schema": { - "$ref": "#/definitions/Resource" - } - }, - "400": { - "description": "Poorly formated query parameters" - } - }, - "summary": "Get resources in the cluster", - "operationId": "resources", - "tags": [ - "resources" - ], - "parameters": [ - { - "in": "query", - "description": "comma separated list of keys to group by", - "name": "groupings", - "required": false, - "type": "array", - "collectionFormat": "csv", - "items": { - "type": "string" - } - }, - { - "in": "query", - "description": "List of slave filters in format 'filter=attr_name:value1,value2&filter=attr2:value3,value4'. Matches attr_name=(value1 OR value2) AND attr2=(value3 OR value4)", - "name": "filter", - "required": false, - "type": "array", - "collectionFormat": "multi", - "items": { - "type": "string", - "pattern": "(.*):(.*,)*(.*)" - } - } - ] - } - }, - "/services": { - "get": { - "responses": { - "200": { - "description": "Services and their instances on the current cluster", - "schema": { - "type": "object", - "properties": { - "services": { - "type": "array", - "items": { - "type": "array", - "items": {} - } - } - } - } - } - }, - "summary": "List service names and service instance names on the current cluster", - "operationId": "list_services_for_cluster", - "tags": [ - "service" - ] - } - }, - "/services/{service}": { - "get": { - "responses": { - "200": { - "description": "Instances of a service", - "schema": { - "type": "object", - "properties": { - "instances": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - }, - "summary": "List instances of service_name", - "operationId": "list_instances", - "tags": [ - "service" - ], - "parameters": [ - { - "in": "path", - "description": "Service name", - "name": "service", - "required": true, - "type": "string" - } - ] - } - }, - "/services/{service}/{instance}/state/{desired_state}": { - "post": { - "responses": { - "200": { - "description": "Result of instance state change" - }, - "404": { - "description": "Deployment key not found" - }, - "500": { - "description": "Instance failure" - } - }, - "summary": "Change state of service_name.instance_name", - "operationId": "instance_set_state", - "tags": [ - "service" - ], - "parameters": [ - { - "in": "path", - "description": "Service name", - "name": "service", - "required": true, - "type": "string" - }, - { - "in": "path", - "description": "Instance name", - "name": "instance", - "required": true, - "type": "string" - }, - { - "in": "path", - "description": "Desired state", - "name": "desired_state", - "required": true, - "type": "string" - } - ] - } - }, - "/services/{service}/{instance}/status": { - "get": { - "responses": { - "200": { - "description": "Detailed status of an instance", - "schema": { - "$ref": "#/definitions/InstanceStatus" - } - }, - "404": { - "description": "Deployment key not found" - }, - "500": { - "description": "Instance failure" - } - }, - "summary": "Get status of service_name.instance_name", - "operationId": "status_instance", - "tags": [ - "service" - ], - "parameters": [ - { - "in": "path", - "description": "Service name", - "name": "service", - "required": true, - "type": "string" - }, - { - "in": "path", - "description": "Instance name", - "name": "instance", - "required": true, - "type": "string" - }, - { - "in": "query", - "description": "Include verbose status information", - "name": "verbose", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "in": "query", - "description": "Include Smartstack information", - "name": "include_smartstack", - "required": false, - "type": "boolean" - }, - { - "in": "query", - "description": "Include Envoy information", - "name": "include_envoy", - "required": false, - "type": "boolean" - }, - { - "in": "query", - "description": "Include Mesos information", - "name": "include_mesos", - "required": false, - "type": "boolean" - } - ] - } - }, - "/services/{service}/{instance}/delay": { - "get": { - "responses": { - "200": { - "description": "The service is delayed for these possible reasons", - "schema": { - "$ref": "#/definitions/InstanceDelay" - } - }, - "204": { - "description": "Could not find any reasons for a delay" - }, - "404": { - "description": "Deployment key not found" - }, - "500": { - "description": "Instance failure" - } - }, - "summary": "Get the possible reasons for a deployment delay for a marathon service.instance", - "operationId": "delay_instance", - "tags": [ - "service" - ], - "parameters": [ - { - "in": "path", - "description": "Service name", - "name": "service", - "required": true, - "type": "string" - }, - { - "in": "path", - "description": "Instance name", - "name": "instance", - "required": true, - "type": "string" - } - ] - } - }, - "/services/{service}/{instance}/tasks": { - "get": { - "responses": { - "200": { - "description": "List of tasks associated with an instance", - "schema": { - "$ref": "#/definitions/InstanceTasks" - } - }, - "400": { - "description": "Bad request" - }, - "404": { - "description": "Deployment key not found" - }, - "500": { - "description": "Instance failure" - } - }, - "summary": "Get mesos tasks of service_name.instance_name", - "operationId": "tasks_instance", - "tags": [ - "service" - ], - "parameters": [ - { - "in": "path", - "description": "Service name", - "name": "service", - "required": true, - "type": "string" - }, - { - "in": "path", - "description": "Instance name", - "name": "instance", - "required": true, - "type": "string" - }, - { - "in": "query", - "description": "slave hostname to filter tasks by", - "name": "slave_hostname", - "required": false, - "type": "string" - }, - { - "in": "query", - "description": "Return slave and executor for task", - "name": "verbose", - "required": false, - "type": "boolean" - } - ] - } - }, - "/services/{service}/{instance}/tasks/{task_id}": { - "get": { - "responses": { - "200": { - "description": "Task associated with an instance with specified ID", - "schema": { - "$ref": "#/definitions/InstanceTask" - } - }, - "400": { - "description": "Bad request" - }, - "404": { - "description": "Task with ID not found" - }, - "500": { - "description": "Instance failure" - } - }, - "summary": "Get mesos task of service_name.instance_name by task_id", - "operationId": "task_instance", - "tags": [ - "service" - ], - "parameters": [ - { - "in": "path", - "description": "Service name", - "name": "service", - "required": true, - "type": "string" - }, - { - "in": "path", - "description": "Instance name", - "name": "instance", - "required": true, - "type": "string" - }, - { - "in": "path", - "description": "mesos task id", - "name": "task_id", - "required": true, - "type": "string" - }, - { - "in": "query", - "description": "Return slave and executor for task", - "name": "verbose", - "required": false, - "type": "boolean" - } - ] - } - }, - "/services/{service}/{instance}/autoscaler": { - "get": { - "responses": { - "200": { - "description": "Get desired instance count for a service instance", - "schema": { - "type": "object", - "properties": { - "desired_instances": { - "type": "integer" - } - } - } - }, - "404": { - "description": "Deployment key not found" - }, - "500": { - "description": "Instance failure" - } - }, - "summary": "Get status of service_name.instance_name", - "operationId": "get_autoscaler_count", - "tags": [ - "autoscaler" - ], - "parameters": [ - { - "in": "path", - "description": "Service name", - "name": "service", - "required": true, - "type": "string" - }, - { - "in": "path", - "description": "Instance name", - "name": "instance", - "required": true, - "type": "string" - } - ] - }, - "post": { - "responses": { - "202": { - "description": "Set desired instance count for a service instance", - "schema": { - "type": "object", - "properties": { - "desired_instances": { - "type": "integer" - }, - "status": { - "type": "string" - } - } - } - }, - "404": { - "description": "Deployment key not found" - }, - "500": { - "description": "Instance failure" - } - }, - "summary": "Get status of service_name.instance_name", - "operationId": "update_autoscaler_count", - "tags": [ - "autoscaler" - ], - "parameters": [ - { - "in": "path", - "description": "Service name", - "name": "service", - "required": true, - "type": "string" - }, - { - "in": "path", - "description": "Instance name", - "name": "instance", - "required": true, - "type": "string" - }, - { - "in": "body", - "name": "json_body", - "required": true, - "schema": { - "type": "object", - "properties": { - "desired_instances": { - "type": "integer" - }, - "calculated_instances": { - "type": "integer" - } - } - } - } - ] - } - } - }, - "definitions": { - "InstanceStatus": { - "type": "object", - "properties": { - "service": { - "type": "string", - "description": "Service name" - }, - "instance": { - "type": "string", - "description": "Instance name" - }, - "git_sha": { - "type": "string", - "description": "Git sha of a service" - }, - "marathon": { - "$ref": "#/definitions/InstanceStatusMarathon", - "description": "Marathon instance status" - }, - "kubernetes": { - "$ref": "#/definitions/InstanceStatusKubernetes", - "description": "Kubernetes instance status" - }, - "tron": { - "$ref": "#/definitions/InstanceStatusTron", - "description": "Tron instance status" - }, - "adhoc": { - "$ref": "#/definitions/InstanceStatusAdhoc", - "description": "Adhoc instance status" - }, - "flink": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/InstanceStatusFlinkStatus" - }, - "metadata": { - "$ref": "#/definitions/InstanceStatusFlinkMetadata" - } - }, - "description": "Nullable Flink instance status and metadata" - }, - "kafkacluster": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/InstanceStatusKafkaCluster" - }, - "metadata": { - "$ref": "#/definitions/InstanceMetadataKafkaCluster" - } - }, - "description": "Nullable KafkaCluster instance status and metadata" - } - } - }, - "InstanceDelay": { - "type": "object" - }, - "InstanceStatusMarathon": { - "type": "object", - "properties": { - "desired_state": { - "type": "string", - "description": "Desired state of a service, for Marathon", - "enum": [ - "start", - "stop" - ] - }, - "app_count": { - "type": "integer", - "format": "int32", - "description": "The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing)" - }, - "desired_app_id": { - "type": "string", - "description": "ID of the desired version of a service instance" - }, - "bounce_method": { - "type": "string", - "description": "Method to transit between new and old versions of a service", - "enum": [ - "brutal", - "upthendown", - "downthenup", - "crossover" - ] - }, - "deploy_status": { - "type": "string", - "description": "Deploy status of a marathon service", - "enum": [ - "Running", - "Deploying", - "Stopped", - "Delayed", - "Waiting", - "Waiting for bounce", - "NotRunning" - ] - }, - "backoff_seconds": { - "type": "integer", - "format": "int32", - "description": "backoff in seconds before launching the next task" - }, - "running_instance_count": { - "type": "integer", - "format": "int32", - "description": "The number of actual running instances of the service" - }, - "expected_instance_count": { - "type": "integer", - "format": "int32", - "description": "The number of desired instances of the service" - }, - "autoscaling_info": { - "$ref": "#/definitions/MarathonAutoscalingInfo", - "description": "Autoscaling information for the service" - }, - "app_statuses": { - "type": "array", - "description": "Statuses of each app of the service", - "items": { - "$ref": "#/definitions/MarathonAppStatus" - } - }, - "mesos": { - "$ref": "#/definitions/MarathonMesosStatus", - "description": "Status of the service in Mesos" - }, - "smartstack": { - "$ref": "#/definitions/SmartstackStatus", - "description": "Status of the service in smartstack" - }, - "envoy": { - "$ref": "#/definitions/EnvoyStatus", - "description": "Status of the service in Envoy" - }, - "error_message": { - "type": "string", - "description": "Error message when a marathon job ID cannot be found" - } - }, - "required": [ - "desired_state", - "app_count", - "bounce_method" - ] - }, - "MarathonMesosStatus": { - "type": "object", - "properties": { - "running_task_count": { - "type": "integer", - "format": "int32", - "description": "The number of running Mesos tasks associated to this service" - }, - "running_tasks": { - "type": "array", - "description": "Currently running tasks associated to this service", - "items": { - "$ref": "#/definitions/MarathonMesosRunningTask" - } - }, - "non_running_tasks": { - "type": "array", - "description": "Non-running tasks associated to this service", - "items": { - "$ref": "#/definitions/MarathonMesosNonrunningTask" - } - }, - "error_message": { - "type": "string", - "description": "Error message when Mesos tasks cannot be queried" - } - } - }, - "MarathonMesosRunningTask": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the task in Mesos" - }, - "hostname": { - "type": "string", - "description": "Name of the Mesos agent on which this task is running" - }, - "mem_limit": { - "$ref": "#/definitions/IntegerAndError", - "description": "The maximum amount of memory the task is allowed to use" - }, - "rss": { - "$ref": "#/definitions/IntegerAndError", - "description": "The tasks's resident set size" - }, - "cpu_shares": { - "$ref": "#/definitions/FloatAndError", - "description": "The portion of a CPU that the task can use" - }, - "cpu_used_seconds": { - "$ref": "#/definitions/FloatAndError", - "description": "The number of seconds of CPU time the task has used" - }, - "duration_seconds": { - "type": "integer", - "format": "int32", - "description": "The duration over which the task has been running in seconds" - }, - "deployed_timestamp": { - "type": "number", - "format": "float", - "description": "The unix timestamp at which the task was deployed" - }, - "tail_lines": { - "$ref": "#/definitions/TaskTailLines", - "description": "Stdout and stderr tail of the task" - } - } - }, - "MarathonMesosNonrunningTask": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the task in Mesos" - }, - "hostname": { - "type": "string", - "description": "Name of the Mesos agent on which this task is running" - }, - "deployed_timestamp": { - "type": "number", - "format": "float", - "description": "The unix timestamp at which the task was deployed" - }, - "state": { - "type": "string", - "description": "The current state of the task" - }, - "tail_lines": { - "$ref": "#/definitions/TaskTailLines", - "description": "Stdout and stderr tail of the task" - } - } - }, - "TaskTailLines": { - "type": "object", - "properties": { - "stdout": { - "type": "array", - "description": "The requested number of lines from the task's stdout", - "items": { - "type": "string" - } - }, - "stderr": { - "type": "array", - "description": "The requested number of lines from the task's stderr", - "items": { - "type": "string" - } - }, - "error_message": { - "type": "string", - "description": "Error message when fetching tail lines fails" - } - } - }, - "MarathonAutoscalingInfo": { - "type": "object", - "properties": { - "current_instances": { - "type": "integer", - "format": "int32", - "description": "The number of instances of the service currently running" - }, - "max_instances": { - "type": "integer", - "format": "int32", - "description": "The maximum number of instances that the autoscaler will scale to" - }, - "min_instances": { - "type": "integer", - "format": "int32", - "description": "The minimum number of instances that the autoscaler will scale to" - }, - "current_utilization": { - "type": "number", - "format": "float", - "description": "The current utilization of the instances' allocated resources" - }, - "target_instances": { - "type": "integer", - "format": "int32", - "description": "The autoscaler's current target number of instances of this service to run" - } - } - }, - "MarathonAppStatus": { - "type": "object", - "properties": { - "tasks_running": { - "type": "integer", - "format": "int32", - "description": "Number running tasks for this app" - }, - "tasks_healthy": { - "type": "integer", - "format": "int32", - "description": "Number of healthy tasks for this app" - }, - "tasks_staged": { - "type": "integer", - "format": "int32", - "description": "Number of staged tasks for this app" - }, - "tasks_total": { - "type": "integer", - "format": "int32", - "description": "Total number of tasks for this app" - }, - "create_timestamp": { - "type": "number", - "format": "float", - "description": "Unix timestamp when this app was created" - }, - "deploy_status": { - "type": "string", - "description": "Deploy status of this app" - }, - "dashboard_url": { - "type": "string", - "description": "Marathon dashboard URL for this app" - }, - "backoff_seconds": { - "type": "integer", - "format": "int32", - "description": "Backoff in seconds before launching next task" - }, - "unused_offer_reason_counts": { - "type": "object", - "description": "Mapping of reason offer was refused to the number of times that type of refusal was seen" - }, - "tasks": { - "type": "array", - "description": "Tasks associated to this app", - "items": { - "$ref": "#/definitions/MarathonTask" - } - } - } - }, - "MarathonTask": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "ID of the task in Mesos" - }, - "host": { - "type": "string", - "description": "Name of the host on which the task is running" - }, - "port": { - "type": "integer", - "format": "int32", - "description": "Port on which the task is listening" - }, - "deployed_timestamp": { - "type": "number", - "format": "float", - "description": "Time at which the task was deployed" - }, - "is_healthy": { - "type": "boolean", - "description": "Whether Marathon thinks the task is healthy" - } - } - }, - "SmartstackStatus": { - "type": "object", - "properties": { - "registration": { - "type": "string", - "description": "Registration name of the service in Smartstack" - }, - "expected_backends_per_location": { - "type": "integer", - "format": "int32", - "description": "Number of backends expected to be present in each location" - }, - "locations": { - "type": "array", - "description": "Locations the service is deployed", - "items": { - "$ref": "#/definitions/SmartstackLocation" - } - } - } - }, - "SmartstackLocation": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the location" - }, - "running_backends_count": { - "type": "integer", - "format": "int32", - "description": "Number of running backends for the service in this location" - }, - "backends": { - "type": "array", - "description": "Smartstack backends running in this location", - "items": { - "$ref": "#/definitions/SmartstackBackend" - } - } - } - }, - "SmartstackBackend": { - "type": "object", - "properties": { - "hostname": { - "type": "string", - "description": "Name of the host on which the backend is running" - }, - "port": { - "type": "integer", - "format": "int32", - "description": "Port number on which the backend responds" - }, - "status": { - "type": "string", - "description": "Status of the backend in HAProxy" - }, - "check_status": { - "type": "string", - "description": "Status of last health check of the backend" - }, - "check_code": { - "type": "string", - "description": "Check code reported by HAProxy" - }, - "check_duration": { - "type": "integer", - "format": "int32", - "description": "Duration in ms of the last health check performed by HAProxy" - }, - "last_change": { - "type": "integer", - "format": "int32", - "description": "Seconds since last change in backend status" - }, - "has_associated_task": { - "type": "boolean", - "description": "Whether this backend has an associated task running" - } - } - }, - "EnvoyStatus": { - "type": "object", - "properties": { - "registration": { - "type": "string", - "description": "Registration name of the service in Smartstack" - }, - "expected_backends_per_location": { - "type": "integer", - "format": "int32", - "description": "Number of backends expected to be present in each location" - }, - "locations": { - "type": "array", - "description": "Locations the service is deployed", - "items": { - "$ref": "#/definitions/EnvoyLocation" - } - } - } - }, - "EnvoyLocation": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the location" - }, - "running_backends_count": { - "type": "integer", - "format": "int32", - "description": "Number of running backends for the service in this location" - }, - "backends": { - "type": "array", - "description": "Envoy backends running in this location", - "items": { - "$ref": "#/definitions/EnvoyBackend" - } - }, - "is_proxied_through_casper": { - "type": "boolean", - "description": "Whether this backend is proxied through Casper" - } - } - }, - "EnvoyBackend": { - "type": "object", - "properties": { - "address": { - "type": "string", - "description": "Address of the host on which the backend is running" - }, - "port_value": { - "type": "integer", - "format": "int32", - "description": "Port number on which the backend responds" - }, - "hostname": { - "type": "string", - "description": "Name of the host on which the backend is running" - }, - "eds_health_status": { - "type": "string", - "description": "Status of the backend in Envoy as reported by the EDS" - }, - "weight": { - "type": "integer", - "format": "int32", - "description": "The weight of this backend in the cluster" - }, - "has_associated_task": { - "type": "boolean", - "description": "Whether this backend has an associated task running" - } - } - }, - "InstanceStatusKubernetes": { - "type": "object", - "properties": { - "desired_state": { - "type": "string", - "description": "Desired state of a service, for Kubernetes", - "enum": [ - "start", - "stop" - ] - }, - "app_count": { - "type": "integer", - "format": "int32", - "description": "The number of different running versions of the same service (0 for stopped, 1 for running and 1+ for bouncing)" - }, - "app_id": { - "type": "string", - "description": "ID of the desired version of a service instance" - }, - "bounce_method": { - "type": "string", - "description": "Method to transit between new and old versions of a service", - "enum": [ - "brutal", - "upthendown", - "downthenup", - "crossover" - ] - }, - "deploy_status": { - "type": "string", - "description": "Deploy status of a Kubernetes service", - "enum": [ - "Running", - "Deploying", - "Stopped", - "Delayed", - "Waiting", - "NotRunning" - ] - }, - "deploy_status_message": { - "type": "string", - "description": "Reason for the deploy status" - }, - "backoff_seconds": { - "type": "integer", - "format": "int32", - "description": "backoff in seconds before launching the next task" - }, - "running_instance_count": { - "type": "integer", - "format": "int32", - "description": "The number of actual running instances of the service" - }, - "expected_instance_count": { - "type": "integer", - "format": "int32", - "description": "The number of desired instances of the service" - }, - "create_timestamp": { - "type": "number", - "format": "float", - "description": "Unix timestamp when this app was created" - }, - "smartstack": { - "$ref": "#/definitions/SmartstackStatus", - "description": "Status of the service in smartstack" - }, - "namespace": { - "type": "string", - "description": "The namespace this app is running" - }, - "replicasets": { - "type": "array", - "description": "ReplicaSets associated to this app", - "items": { - "$ref": "#/definitions/KubernetesReplicaSet" - } - }, - "pods": { - "type": "array", - "description": "Pods associated to this app", - "items": { - "$ref": "#/definitions/KubernetesPod" - } - }, - "autoscaling_status": { - "type": "object", - "description": "HPA associated to this app", - "properties": { - "min_instances": { - "type": "integer", - "description": "min_instances as specified in yelpsoa_configs" - }, - "max_instances": { - "type": "integer", - "description": "min_instances as specified in yelpsoa_configs" - }, - "desired_replicas": { - "type": "integer", - "description": "desired number of _instances as calculated by HPA" - }, - "last_scale_time": { - "type": "string", - "description": "timestamp of last autoscale" - }, - "metrics": { - "type": "array", - "description": "Current metrics", - "items": { - "$ref": "#/definitions/HPAMetric" - } - } - } - }, - "error_message": { - "type": "string", - "description": "Error message when a kubernetes object (Deployment/Statefulset) cannot be found" - } - }, - "required": [ - "desired_state", - "app_count", - "bounce_method" - ] - }, - "HPAMetric": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "name of the metric" - }, - "target_value": { - "type": "string", - "description": "setpoint/target_value as specified in yelpsoa_configs" - }, - "current_value": { - "type": "string", - "description": "setpoint/target_value as specified in yelpsoa_configs" - } - } - }, - "KubernetesReplicaSet": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "name of the replicaset in Kubernetes" - }, - "ready_replicas": { - "type": "integer", - "format": "int32", - "description": "number of ready replicas for the replicaset" - }, - "replicas": { - "type": "integer", - "format": "int32", - "description": "number of desired replicas for the replicaset" - }, - "create_timestamp": { - "type": "number", - "format": "float", - "description": "Time at which the replicaset was created" - } - } - }, - "KubernetesPod": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "name of the pod in Kubernetes" - }, - "host": { - "type": "string", - "description": "name of the pod's host" - }, - "deployed_timestamp": { - "type": "number", - "format": "float", - "description": "Time at which the pod was deployed" - }, - "phase": { - "type": "string", - "description": "The status of the pod" - }, - "ready": { - "type": "boolean", - "description": "Whether or not the pod is ready (i.e. all containers up)" - }, - "containers": { - "type": "array", - "items": { - "$ref": "#/definitions/KubernetesContainer", - "description": "List of containers in the pod" - } - }, - "reason": { - "type": "string", - "x-nullable": true, - "description": "short message explaining the pod's state" - }, - "message": { - "type": "string", - "x-nullable": true, - "description": "long message explaining the pod's state" - } - } - }, - "KubernetesContainer": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the container" - }, - "tail_lines": { - "$ref": "#/definitions/TaskTailLines", - "description": "Stdout and stderr tail of the container" - } - } - }, - "InstanceStatusTron": { - "type": "object", - "required": [ - "job_name", - "job_url" - ], - "properties": { - "job_name": { - "type": "string", - "description": "The name of this job" - }, - "job_status": { - "type": "string", - "description": "The status of the job" - }, - "job_schedule": { - "type": "string", - "description": "The job schedule of the job" - }, - "job_url": { - "type": "string", - "description": "The dashboard url of the job" - }, - "action_name": { - "type": "string", - "description": "The name of the action" - }, - "action_state": { - "type": "string", - "description": "The state of the action" - }, - "action_raw_command": { - "type": "string", - "description": "The raw command of the action" - }, - "action_command": { - "type": "string", - "description": "The command of the action" - }, - "action_start_time": { - "type": "string", - "description": "The start time of the action" - }, - "action_stderr": { - "type": "string", - "description": "The stderr command of the action" - }, - "action_stdout": { - "type": "string", - "description": "The stdout command of the action" - } - } - }, - "InstanceStatusFlinkStatus": { - "type": "object", - "description": "Flink instance status" - }, - "InstanceStatusFlinkMetadata": { - "type": "object", - "description": "Flink instance metadata" - }, - "InstanceStatusKafkaCluster": { - "type": "object", - "description": "Kafka instance status" - }, - "InstanceMetadataKafkaCluster": { - "type": "object", - "description": "Kafka instance metadata" - }, - "InstanceSpecKafkaCluster": { - "type": "object", - "description": "Kafka instance spec" - }, - "InstanceTasks": { - "type": "array", - "description": "List of tasks associated with instance", - "items": { - "$ref": "#/definitions/InstanceTask" - } - }, - "InstanceTask": { - "type": "object" - }, - "InstanceStatusAdhoc": { - "type": "array", - "description": "List of runs associated with job", - "items": { - "$ref": "#/definitions/AdhocLaunchHistory" - } - }, - "AdhocLaunchHistory": { - "type": "object", - "description": "A single run", - "properties": { - "launch_time": { - "type": "string", - "description": "when the job was launched" - }, - "run_id": { - "type": "string", - "description": "id of the single run" - }, - "framework_id": { - "type": "string", - "description": "framework id" - } - } - }, - "MarathonDashboard": { - "type": "object", - "description": "A list of Marathon service, instance, and shard url for one or more clusters", - "additionalProperties": { - "$ref": "#/definitions/MarathonDashboardCluster" - } - }, - "MarathonDashboardCluster": { - "type": "array", - "description": "List of all the MarathonDashboardItems for a cluster", - "items": { - "$ref": "#/definitions/MarathonDashboardItem" - } - }, - "MarathonDashboardItem": { - "type": "object", - "description": "Marathon service, instance, and shard url", - "properties": { - "service": { - "type": "string", - "description": "Service name" - }, - "instance": { - "type": "string", - "description": "Instance name" - }, - "shard_url": { - "type": "string", - "description": "Marathon Shard URL" - } - } - }, - "MetaStatus": { - "type": "object", - "description": "Result of `paasta metastatus` command", - "properties": { - "output": { - "type": "string", - "description": "Output from `paasta metastatus` command" - }, - "exit_code": { - "type": "integer", - "description": "Exit code from `paasta metastatus` command" - } - } - }, - "DeployQueue": { - "type": "object", - "description": "Current state of the deployd queue", - "properties": { - "available_service_instances": { - "type": "array", - "description": "Service instances that are ready to be acted on by deployd", - "items": { - "$ref": "#/definitions/DeployQueueServiceInstance" - } - }, - "unavailable_service_instances": { - "type": "array", - "description": "Service instances that deployd is waiting to act on", - "items": { - "$ref": "#/definitions/DeployQueueServiceInstance" - } - } - } - }, - "DeployQueueServiceInstance": { - "type": "object", - "description": "An instance of a service in the deploy queue", - "properties": { - "service": { - "type": "string", - "description": "Name of the service" - }, - "instance": { - "type": "string", - "description": "Name of the instance of the service" - }, - "bounce_by": { - "type": "number", - "format": "float", - "description": "Desired timestamp by which the service instance should be bounced" - }, - "wait_until": { - "type": "number", - "format": "float", - "description": "Timestamp before which no action should be taken on this service instance" - }, - "enqueue_time": { - "type": "number", - "format": "float", - "description": "Timestamp at which the service instance was last added to the queue" - }, - "bounce_start_time": { - "type": "number", - "format": "float", - "description": "Timestamp at which service instance was first added to the queue" - }, - "watcher": { - "type": "string", - "description": "The process that enqueued the task" - }, - "failures": { - "type": "integer", - "format": "int32", - "description": "Number of times deployment actions have failed on this service instance" - }, - "processed_count": { - "type": "integer", - "format": "int32", - "description": "Number of times any deployment action has been taken on this service instance" - } - } - }, - "Resource": { - "type": "array", - "items": { - "$ref": "#/definitions/ResourceItem" - } - }, - "ResourceItem": { - "type": "object", - "properties": { - "groupings": { - "type": "object" - }, - "cpus": { - "$ref": "#/definitions/ResourceValue" - }, - "mem": { - "$ref": "#/definitions/ResourceValue" - }, - "disk": { - "$ref": "#/definitions/ResourceValue" - } - } - }, - "ResourceValue": { - "type": "object", - "properties": { - "free": { - "type": "number" - }, - "used": { - "type": "number" - }, - "total": { - "type": "number" - } - } - }, - "FloatAndError": { - "type": "object", - "properties": { - "value": { - "type": "number", - "format": "float" - }, - "error_message": { - "type": "string" - } - } - }, - "IntegerAndError": { - "type": "object", - "properties": { - "value": { - "type": "integer", - "format": "int32" - }, - "error_message": { - "type": "string" - } - } - } - } -}