Jump to: navigation, search

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

m
m (Detailed CG)
 
(16 intermediate revisions by 2 users not shown)
Line 30: Line 30:
 
         "id": {
 
         "id": {
 
             "description": "The unique identifier for a product",
 
             "description": "The unique identifier for a product",
             "type": "integer",
+
             "type": "string",
 +
            'maxLength': 36,
 +
            '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}$'),
 +
        },
 +
        "share_network_id": {
 +
            "description": "The share network to provision the CG and all of it's shares into",
 +
            "type": "string",
 +
            'maxLength': 36,
 +
            '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}$'),
 +
        },
 +
        "share_server_id": {
 +
            "description": "The share server on which the CG is provisioned, visible only to admins",
 +
            "type": "string",
 +
            'maxLength': 36,
 
             'pattern': ('^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}'
 
             '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}$'),
 
                         '-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$'),
Line 50: Line 65:
 
             "description": "Status of the CG",
 
             "description": "Status of the CG",
 
             "type": "string",
 
             "type": "string",
             "enum": ["ACTIVE", "ERROR"]
+
             "enum": ["creating", "available", "deleting", "error"]
 
         },
 
         },
 
         "project_id": {
 
         "project_id": {
Line 66: Line 81:
 
         "share_types": {
 
         "share_types": {
 
             "description": "The share types that shares in the CG are allowed to be a part of",
 
             "description": "The share types that shares in the CG are allowed to be a part of",
             "type": "string"
+
             "type": "array",
 +
            "items": {
 +
                "type": "string"
 +
            },
 
         },
 
         },
 
     },
 
     },
Line 81: Line 99:
 
         "id": {
 
         "id": {
 
             "description": "The unique identifier for a product",
 
             "description": "The unique identifier for a product",
             "type": "integer"
+
             "type": "string",
 +
            '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": {
Line 90: Line 110:
 
     "required": ["id", "name"]
 
     "required": ["id", "name"]
 
  }
 
  }
 
  
 
== Detailed CG Snapshot ==
 
== Detailed CG Snapshot ==
Line 102: Line 121:
 
         "id": {
 
         "id": {
 
             "description": "The unique identifier for a product",
 
             "description": "The unique identifier for a product",
             "type": "integer",
+
             "type": "string",
 
             'pattern': ('^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}'
 
             '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}$'),
 
                         '-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$'),
Line 122: Line 141:
 
             "description": "Status of the CG snapshot",
 
             "description": "Status of the CG snapshot",
 
             "type": "string",
 
             "type": "string",
             "enum": ["ACTIVE", "ERROR"]
+
             "enum": ["creating", "available", "deleting", "error"]
 
         },
 
         },
 
         "project_id": {
 
         "project_id": {
Line 131: Line 150:
 
             "description": "The uuid of the consistency group from which this CG snapshot was created.",
 
             "description": "The uuid of the consistency group from which this CG snapshot was created.",
 
             "type": ['null', 'string'],
 
             "type": ['null', 'string'],
 +
            '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}$'),
 
         },
 
         },
         "share_types": {
+
    },
             "description": "The share types that will be inherited if a CG is created from this snapshot",
+
    "required": ["id", "name", "description", "created_at", "status", "project_id"]
             "type": "string"
+
}
 +
 
 +
== CG Snapshot member ==
 +
 
 +
{
 +
    "$schema": "http://json-schema.org/draft-04/schema#",
 +
    "title": "Consistency Group Snapshot Member",
 +
    "description": "A resource representing a member of a CGSnapshot",
 +
    "type": "object",
 +
    "properties": {
 +
        "id": {
 +
            "description": "The unique identifier for a product",
 +
            "type": "string",
 +
            '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}$'),
 +
        },
 +
        "cgsnapshot_id": {
 +
            "description": "The unique identifier for the parent cg_snapshot",
 +
            "type": "string",
 +
            '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}$'),
 +
        },
 +
         "share_id": {
 +
             "description": "The unique identifier for the share this snapshot was created from.",
 +
            "type": "string",
 +
            '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}$'),
 +
        },
 +
        "share_type_id": {
 +
            "description": "The unique identifier for the share_type of the share this snapshot was created from.",
 +
             "type": "string",
 +
            '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}$'),
 +
        },
 +
        "size": {
 +
            "description": "The storage size of this snapshot",
 +
            "type": "integer",
 +
        },
 +
        "share_protocol": {
 +
            "description": "The share protocol of the parent share",
 +
            "type": "string",
 
         },
 
         },
 
     },
 
     },
    "required": ["id", "name", "description", "created_at", "status", "project_id", "host"]
 
 
  }
 
  }
  
 
= Request schemas =
 
= Request schemas =
  
== POST /consistencygroups ==
+
== POST /os-consistency-groups ==
  {
+
  { "consistency_group" {
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "title": "Consistency Group (CG)",
 
     "title": "Consistency Group (CG)",
Line 168: Line 228:
 
     },
 
     },
 
     "required": []
 
     "required": []
 +
  }
 
  }
 
  }
  
  Response: detailed CG
