ranger/orm/services/customer_manager/swagger/swagger.yaml
jh629g 36ebd47daa Remove Deprecated Features in Ranger
As of Stein, injected_files, injected_file_content_bytes,
and injected_path_content_bytes have been deprecated.
This patchset removes those variables.

Change-Id: I0a7fa6860a8f5573ae2435c3740c7fb4ec4bb54e
2019-11-25 12:16:00 -06:00

1066 lines
26 KiB
YAML

# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: '2.0'
info:
version: 3.5.0
title: CMS API
description: CMS API.
All api's should supply two header parameters
X-Auth-Token - Token received from keystone, and
X-Auth-Region - The region
# the domain of the service
host: 127.0.0.1
# array of all schemes that your API supports
schemes:
- https
# will be prefixed to all paths
basePath: /v1/orm
produces:
- application/json
paths:
/customers:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
post:
summary: create customer
description: |
Create a new customer and send it to Heat to create this customer in each region needed
Return all data of the new customer
parameters:
- name: full customer
in: body
description: input body to create full customer
schema:
$ref: '#/definitions/Customer'
required: true
tags:
- Customer
responses:
201:
description: customer is created
schema:
$ref: '#/definitions/Customer'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
409:
description: Duplicate Error
schema:
$ref: '#/definitions/409'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
get:
summary: get a list of customers by criteria (region, user, starts_with, contains, metadata)
description: |
The get customers retrieves all customers that match the above criteria
parameters:
- name: region
in: query
type: "string"
required: false
description: Customer region
- name: user
in: query
type: "string"
description: Customer user
required: false
- name: starts_with
in: query
type: "string"
description: Get only customers whose name starts with this string
required: false
- name: contains
in: query
type: "string"
description: Get only customers whose name contains this string
required: false
- name: metadata
in: query
type: "array"
items:
type: string
description: Metadata keys
required: false
tags:
- Customer
responses:
200:
description: list of customers by criteria
schema:
$ref: '#/definitions/Customers'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/customers/{customer_uuid}:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
get:
summary: Get customer by id or name
description: Get a single customer by id or name
parameters:
- name: customer_uuid
in: path
type: string
description: UUID or name of the requested customer
required: true
tags:
- Customer
responses:
200:
description: the requested customer
schema:
$ref: '#/definitions/Customer'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
delete:
summary: Delete a single customer by id
description: The user needs to remove all regions one by one before deleting the customer, otherwise the deletion will fail
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the customer to delete
required: true
tags:
- Customer
responses:
405:
description: Method not allowed
schema:
$ref: '#/definitions/Error'
204:
description: no content
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
summary: Update customer
description: Update a customer by id
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: full customer
in: body
description: Input body to update full customer
schema:
$ref: '#/definitions/Customer'
required: true
tags:
- Customer
responses:
201:
description: customer is updated
schema:
$ref: '#/definitions/Customer'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/customer/{customer_uuid}/regions:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
post:
summary: Add a region to a customer
description: |
it will add the regions in the body to the customer and send them to Heat to be created
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: regions
in: body
description: list of full regions
schema:
$ref: '#/definitions/Regions'
required: true
tags:
- Regions
responses:
201:
description: regions added to customer
schema:
$ref: '#/definitions/OutputRegions'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
409:
description: Duplicate Error
schema:
$ref: '#/definitions/409'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
summary: Replace regions in a customer
description: |
it will remove all existing regions in the customer and replace them in the regions in request body and the old regions will be sent to be removed from heat and the new ones will be sent as created
parameters:
- name: customer_uuid
in: path
type: string
description: uuid of the requested customer
required: true
- name: regions
in: body
description: list of full regions
schema:
$ref: '#/definitions/Regions'
required: true
tags:
- Regions
responses:
201:
description: regions added to customer
schema:
$ref: '#/definitions/OutputRegions'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/customer/{customer_uuid}/regions/{region_name}:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
delete:
summary: Delete a region from a customer
description: Delete a region from a customer by region name and send it to Heat to be removed
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: region_name
in: path
type: string
description: Name of the region to delete
required: true
tags:
- Regions
responses:
204:
description: no content
404:
description: customer not found
schema:
$ref: '#/definitions/404'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/customer/{customer_uuid}/enabled/:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
put:
summary: enable/disable customer
description: Set the customer as enabled/disabled in all of its regions and send them to Heat to be modified
parameters:
- name: customer_uuid
in: path
type: string
description: uuid of the requested customer
required: true
- name: enabled input json
in: body
description: input body enable/disable customer
schema:
$ref: '#/definitions/Enable'
required: true
tags:
- Enabled
responses:
200:
description: customer is enabled/disabled
schema:
$ref: '#/definitions/Customer'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/customers/{customer_uuid}/metadata:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
post:
summary: Add metadata to a customer
description: Add metadata to a customer and send it to Heat
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: metadata
in: body
description: The metadata to be added to the customer
schema:
$ref: '#/definitions/MetadataWrapper'
required: true
tags:
- Metadata
responses:
201:
description: Metadata added successfully
schema:
$ref: '#/definitions/OutputCustomerWrapper'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
409:
description: Some of the metadata keys already exist (conflict error)
schema:
$ref: '#/definitions/409'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
summary: Replace the metadata of a customer
description: Replace the metadata of a customer and send it to Heat
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: metadata
in: body
description: The new metadata to be applied to the customer
schema:
$ref: '#/definitions/MetadataWrapper'
required: true
tags:
- Metadata
responses:
200:
description: Metadata added successfully
schema:
$ref: '#/definitions/OutputCustomerWrapper'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/customers/{customer_uuid}/users:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
post:
summary: Add default users
description: Add default users to a customer and send it to Heat
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: users
in: body
description: The default users to add
schema:
$ref: '#/definitions/Users'
required: true
tags:
- Default Users
responses:
201:
description: Default users added successfully
schema:
$ref: '#/definitions/OutputUserWrapper'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
409:
description: Some of the default users already exist (conflict error)
schema:
$ref: '#/definitions/409'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
summary: Replace default users
description: Replace default users of a customer and send it to Heat
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: users
in: body
description: The new default users to be applied to the customer
schema:
$ref: '#/definitions/Users'
required: true
tags:
- Default Users
responses:
200:
description: Default users replaced successfully
schema:
$ref: '#/definitions/OutputUserWrapper'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/customer/{customer_uuid}/users/{user_id}:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
delete:
summary: Delete a default user from a customer
description: Delete a default user from a customer and send it to Heat to be removed
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: user_id
in: path
type: string
description: ID of the default user to delete
required: true
tags:
- Default Users
responses:
204:
description: no content
404:
description: customer not found
schema:
$ref: '#/definitions/404'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/customers/{customer_uuid}/regions/{region_name}/users:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
post:
summary: Add users (in a region)
description: Add users to a customer in a specific region and send it to Heat
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: region_name
in: path
type: string
description: Name of the region in which the users are to be added
required: true
- name: users
in: body
description: The users to add
schema:
$ref: '#/definitions/Users'
required: true
tags:
- Users
responses:
201:
description: Users added successfully
schema:
$ref: '#/definitions/OutputUserWrapper'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
409:
description: Some of the users already exist (conflict error)
schema:
$ref: '#/definitions/409'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
summary: Replace users (in a region)
description: Replace users of a customer in a specific region and send it to Heat
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: region_name
in: path
type: string
description: Name of the region in which the users are to be replaced
required: true
- name: users
in: body
description: The new users to be applied to the customer
schema:
$ref: '#/definitions/Users'
required: true
tags:
- Users
responses:
200:
description: Users replaced successfully
schema:
$ref: '#/definitions/OutputUserWrapper'
404:
description: customer not found
schema:
$ref: '#/definitions/404'
400:
description: Bad Request Error
schema:
$ref: '#/definitions/400'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/customer/{customer_uuid}/regions/{region_name}/users/{user_id}:
parameters:
- $ref: "#/parameters/Token"
- $ref: "#/parameters/Region"
- $ref: "#/parameters/Client"
delete:
summary: Delete a user from a customer (in a region)
description: Delete a user from a customer by region name and send it to Heat to be removed
parameters:
- name: customer_uuid
in: path
type: string
description: UUID of the requested customer
required: true
- name: user_id
in: path
type: string
description: ID of the user to delete
required: true
- name: region_name
in: path
type: string
description: Name of the region
required: true
tags:
- Users
responses:
204:
description: no content
404:
description: customer not found
schema:
$ref: '#/definitions/404'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
Customer:
type: object
required:
- description
- enabled
- name
- users
- defaultQuotas
properties:
description:
type: string
description: Customer description
example: The best customer
enabled:
type: boolean
description: Tells if the customer is enabled
example: true
name:
type: string
description: Customer name
example: MyCustomer
metadata:
$ref: '#/definitions/Dictionary'
regions:
type: array
items:
$ref: '#/definitions/Region'
users:
type: array
items:
$ref: '#/definitions/User'
defaultQuotas:
type: array
items:
$ref: '#/definitions/Quota'
status:
type: string
description: Customer last operation status
example: Success
custId:
type: string
description: Customer ID
uuid:
type: string
description: Same as custId
Enable:
type: object
properties:
enabled:
type: boolean
description: can be true or false
example: true
CustomersItem:
type: object
properties:
status:
type: string
description:
type: string
enabled:
type: boolean
num_regions:
type: integer
regions:
type: array
items:
$ref: '#/definitions/Region'
id:
type: string
name:
type: string
Customers:
type: array
items:
$ref: '#/definitions/CustomersItem'
OutputCustomer:
type: object
properties:
id:
type: string
links:
$ref: '#/definitions/Dictionary'
created:
type: string
OutputCustomerWrapper:
type: object
properties:
customer:
$ref: '#/definitions/OutputCustomer'
transaction_id:
type: string
MetadataWrapper:
type: object
properties:
metadata:
$ref: '#/definitions/Dictionary'
User:
type: object
properties:
id:
type: string
role:
type: array
items:
type: string
Users:
type: array
items:
$ref: '#/definitions/User'
OutputUser:
type: object
properties:
added:
type: string
id:
type: string
links:
$ref: '#/definitions/Dictionary'
OutputUserWrapper:
type: object
properties:
users:
type: array
items:
$ref: '#/definitions/OutputUser'
transaction_id:
type: string
Compute:
type: object
required:
- instances
- key_pairs
- ram
properties:
instances:
type: string
key_pairs:
type: string
ram:
type: string
vcpus:
type: string
metadata_items:
type: string
floating_ips:
type: string
fixed_ips:
type: string
server_groups:
type: string
server_group_members:
type: string
Storage:
type: object
required:
- gigabytes
- snapshots
- volumes
properties:
gigabytes:
type: string
snapshots:
type: string
volumes:
type: string
Network:
type: object
required:
- floating_ips
- networks
- ports
- routers
- subnets
properties:
floating_ips:
type: string
networks:
type: string
ports:
type: string
routers:
type: string
subnets:
type: string
security_groups:
type: string
security_group_rules:
type: string
health_monitors:
type: string
members:
type: string
nat_instance:
type: string
pools:
type: string
route_table:
type: string
vips:
type: string
Quota:
type: object
properties:
compute:
type: array
items:
$ref: '#/definitions/Compute'
storage:
type: array
items:
$ref: '#/definitions/Storage'
network:
type: array
items:
$ref: '#/definitions/Network'
Region:
type: object
required:
- name
properties:
name:
type: string
example: mtn17
type:
type: string
description: single or group
example: single
status:
type: string
readOnly: true
example: Error
quotas:
type: array
items:
$ref: '#/definitions/Quota'
users:
type: array
items:
$ref: '#/definitions/User'
error_message:
type: string
readOnly: true
example: fail to create
OutputRegion:
type: object
properties:
name:
type: string
example: tn17
type:
type: string
description: single or group
example: single
status:
type: string
error_message:
type: string
checksum:
type: string
example: '1024'
size:
type: string
example: '123'
virtual_size:
type: string
example: '123'
OutputRegions:
type: object
properties:
regions:
type: array
items:
$ref: '#/definitions/OutputRegion'
Regions:
type: array
items:
$ref: '#/definitions/Region'
Error:
type: object
properties:
code:
type: integer
format: int32
type:
type: string
transaction_id:
type: string
message:
type: string
details:
type: string
409:
type: object
properties:
code:
type: integer
format: int32
type:
type: string
transaction_id:
type: string
message:
type: string
details:
type: string
400:
type: object
properties:
code:
type: integer
format: int32
type:
type: string
transaction_id:
type: string
message:
type: string
details:
type: string
404:
type: object
properties:
code:
type: integer
format: int32
type:
type: string
transaction_id:
type: string
message:
type: string
details:
type: string
Dictionary:
type: object
additionalProperties:
type: "string"
example: {"property1": "value1"}
parameters:
Token:
name: X-Auth-Token
in: header
description: Token from keystone
required: true
type: string
Region:
name: X-Auth-Region
in: header
description: Region
required: true
type: string
Client:
name: X-RANGER-Client
in: header
description: Client name
required: false
type: string