Skip to content

Commit

Permalink
Initial commit of RAML
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-r-thorpe committed Feb 5, 2024
1 parent 2e0b426 commit cc2be62
Show file tree
Hide file tree
Showing 28 changed files with 601 additions and 0 deletions.
101 changes: 101 additions & 0 deletions APIs/ConfigurationAPI.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#%RAML 1.0
title: NMOS Configuration API
baseUri: http://api.example.com/x-nmos/configuration/{version}
version: 1.0

uses:
assets: assets.lib.raml

annotationTypes:
monitoringInterval:
type: integer
/:
displayName: Base
get:
description: List of paths available from this API
responses:
200:
body:
example: !include ../examples/base-get-200.json
type: !include schemas/base.json
/rolePaths:
displayName: Role Paths
get:
responses:
200:
body:
example: !include ../examples/rolePaths-base-get-200.json
type: !include schemas/rolePaths-base.json
description: List rolePaths
/{rolePath}:
uriParameters:
rolePath:
type: string
get:
description: Get attributes of the object specified by rolePath
responses:
200:
body:
example: !include ../examples/rolePath-get-200.json
type: !include schemas/rolePath.json
/properties:
displayName: Properties
get:
description: Get properties of the object
responses:
200:
body:
example: !include ../examples/properties-base-get-200.json
type: !include schemas/properties-base.json
/{propertyId}:
uriParameters:
propertyId:
type: string
get:
description: Get attributes of a property
responses:
200:
body:
example: !include ../examples/property-get-200.json
type: !include schemas/property.json
/value:
displayName: Value of a property
get:
description: Get value of a property
responses:
200:
body:
example: !include ../examples/property-value-get-200.json
type: !include schemas/NcMethodResultPropertyValue.json
put:
descriptions: Set value of a property
responses:
200:
body:
example: !include ../examples/property-value-get-200.json
type: !include schemas/modify-property.json
/descriptor:
displayName: Descriptor of property
get:
description: Get descriptor of a property
responses:
200:
body:
example: !include ../examples/properties-descriptor-get-200.json
type: !include schemas/NcDatatypeDescriptor.json
/methods:
displayName: Methods
get:
description: List Methods
/{methodId}:
uriParameters:
propertyId:
type: string
patch:
/members:
displayName: Members
get:
description: List Methods
/descriptor:
displayName: Members
get:
37 changes: 37 additions & 0 deletions APIs/schemas/NcDatatypeDescriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcDatatypeDescriptor",
"description": "Base datatype descriptor",
"allOf": [
{
"$ref": "NcDescriptor.json"
}
],
"type": "object",
"required": [
"name",
"type",
"constraints"
],
"properties": {
"name": {
"$ref": "NcName.json",
"description": "Datatype name"
},
"type": {
"$ref": "NcDatatypeType.json",
"description": "Type: Primitive, Typedef, Struct, Enum"
},
"constraints": {
"anyOf": [
{
"$ref": "NcParameterConstraints.json"
},
{
"type": "null"
}
],
"description": "Optional constraints on top of the underlying data type"
}
}
}
23 changes: 23 additions & 0 deletions APIs/schemas/NcDatatypeDescriptorEnum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcDatatypeDescriptorEnum",
"description": "Enum datatype descriptor",
"allOf": [
{
"$ref": "NcDatatypeDescriptor.json"
}
],
"type": "object",
"required": [
"items"
],
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "NcEnumItemDescriptor.json"
},
"description": "One item descriptor per enum option"
}
}
}
10 changes: 10 additions & 0 deletions APIs/schemas/NcDatatypeDescriptorPrimitive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcDatatypeDescriptorPrimitive",
"description": "Primitive datatype descriptor",
"allOf": [
{
"$ref": "NcDatatypeDescriptor.json"
}
]
}
35 changes: 35 additions & 0 deletions APIs/schemas/NcDatatypeDescriptorStruct.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcDatatypeDescriptorStruct",
"description": "Struct datatype descriptor",
"allOf": [
{
"$ref": "NcDatatypeDescriptor.json"
}
],
"type": "object",
"required": [
"fields",
"parentType"
],
"properties": {
"fields": {
"type": "array",
"items": {
"$ref": "NcFieldDescriptor.json"
},
"description": "One item descriptor per field of the struct"
},
"parentType": {
"anyOf": [
{
"$ref": "NcName.json"
},
{
"type": "null"
}
],
"description": "Name of the parent type if any or null if it has no parent"
}
}
}
25 changes: 25 additions & 0 deletions APIs/schemas/NcDatatypeDescriptorTypeDef.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcDatatypeDescriptorTypeDef",
"description": "Type def datatype descriptor",
"allOf": [
{
"$ref": "NcDatatypeDescriptor.json"
}
],
"type": "object",
"required": [
"parentType",
"isSequence"
],
"properties": {
"parentType": {
"$ref": "NcName.json",
"description": "Original typedef datatype name"
},
"isSequence": {
"type": "boolean",
"description": "TRUE iff type is a typedef sequence of another type"
}
}
}
12 changes: 12 additions & 0 deletions APIs/schemas/NcDatatypeType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcDatatypeType",
"description": "Datatype type",
"enum": [
0,
1,
2,
3
],
"type": "integer"
}
18 changes: 18 additions & 0 deletions APIs/schemas/NcDescriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcDescriptor",
"description": "Base descriptor",
"type": "object",
"required": [
"description"
],
"properties": {
"description": {
"type": [
"string",
"null"
],
"description": "Optional user facing description"
}
}
}
15 changes: 15 additions & 0 deletions APIs/schemas/NcMethodResult.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcMethodResult",
"description": "Base result of the invoked method",
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"$ref": "NcMethodStatus.json",
"description": "Status for the invoked method"
}
}
}
27 changes: 27 additions & 0 deletions APIs/schemas/NcMethodResultPropertyValue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcMethodResultPropertyValue",
"description": "Result when invoking the getter method associated with a property",
"allOf": [
{
"$ref": "NcMethodResult.json"
}
],
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": [
"number",
"string",
"boolean",
"object",
"array",
"null"
],
"description": "Getter method value for the associated property"
}
}
}
26 changes: 26 additions & 0 deletions APIs/schemas/NcMethodStatus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcMethodStatus",
"description": "Method invokation status",
"enum": [
200,
298,
299,
400,
401,
404,
405,
406,
409,
413,
414,
417,
423,
500,
501,
502,
503,
504
],
"type": "integer"
}
10 changes: 10 additions & 0 deletions APIs/schemas/NcName.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcName",
"description": "Programmatically significant name, alphanumerics + underscore, no spaces",
"allOf": [
{
"$ref": "NcString.json"
}
]
}
22 changes: 22 additions & 0 deletions APIs/schemas/NcParameterConstraints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NcParameterConstraints",
"description": "Abstract parameter constraints class",
"type": "object",
"required": [
"defaultValue"
],
"properties": {
"defaultValue": {
"type": [
"number",
"string",
"boolean",
"object",
"array",
"null"
],
"description": "Default value"
}
}
}
Loading

0 comments on commit cc2be62

Please sign in to comment.