+
  Response: {'consistency_group":  detailed CG}
  
== GET /consistencygroups ==
+
== GET /os-consistency-groups ==
  Response: Simple CG
+
  Response:  
 +
{'consistency_groups": [Simple CG]}
  
== GET /consistencygroups/detail ==
+
== GET /os-consistency-groups/detail ==
  Response: Detailed CG
+
  Response:  
 +
{'consistency_groups": [Detailed CG]}
  
==  GET /consistencygroups/<id> ==
+
==  GET /os-consistency-groups/<id> ==
  Response: Detailed CG
+
  Response: {'consistency_group": Detailed CG}
  
  
== PUT /consistencygroups/<id> ==
+
== PUT /os-consistency-groups/<id> ==
 
  {
 
  {
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "$schema": "http://json-schema.org/draft-04/schema#",
Line 201: Line 264:
 
  }
 
  }
  
  Response: Detailed CG
+
  Response: {'consistency_group": Detailed CG}
  
== POST /cgsnapshots ==
+
== POST /os-cgsnapshots ==
  {
+
{'cgsnapshot": {
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "title": "Consistency Group Snapshot",
 
     "title": "Consistency Group Snapshot",
Line 224: Line 287:
 
         },
 
         },
 
     },
 
     },
     "required": []
+
     "required": ['consistency_group_id']
  }
+
  }}
 
+
  Response: {'cgsnapshot":  detailed CGSnapshot}
  Response: detailed CG
 
 
 
  
== PUT /cgsnapshots/<id> ==
+
== PUT /os-cgsnapshots/<id> ==
 
  {
 
  {
 
     "$schema": "http://json-schema.org/draft-04/schema#",
 
     "$schema": "http://json-schema.org/draft-04/schema#",
Line 249: Line 310:
 
  }
 
  }
  
  Response: Detailed CG
+
  Response: {'cgsnapshot":  Detailed CGSnapshot}

Latest revision as of 20:00, 15 August 2015

Resource 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": "string",
           'maxLength': 36,
           '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}$'),
       },
       "share_network_id": {
           "description": "The share network to provision the CG and all of it's shares into",
           "type": "string",
           'maxLength': 36,
           '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}$'),
       },
       "share_server_id": {
           "description": "The share server on which the CG is provisioned, visible only to admins",
           "type": "string",
           'maxLength': 36,
           '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": ["creating", "available", "deleting", "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": "array",
           "items": {
               "type": "string"
           },
       },
   },
   "required": ["id", "name", "description", "created_at", "status", "project_id", "host"]
}

Simple CG Snapshot

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "Consistency Group Snapshot",
   "description": "A resource representing a snapshot of a group of shares",
   "type": "object",
   "properties": {
       "id": {
           "description": "The unique identifier for a product",
           "type": "string",
           '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 CGsnapshot",
           "type": "string"
       },
   },
   "required": ["id", "name"]
}

Detailed CG Snapshot

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "Consistency Group Snapshot",
   "description": "A resource representing a snapshot of a group of shares",
   "type": "object",
   "properties": {
       "id": {
           "description": "The unique identifier for a product",
           "type": "string",
           '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 snapshot",
           "type": "string",
           'maxLength': 255,
       },
       "description": {
           "description": "A short description of the CG snapshot",
           "type": "string"
       },
       "created_at": {
           "description": "The time at which the CG snapshot was created",
           "type": "string"
       },
       "status": {
           "description": "Status of the CG snapshot",
           "type": "string",
           "enum": ["creating", "available", "deleting", "error"]
       },
       "project_id": {
           "description": "The owner of the CG snapshot",
           "type": "string"
       },
       "consistency_group_id": {
           "description": "The uuid of the consistency group from which this CG snapshot was created.",
           "type": ['null', 'string'],
           '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}$'),
       },
   },
   "required": ["id", "name", "description", "created_at", "status", "project_id"]
}

CG Snapshot member

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "Consistency Group Snapshot Member",
   "description": "A resource representing a member of a CGSnapshot",
   "type": "object",
   "properties": {
       "id": {
           "description": "The unique identifier for a product",
           "type": "string",
           '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}$'),
       },
       "cgsnapshot_id": {
           "description": "The unique identifier for the parent cg_snapshot",
           "type": "string",
           '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}$'),
       },
       "share_id": {
           "description": "The unique identifier for the share this snapshot was created from.",
           "type": "string",
           '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}$'),
       },
       "share_type_id": {
           "description": "The unique identifier for the share_type of the share this snapshot was created from.",
           "type": "string",
           '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}$'),
       },
       "size": {
           "description": "The storage size of this snapshot",
           "type": "integer",
       },
       "share_protocol": {
           "description": "The share protocol of the parent share",
           "type": "string",
       },
   },
}

Request schemas

POST /os-consistency-groups

{ "consistency_group" {
   "$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: {'consistency_group":  detailed CG}

GET /os-consistency-groups

Response: 
{'consistency_groups": [Simple CG]}

GET /os-consistency-groups/detail

Response: 
{'consistency_groups": [Detailed CG]}

GET /os-consistency-groups/<id>

Response: {'consistency_group": Detailed CG}


PUT /os-consistency-groups/<id>

{
   "$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: {'consistency_group": Detailed CG}

POST /os-cgsnapshots

{'cgsnapshot": {

   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "Consistency Group Snapshot",
   "description": "A resource representing a snapshot of a group of shares",
   "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"
       },
       "consistency_group_id": {
           "description": "The uuid of the CG from which to create this CG snapshot.",
           "type": 'string',
       },
   },
   "required": ['consistency_group_id']
}}
Response: {'cgsnapshot":  detailed CGSnapshot}

PUT /os-cgsnapshots/<id>

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "Consistency Group Snapshot",
   "description": "A resource representing a snapshot of a group of shares",
   "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: {'cgsnapshot":  Detailed CGSnapshot}