Jump to: navigation, search

Difference between revisions of "Manila/design/manila-liberty-consistency-groups/api-schema"

m (POST /consistencygroups)
m
Line 1: Line 1:
== POST /consistencygroups ==
+
= Response schemas=
Request:
+
 
 +
== Simple CG ==
 
  {
 
  {
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "$schema": "http://json-schema.org/draft-04/schema#",
Line 7: Line 8:
 
     "type": "object",
 
     "type": "object",
 
     "properties": {
 
     "properties": {
 +
        "id": {
 +
            "description": "The unique identifier for a product",
 +
            "type": "integer"
 +
        },
 
         "name": {
 
         "name": {
 
             "description": "A non-unique name for a CG",
 
             "description": "A non-unique name for a CG",
            "type": "string",
 
            'maxLength': 255,
 
        },
 
        "description": {
 
            "description": "A short description of the CG",
 
            "type": "string"
 
        },
 
        "source_cgsnapshot_id": {
 
            "description": "The uuid of the cgsnapshot from which this CG was created. Cannot be supplied when 'share_types' is provided.",
 
            "type": ['null', 'string'],
 
        },
 
        "share_types": {
 
            "description": "The share types that shares in the CG are allowed to be a part of. Cannot be supplied when 'source_cgsnapshot_id' is provided.",
 
 
             "type": "string"
 
             "type": "string"
 
         },
 
         },
 
     },
 
     },
     "required": []
+
     "required": ["id", "name"]
 
  }
 
  }
  
Response:
+
== Detailed CG ==
 +
 
 
  {
 
  {
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "$schema": "http://json-schema.org/draft-04/schema#",
Line 79: Line 72:
 
  }
 
  }
  
== PUT /consistencygroups ==
+
== Simple CG
Request:
+
 
 +
= Request schemas =
 +
 
 +
== POST /consistencygroups ==
 
  {
 
  {
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "$schema": "http://json-schema.org/draft-04/schema#",
Line 96: Line 92:
 
             "type": "string"
 
             "type": "string"
 
         },
 
         },
    "required": []
+
        "source_cgsnapshot_id": {
}
+
            "description": "The uuid of the cgsnapshot from which this CG was created. Cannot be supplied when 'share_types' is provided.",
 
+
            "type": ['null', 'string'],
== GET /consistencygroups ==
 
 
 
Response Schema:
 
{
 
    "$schema": "http://json-schema.org/draft-04/schema#",
 
    "title": "Consistency Group (CG)",
 
    "description": "A resource representing a group of shares that can be snapshotted in unison",
 
    "type": "object",
 
    "properties": {
 
        "id": {
 
            "description": "The unique identifier for a product",
 
            "type": "integer"
 
 
         },
 
         },
         "name": {
+
         "share_types": {
             "description": "A non-unique name for a CG",
+
             "description": "The share types that shares in the CG are allowed to be a part of. Cannot be supplied when 'source_cgsnapshot_id' is provided.",
 
             "type": "string"
 
             "type": "string"
 
         },
 
         },
 
     },
 
     },
     "required": ["id", "name"]
+
     "required": []
 
  }
 
  }
  
== GET /consistencygroups/detail && GET /consistencygroups/<id> ==
+
Response: detailed CG
Response:
+
 
 +
 
 +
