
Removes and replaces potentially valid ip addresses with 127.0.0.1 Change-Id: I5985a033f8b1224e5ab9ea0ee78a55966b30f041
749 lines
19 KiB
YAML
749 lines
19 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: Flavors API
|
|
description: Flavors api's
|
|
All api's should supply two header parameters
|
|
X-Auth-Token - Token received from keystone
|
|
X-Auth-Region - The region
|
|
There is an optional header parameter X-RANGER-Client which tells who is the client for the api
|
|
|
|
contact:
|
|
email: zb593m@att.com
|
|
|
|
# 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:
|
|
/flavors:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
|
|
post:
|
|
summary: create a new flavor
|
|
description: |
|
|
The post flavors endpoint create a new flavor and send it to the RDS which send it to Heat to create this flavor in each region needed
|
|
Return all data of the new flavor
|
|
|
|
parameters:
|
|
- name: full_flavor
|
|
in: body
|
|
description: Full flavor to create.
|
|
schema:
|
|
$ref: "#/definitions/Flavor"
|
|
required: true
|
|
x-example_1:
|
|
{
|
|
"name": "zion"
|
|
}
|
|
|
|
tags:
|
|
- Flavors
|
|
|
|
responses:
|
|
200:
|
|
description: The new created flavor
|
|
schema:
|
|
$ref: '#/definitions/Flavor'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
get:
|
|
summary: get a list of flavors by criteria (visibility, region, tenant, series, start_with, contains, alias)
|
|
description: |
|
|
The get flavors endpoint retrieve all flavors matched to the above criterias
|
|
parameters:
|
|
- name: visibility
|
|
in: query
|
|
type: "string"
|
|
enum: [
|
|
"public",
|
|
"private"
|
|
]
|
|
description: public or private flavor
|
|
- name: region
|
|
in: query
|
|
type: "string"
|
|
description: region name.
|
|
required: false
|
|
- name: tenant
|
|
in: query
|
|
type: "string"
|
|
description: tenant name.
|
|
required: false
|
|
- name: series
|
|
in: query
|
|
type: "string"
|
|
description: series code
|
|
required: false
|
|
- name: start_with
|
|
in: query
|
|
type: "string"
|
|
description: name start with
|
|
required: false
|
|
- name: contains
|
|
in: query
|
|
type: "string"
|
|
description: name contains
|
|
required: false
|
|
- name: alias
|
|
in: query
|
|
type: "string"
|
|
description: alias of flavor.
|
|
required: false
|
|
tags:
|
|
- Flavors
|
|
responses:
|
|
200:
|
|
description: List of flavors matched all criteria
|
|
schema:
|
|
$ref: '#/definitions/Flavors'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
/flavors/{flavor_uuid_or_name}:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
get:
|
|
summary: get a flavor by uuid or name
|
|
description: |
|
|
The get flavors endpoint retrieve a specipic flavor by uuid or name, you get the uuid and the name from the result of creation of this flavor or by using list api
|
|
parameters:
|
|
- name: flavor_uuid_or_name
|
|
in: path
|
|
type: string
|
|
description: uuid or name of the requested flavor.
|
|
required: true
|
|
tags:
|
|
- Flavors
|
|
responses:
|
|
200:
|
|
description: The requested flavor
|
|
schema:
|
|
$ref: '#/definitions/Flavor'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
delete:
|
|
summary: delete a flavor by uuid or name
|
|
description: |
|
|
The delete flavors endpoint delete a specipic flavor by uuid or name, you get the uuid and the name from the result of creation of this flavor or by using list api
|
|
parameters:
|
|
- name: flavor_uuid_or_name
|
|
in: path
|
|
type: string
|
|
description: uuid or name of the requested flavor.
|
|
required: true
|
|
tags:
|
|
- Flavors
|
|
responses:
|
|
204:
|
|
description: Flavor deleted
|
|
schema:
|
|
$ref: '#/definitions/Flavor'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
/flavors/{flavor_uuid}/regions:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
post:
|
|
summary: add new regions to flavor
|
|
description: |
|
|
The post regions inflavors endpoint add one or more regions to the already existing regions for this flavor
|
|
Return the full flavor after adding regions
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
- name: list_of_regions
|
|
in: body
|
|
schema:
|
|
$ref: '#/definitions/RegionsWrapper'
|
|
description: list of regions to add to a flavor.
|
|
required: true
|
|
tags:
|
|
- Regions
|
|
|
|
responses:
|
|
200:
|
|
description: The new created flavor
|
|
schema:
|
|
$ref: '#/definitions/Flavor'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
/flavors/{flavor_uuid}/regions/{region_name}:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
delete:
|
|
summary: delete region from flavor
|
|
description: |
|
|
The delete region from flavor endpoint delete a region from flavor
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
- name: region_name
|
|
in: path
|
|
type: string
|
|
description: region name
|
|
required: true
|
|
tags:
|
|
- Regions
|
|
|
|
responses:
|
|
201:
|
|
description: The region was deleted from flavor
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
/flavors/{flavor_uuid}/tags:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
get:
|
|
summary: get tags of flavor
|
|
description: |
|
|
The get tags of flavor endpoint get all tags related to supplied flavor
|
|
Return list of flavor tags
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
tags:
|
|
- Tags
|
|
|
|
responses:
|
|
200:
|
|
description: The new created flavor
|
|
schema:
|
|
$ref: '#/definitions/TagsWrapper'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
post:
|
|
summary: add new tags to flavor
|
|
description: |
|
|
The post tags inflavors endpoint add one or more tags to the already existing tags for this flavor
|
|
Return list of flavor tags adding tags
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
|
|
- name: list_of_tags
|
|
in: body
|
|
schema:
|
|
$ref: '#/definitions/TagsWrapper'
|
|
description: list of tagss to add to the flavor.
|
|
required: true
|
|
tags:
|
|
- Tags
|
|
|
|
responses:
|
|
200:
|
|
description: The new created flavor
|
|
schema:
|
|
$ref: '#/definitions/TagsWrapper'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
put:
|
|
summary: replace flavors tag by the supplied list
|
|
description: |
|
|
The put tags inflavors endpoint replace existing tags by new tags suplied
|
|
Return list of flavor tags after replacing tags
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
|
|
- name: list_of_tags
|
|
in: body
|
|
schema:
|
|
$ref: '#/definitions/TagsWrapper'
|
|
description: list of tagss to add to the flavor.
|
|
required: true
|
|
tags:
|
|
- Tags
|
|
|
|
responses:
|
|
200:
|
|
description: The new created flavor
|
|
schema:
|
|
$ref: '#/definitions/TagsWrapper'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
/flavors/{flavor_uuid}/tagss/{tag_name}:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
delete:
|
|
summary: delete specific tag by name from flavor
|
|
description: |
|
|
The delete tag from flavor endpoint delete a tag from flavor
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
- name: tag_name
|
|
in: path
|
|
type: string
|
|
description: tag name to delete
|
|
required: true
|
|
tags:
|
|
- Tags
|
|
|
|
responses:
|
|
201:
|
|
description: The region was deleted from flavor
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
/flavors/{flavor_uuid}/os_extra_spec:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
get:
|
|
summary: get extra specs of flavor
|
|
description: |
|
|
The get extra specs of flavor endpoint get all extra specs related to supplied flavor
|
|
Return list of flavor extra specs
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
tags:
|
|
- ExtraSpecs
|
|
|
|
responses:
|
|
200:
|
|
description: The new created flavor
|
|
schema:
|
|
$ref: '#/definitions/ExtraSpecsWrapper'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
post:
|
|
summary: add new extra specs to flavor
|
|
description: |
|
|
The post extra specs inflavors endpoint add one or more extra specs to the already existing extra specs for this flavor
|
|
Return list of flavor extra specs after adding extra specs
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
|
|
- name: list_of_extra_specs
|
|
in: body
|
|
schema:
|
|
$ref: '#/definitions/ExtraSpec'
|
|
description: list of extra specs to add to the flavor.
|
|
required: true
|
|
tags:
|
|
- ExtraSpecs
|
|
|
|
responses:
|
|
200:
|
|
description: The new created flavor
|
|
schema:
|
|
$ref: '#/definitions/ExtraSpecsWrapper'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
put:
|
|
summary: replace flavors extra specs by the supplied list
|
|
description: |
|
|
The put extra specs to flavor endpoint replace existing extra specs by new extra specs suplied
|
|
Return list of flavor extra specs after replacing tags
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
|
|
- name: list_of_extra_specs
|
|
in: body
|
|
schema:
|
|
$ref: '#/definitions/ExtraSpecsWrapper'
|
|
description: list of extra specs to replace for the flavor.
|
|
required: true
|
|
tags:
|
|
- ExtraSpecs
|
|
|
|
responses:
|
|
200:
|
|
description: The new created flavor
|
|
schema:
|
|
$ref: '#/definitions/TagsWrapper'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
/flavors/{flavor_uuid}/os_extra_spec/{extra_spec_name}:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
delete:
|
|
summary: delete specific extra spec by name from flavor
|
|
description: |
|
|
The delete extra spec from flavor endpoint delete a extra spec from flavor
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
- name: extra_spec_name
|
|
in: path
|
|
type: string
|
|
description: extra sepc name to delete
|
|
required: true
|
|
tags:
|
|
- ExtraSpecs
|
|
|
|
responses:
|
|
201:
|
|
description: The extra spec was deleted from flavor
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
/flavors/{flavor_uuid}/tenants:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
post:
|
|
summary: add new tenants to flavor
|
|
description: |
|
|
The post tenants to flavor endpoint add one or more tenants to the already existing tenants for this flavor
|
|
Return list of flavor tenants after adding tenants
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
- name: tenants_list
|
|
in: body
|
|
schema:
|
|
$ref: '#/definitions/TenantsWrapper'
|
|
description: list of tenants to add to the flavor.
|
|
required: true
|
|
tags:
|
|
- Tenants
|
|
|
|
responses:
|
|
200:
|
|
description: list of current flavor tenants after adding tenant/s
|
|
schema:
|
|
$ref: '#/definitions/TenantsWrapper'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
|
|
/flavors/{flavor_uuid}/tenants/{tenant_name}:
|
|
parameters:
|
|
- $ref: "#/parameters/Token"
|
|
- $ref: "#/parameters/Region"
|
|
- $ref: "#/parameters/Client"
|
|
delete:
|
|
summary: delete specific tenant by name from flavor
|
|
description: |
|
|
The delete tenant from flavor endpoint delete a tenant from flavor
|
|
|
|
parameters:
|
|
- name: flavor_uuid
|
|
in: path
|
|
type: string
|
|
description: flavor uuid
|
|
required: true
|
|
- name: tenant_name
|
|
in: path
|
|
type: string
|
|
description: tenant name to delete
|
|
required: true
|
|
tags:
|
|
- Tenants
|
|
|
|
responses:
|
|
201:
|
|
description: The region was deleted from flavor
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
definitions:
|
|
Flavor:
|
|
type: object
|
|
required:
|
|
- series
|
|
- ram
|
|
- vcpus
|
|
- disk
|
|
- visibility
|
|
properties:
|
|
id:
|
|
type: string
|
|
description: id
|
|
name:
|
|
type: string
|
|
description: name
|
|
alias:
|
|
type: string
|
|
description: alias
|
|
description:
|
|
type: string
|
|
description: description
|
|
example: A standard 2GB Ram 2 vCPUs 50GB Disk, Flavor
|
|
series:
|
|
type: string
|
|
description: series
|
|
example: nd
|
|
ram:
|
|
type: string
|
|
description: ram
|
|
example: 20
|
|
vcpus:
|
|
type: string
|
|
description: vcpus
|
|
example: 8
|
|
disk:
|
|
type: string
|
|
description: disk size
|
|
example: 2048
|
|
swap:
|
|
type: string
|
|
description: swap
|
|
example: 0
|
|
ephemeral:
|
|
type: string
|
|
description: ephemeral
|
|
example: 11
|
|
regions:
|
|
type: array
|
|
items:
|
|
$ref: '#/definitions/RegionsInput'
|
|
visibility:
|
|
type: string
|
|
description: visibility 'public' or 'private'
|
|
example: public
|
|
tenants:
|
|
type: array
|
|
items:
|
|
type: string
|
|
status:
|
|
type: string
|
|
description: status
|
|
tags:
|
|
$ref: '#/definitions/Tags'
|
|
options:
|
|
$ref: '#/definitions/Dictionary'
|
|
extra_specs:
|
|
$ref: '#/definitions/ExtraSpec'
|
|
|
|
Flavors:
|
|
type: array
|
|
items:
|
|
$ref: '#/definitions/Flavor'
|
|
|
|
RegionInput:
|
|
type: object
|
|
required:
|
|
- name
|
|
properties:
|
|
name:
|
|
type: string
|
|
example: mtn13
|
|
type:
|
|
type: string
|
|
description: single or group
|
|
example: single
|
|
default: single
|
|
|
|
RegionsInput:
|
|
type: array
|
|
items:
|
|
$ref: '#/definitions/RegionInput'
|
|
|
|
RegionOutput:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
example: mtn13
|
|
type:
|
|
type: string
|
|
description: single or group
|
|
example: single
|
|
default: single
|
|
status:
|
|
type: string
|
|
error_message:
|
|
type: string
|
|
|
|
RegionsOutput:
|
|
type: array
|
|
items:
|
|
$ref: '#/definitions/RegionOutput'
|
|
|
|
RegionsWrapper:
|
|
type: object
|
|
properties:
|
|
regions:
|
|
$ref: '#/definitions/RegionsInput'
|
|
|
|
Tags:
|
|
$ref: '#/definitions/Dictionary'
|
|
|
|
TagsWrapper:
|
|
type: object
|
|
properties:
|
|
tags:
|
|
$ref: '#/definitions/Tags'
|
|
|
|
ExtraSpec:
|
|
$ref: '#/definitions/Dictionary'
|
|
|
|
ExtraSpecsWrapper:
|
|
type: object
|
|
properties:
|
|
os_extra_specs:
|
|
$ref: '#/definitions/Dictionary'
|
|
extra_specs:
|
|
$ref: '#/definitions/Dictionary'
|
|
|
|
Tenant:
|
|
type: string
|
|
example: 4f7b9561-af8b-4cc0-87e2-319270dad49e
|
|
|
|
Tenants:
|
|
type: array
|
|
items:
|
|
$ref: '#/definitions/Tenant'
|
|
|
|
TenantsWrapper:
|
|
type: object
|
|
properties:
|
|
tenants:
|
|
$ref: '#/definitions/Tenants'
|
|
|
|
Dictionary:
|
|
type: object
|
|
additionalProperties:
|
|
type: "string"
|
|
|
|
Error:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
format: int32
|
|
type:
|
|
type: string
|
|
transaction_id:
|
|
type: string
|
|
message:
|
|
type: string
|
|
details:
|
|
type: string
|
|
|
|
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
|
|
|