Add Blacklist to api-ref docs

Change-Id: Ic74ac379f4a03bceba0e1dd42ffbf91b372f2eef
This commit is contained in:
sonu.kumar 2016-05-20 16:19:28 +09:00
parent 3d5fcaf5fc
commit 3167edfc43
9 changed files with 354 additions and 0 deletions

View File

@ -0,0 +1,240 @@
==========
Blacklists
==========
The blacklist entries are used to manage blacklisted zones. If a zone
is blacklisted, then it cannot be used tocreate a zone. By default,
only an admin can manage these entries. Blacklisted zones are stored
as a regular expression (regex) pattern in the Database/Storage in
the blacklists table.
Create Blacklist
================
.. rest_method:: POST /v2/blacklists
Create a Blacklist
Normal response codes: 201
Error response codes: 409, 405,404,403,401,400,503
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- x-auth-all-projects: x-auth-all-projects
- x-auth-sudo-project-id: x-auth-sudo-project-id
- pattern: blacklist_pattern
- description: blacklist_description
Request Example
---------------
.. literalinclude:: samples/blacklists/create-blacklist-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- x-openstack-request-id: x-openstack-request-id
- id: id
- pattern: blacklist_pattern
- description: blacklist_description
- created_at: created_at
- updated_at: updated_at
- links: links
Response Example
----------------
.. literalinclude:: samples/blacklists/blacklist-response.json
:language: javascript
List Blacklists
---------------
.. rest_method:: GET /v2/blacklists
List all blacklists
Normal response codes: 200
Error response codes: 405,404,403,401,400,503
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- x-auth-all-projects: x-auth-all-projects
- x-auth-sudo-project-id: x-auth-sudo-project-id
- pattern: blacklist_pattern_filter
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- x-openstack-request-id: x-openstack-request-id
- id: id
- pattern: blacklist_pattern
- description: blacklist_description
- created_at: created_at
- updated_at: updated_at
- links: links
Response Example
----------------
.. literalinclude:: samples/blacklists/list-blacklists-response.json
:language: javascript
Show Blacklist
==============
.. rest_method:: GET /v2/blacklists/{blacklist_id}
Show a blacklist
Normal response codes: 200
Error response codes: 405,404,403,401,400,503
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- x-auth-all-projects: x-auth-all-projects
- x-auth-sudo-project-id: x-auth-sudo-project-id
- blacklist_id: blacklist_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- x-openstack-request-id: x-openstack-request-id
- id: id
- pattern: blacklist_pattern
- description: blacklist_description
- created_at: created_at
- updated_at: updated_at
- links: links
Response Example
----------------
.. literalinclude:: samples/blacklists/blacklist-response.json
:language: javascript
Update Blacklist
================
.. rest_method:: PATCH /v2/blacklists/{blacklist_id}
Update a Blacklist
Normal response codes: 200
Error response codes: 405,404,403,401,400,503
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- x-auth-all-projects: x-auth-all-projects
- x-auth-sudo-project-id: x-auth-sudo-project-id
- pattern: blacklist_pattern
- description: blacklist_description
Request Example
---------------
.. literalinclude:: samples/blacklists/update-blacklist-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- x-openstack-request-id: x-openstack-request-id
- id: id
- pattern: blacklist_pattern
- description: blacklist_description
- created_at: created_at
- updated_at: updated_at
- links: links
Response Example
----------------
.. literalinclude:: samples/blacklists/update-blacklist-response.json
:language: javascript
Delete a Blacklist
==================
.. rest_method:: DELETE /v2/blacklists/{blacklist_id}
Delete a blacklist
Normal response codes: 204
Error response codes: 405,404,403,401,400,503
Request
-------
.. rest_parameters:: parameters.yaml
- x-auth-token: x-auth-token
- x-auth-all-projects: x-auth-all-projects
- x-auth-sudo-project-id: x-auth-sudo-project-id
- blacklist_id: blacklist_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- x-openstack-request-id: x-openstack-request-id

View File