== PUT /consistencygroups ==
 
  {
 
  {
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "$schema": "http://json-schema.org/draft-04/schema#",
Line 128: Line 114:
 
     "type": "object",
 
     "type": "object",
 
     "properties": {
 
     "properties": {
        "id": {
 
            "description": "The unique identifier for a product",
 
            "type": "integer",
 
            'pattern': ('^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}'
 
                        '-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$'),
 
        },
 
 
         "name": {
 
         "name": {
 
             "description": "A non-unique name for a CG",
 
             "description": "A non-unique name for a CG",
Line 143: Line 123:
 
             "type": "string"
 
             "type": "string"
 
         },
 
         },
        "created_at": {
+
     "required": []
            "description": "The time at which the CG was created",
 
            "type": "string"
 
        },
 
        "status": {
 
            "description": "Status of the CG",
 
            "type": "string",
 
            "enum": ["ACTIVE", "ERROR"]
 
        },
 
        "project_id": {
 
            "description": "The owner of the CG",
 
            "type": "string"
 
        },
 
        "host": {
 
            "description": "The backend where the CG lives",
 
            "type": "string"
 
        },
 
        "source_cgsnapshot_id": {
 
            "description": "The uuid of the cgsnapshot from which this CG was created.",
 
            "type": ['null', 'string'],
 
        },
 
        "share_types": {
 
            "description": "The share types that shares in the CG are allowed to be a part of",
 
            "type": "string"
 
        },
 
    },
 
     "required": ["id", "name", "description", "created_at", "status", "project_id", "host"]
 
 
  }
 
  }
 +
 +
Response: Detailed CG
 +
 +
== GET /consistencygroups ==
 +
Response: Simple CG
 +
 +
== GET /consistencygroups/detail && GET /consistencygroups/<id> ==
 +
Response: Detailed CG

Revision as of 14:46, 29 July 2015

Response schemas

Simple CG

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "Consistency Group (CG)",
   "description": "A resource representing a group of shares that can be snapshotted in unison",
   "type": "object",
   "properties": {
       "id": {
           "description": "The unique identifier for a product",
           "type": "integer"
       },
       "name": {
           "description": "A non-unique name for a CG",
           "type": "string"
       },
   },
   "required": ["id", "name"]
}

Detailed CG

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "Consistency Group (CG)",
   "description": "A resource representing a group of shares that can be snapshotted in unison",
   "type": "object",
   "properties": {
       "id": {
           "description": "The unique identifier for a product",
           "type": "integer",
           'pattern': ('^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}'
                       '-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$'),
       },
       "name": {
           "description": "A non-unique name for a CG",
           "type": "string",
           'maxLength': 255,
       },
       "description": {
           "description": "A short description of the CG",
           "type": "string"
       },
       "created_at": {
           "description": "The time at which the CG was created",
           "type": "string"
       },
       "status": {
           "description": "Status of the CG",
           "type": "string",
           "enum": ["ACTIVE", "ERROR"]
       },
       "project_id": {
           "description": "The owner of the CG",
           "type": "string"
       },
       "host": {
           "description": "The backend where the CG lives",
           "type": "string"
       },
       "source_cgsnapshot_id": {
           "description": "The uuid of the cgsnapshot from which this CG was created.",
           "type": ['null', 'string'],
       },
       "share_types": {
           "description": "The share types that shares in the CG are allowed to be a part of",
           "type": "string"
       },
   },
   "required": ["id", "name", "description", "created_at", "status", "project_id", "host"]
}
== Simple CG

Request schemas

POST /consistencygroups

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "Consistency Group (CG)",
   "description": "A resource representing a group of shares that can be snapshotted in unison",
   "type": "object",
   "properties": {
       "name": {
           "description": "A non-unique name for a CG",
           "type": "string",
           'maxLength': 255,
       },
       "description": {
           "description": "A short description of the CG",
           "type": "string"
       },
       "source_cgsnapshot_id": {
           "description": "The uuid of the cgsnapshot from which this CG was created. Cannot be supplied when 'share_types' is provided.",
           "type": ['null', 'string'],
       },
       "share_types": {
           "description": "The share types that shares in the CG are allowed to be a part of. Cannot be supplied when 'source_cgsnapshot_id' is provided.",
           "type": "string"
       },
   },
   "required": []
}
Response: detailed CG


PUT /consistencygroups

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "Consistency Group (CG)",
   "description": "A resource representing a group of shares that can be snapshotted in unison",
   "type": "object",
   "properties": {
       "name": {
           "description": "A non-unique name for a CG",
           "type": "string",
           'maxLength': 255,
       },
       "description": {
           "description": "A short description of the CG",
           "type": "string"
       },
   "required": []
}

Response: Detailed CG

GET /consistencygroups

Response: Simple CG

GET /consistencygroups/detail && GET /consistencygroups/<id>

Response: Detailed CG