YARN-8814. Yarn Service Upgrade: Update the swagger definition.

Contributed by Chandni Singh
This commit is contained in:
Eric Yang 2018-10-23 19:04:58 -04:00
parent 823bb5dda8
commit a0c0b793c3
1 changed files with 100 additions and 11 deletions

View File

@ -162,10 +162,35 @@ paths:
description: Unexpected error description: Unexpected error
schema: schema:
$ref: '#/definitions/ServiceStatus' $ref: '#/definitions/ServiceStatus'
/app/v1/services/{service_name}/components:
put:
summary: Upgrade multiple components.
description: Set a component's desired number of instanes
parameters:
- name: service_name
in: path
description: Service name
required: true
type: string
- name: components
in: body
description: Components to be upgraded with state set to UPGRADING
required: true
schema:
type: array
items:
$ref: '#/definitions/Component'
responses:
200:
description: Upgrading components.
404:
description: Service does not exist
default:
description: Unexpected error
/app/v1/services/{service_name}/components/{component_name}: /app/v1/services/{service_name}/components/{component_name}:
put: put:
summary: Flex a component's number of instances. summary: Flex a component's number of instances or upgrade all the instances of the component.
description: Set a component's desired number of instanes description: Set a component's desired number of instanes or upgrade the component.
parameters: parameters:
- name: service_name - name: service_name
in: path in: path
@ -179,7 +204,7 @@ paths:
type: string type: string
- name: Component - name: Component
in: body in: body
description: The definition of a component which contains the updated number of instances. description: For flex, the definition of a component which contains the updated number of instances with state set to FLEXING. For upgrade, component definition with state set to UPGRADING.
required: true required: true
schema: schema:
$ref: '#/definitions/Component' $ref: '#/definitions/Component'
@ -213,8 +238,7 @@ paths:
- name: containerState - name: containerState
in: query in: query
description: Container state. Multiple values are allowed. description: Container state. Multiple values are allowed.
schema: type: string
$ref: '#/definitions/ContainerState'
responses: responses:
200: 200:
description: Component instances. description: Component instances.
@ -226,7 +250,63 @@ paths:
description: Service does not exist description: Service does not exist
default: default:
description: Unexpected error description: Unexpected error
put:
summary: Upgrade multiple component instances.
description: Upgrades multiple component instances
parameters:
- name: service_name
in: path
description: Service name
required: true
type: string type: string
- name: component instances
in: body
description: Component instances with state set to UPGRADING
required: true
schema:
type: array
items:
$ref: '#/definitions/Container'
responses:
200:
description: Upgrading component instance
404:
description: Service does not exist
default:
description: Unexpected error
/app/v1/services/{service_name}/components/{component_name}/component-instances/{component_instance_name}:
put:
summary: Upgrade a single component instance.
description: Upgrades a single component instance
parameters:
- name: service_name
in: path
description: Service name
required: true
type: string
- name: component_name
in: path
description: Component name
required: true
type: string
- name: component_instance_name
in: path
description: Component instance name
required: true
type: string
- name: component instance
in: body
description: Component instance with state UPGRADING
required: true
schema:
$ref: '#/definitions/Container'
responses:
200:
description: Upgrading component instance
404:
description: Service does not exist
default:
description: Unexpected error
definitions: definitions:
Service: Service:
description: a service resource has the following attributes. description: a service resource has the following attributes.
@ -586,6 +666,10 @@ definitions:
- FAILED - FAILED
- FLEX - FLEX
- UPGRADING - UPGRADING
- UPGRADING_AUTO_FINALIZE
- EXPRESS_UPGRADING
- SUCCEEDED
- CANCEL_UPGRADING
ContainerState: ContainerState:
description: The current state of the container of a service. description: The current state of the container of a service.
properties: properties:
@ -593,9 +677,14 @@ definitions:
type: string type: string
description: enum of the state of the container description: enum of the state of the container
enum: enum:
- INIT - RUNNING_BUT_UNREADY
- STARTED
- READY - READY
- STOPPED
- NEEDS_UPGRADE
- UPGRADING
- SUCCEEDED
- FAILED
- FAILED_UPGRADE
ComponentState: ComponentState:
description: The state of the component description: The state of the component
properties: properties:
@ -603,10 +692,12 @@ definitions:
type: string type: string
description: enum of the state of the component description: enum of the state of the component
enum: enum:
- INIT
- FLEXING - FLEXING
- STABLE - STABLE
- NEEDS_UPGRADE
- UPGRADING - UPGRADING
- SUCCEEDED
- FAILED
ServiceStatus: ServiceStatus:
description: The current status of a submitted service, returned as a response to the GET API. description: The current status of a submitted service, returned as a response to the GET API.
properties: properties:
@ -641,6 +732,4 @@ definitions:
type: array type: array
description: Containers of the component. description: Containers of the component.
items: items:
$ref: '#/definitions/Container' $ref: '#/definitions/Container'