@ -18,3 +18,4 @@
.. include:: dns-api-v2-limits.inc
.. include:: dns-api-v2-tld.inc
.. include:: dns-api-v2-tsigkey.inc
.. include:: dns-api-v2-blacklist.inc

View File

@ -50,6 +50,13 @@ zone_export_accepts:
# Path Variables #
####################
blacklist_id:
description: |
ID for this blacklist
in: path
required: true
type: uuid
path_pool_id:
description: |
ID for this pool
@ -113,10 +120,18 @@ tsigkey_id:
required: true
type: uuid
####################
# Query Variables #
####################
blacklist_pattern_filter:
description: |
Filter results to only show blacklists that have a pattern matching the filter
in: query
required: false
type: string
limit:
description: |
Requests a page size of items. Returns a number
@ -335,6 +350,20 @@ action:
required: true
type: enum
blacklist_description:
description: |
Description for this blacklist
in: body
required: false
type: string
blacklist_pattern:
description: |
Pattern for this blacklist
in: body
required: true
type: string
created_at:
description: |
Date / Time when resource was created

View File

@ -50,6 +50,13 @@ zone_export_accepts:
# Path Variables #
####################
blacklist_id:
description: |
ID for this blacklist
in: path
required: true
type: uuid
path_pool_id:
description: |
ID for this pool
@ -113,10 +120,18 @@ tsigkey_id:
required: true
type: uuid
####################
# Query Variables #
####################
blacklist_pattern_filter:
description: |
Filter results to only show blacklists that have a pattern matching the filter
in: query
required: false
type: string
limit:
description: |
Requests a page size of items. Returns a number
@ -335,6 +350,20 @@ action:
required: true
type: enum
blacklist_description:
description: |
Description for this blacklist
in: body
required: false
type: string
blacklist_pattern:
description: |
Pattern for this blacklist
in: body
required: true
type: string
created_at:
description: |
Date / Time when resource was created

View File

@ -0,0 +1,10 @@
{
"description": "This is a blacklisted domain.",
"links": {
"self": "http://127.0.0.1:9001/v2/blacklists/af91edb5-ede8-453f-af13-feabdd088f9c"
},
"pattern": "^([A-Za-z0-9_\\-]+\\.)*example\\.com\\.$",
"created_at": "2016-05-20 06:15:42",
"updated_at": null,
"id": "af91edb5-ede8-453f-af13-feabdd088f9c"
}

View File

@ -0,0 +1,4 @@
{
"pattern" : "^([A-Za-z0-9_\\-]+\\.)*example\\.com\\.$",
"description" : "This is a blacklisted domain."
}

View File

@ -0,0 +1,27 @@
{
"blacklists": [
{
"description": "This is a blacklisted domain.",
"links": {
"self": "http://127.0.0.1:9001/v2/blacklists/af91edb5-ede8-453f-af13-feabdd088f9c"
},
"pattern": "^([A-Za-z0-9_\\-]+\\.)*example\\.com\\.$",
"created_at": "2016-05-20 06:15:42",
"updated_at": null,
"id": "af91edb5-ede8-453f-af13-feabdd088f9c"
},
{
"description": "Example blacklisted domain.",
"links": {
"self": "http://127.0.0.1:9001/v2/blacklists/f26e22f8-619f-4738-9077-0586e7cb76bd"
},
"pattern": "^examples\\.com\\.$",
"created_at": "2016-05-20 06:22:12",
"updated_at": null,
"id": "f26e22f8-619f-4738-9077-0586e7cb76bd"
}
],
"links": {
"self": "http://127.0.0.1:9001/v2/blacklists"
}
}

View File

@ -0,0 +1,4 @@
{
"pattern" : "^examples\\.com\\.$",
"description" : "Updated the description"
}

View File

@ -0,0 +1,10 @@
{
"description": "Updated the description",
"links": {
"self": "http://127.0.0.1:9001/v2/blacklists/f26e22f8-619f-4738-9077-0586e7cb76bd"
},
"pattern": "^examples\\.com\\.$",
"created_at": "2016-05-20 06:22:12",
"updated_at": "2016-05-20 06:41:34",
"id": "f26e22f8-619f-4738-9077-0586e7cb76bd"
}