From cd4f92b95b7b4b5e97c46d90fe44ced4c04511bc Mon Sep 17 00:00:00 2001 From: chicco785 Date: Tue, 25 Oct 2022 09:36:32 +0000 Subject: [PATCH] Update open api specs --- docs/user/walkthrough.md | 112 ++++++++++++- open-api-spec/openapi.json | 322 ++++++++++++++++++++++++++++++++++++- 2 files changed, 424 insertions(+), 10 deletions(-) diff --git a/docs/user/walkthrough.md b/docs/user/walkthrough.md index 0f1c5cd..ead1734 100644 --- a/docs/user/walkthrough.md +++ b/docs/user/walkthrough.md @@ -537,7 +537,7 @@ Delete an Audit Log for a given Tenant and Service Path | 404 | Not found | | 422 | Validation Error | -### /v1/resources/ +### /v1/middleware/resources #### GET ##### Summary: @@ -563,7 +563,7 @@ List resources managed (for a given Tenant and Service Path) | 404 | Not found | | 422 | Validation Error | -### /v1/resources/mine +### /v1/middleware/resources/mine #### GET ##### Summary: @@ -594,6 +594,114 @@ List resources owned by me | --- | --- | | OptionalHTTPBearer | | +### /v1/middleware/policies + +#### GET +##### Summary: + +List policies for a given resource + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ---- | +| resource | query | | No | string | +| resource_type | query | | No | string | +| skip | query | | No | integer | +| limit | query | | No | integer | +| fiware-service | header | | No | string | +| fiware-servicepath | header | | No | string | + +##### Responses + +| Code | Description | +| ---- | ----------- | +| 200 | Successful Response | +| 404 | Not found | +| 422 | Validation Error | + +#### POST +##### Summary: + +Create a policy for a given Tenant and Service Path + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ---- | +| owner | header | | No | string | +| fiware-service | header | | No | string | +| fiware-servicepath | header | | No | string | + +##### Responses + +| Code | Description | +| ---- | ----------- | +| 201 | Successful Response | +| 404 | Not found | +| 422 | Validation Error | + +### /v1/middleware/policies/{policy_id} + +#### GET +##### Summary: + +Get a policy + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ---- | +| policy_id | path | | Yes | string | +| fiware-service | header | | No | string | +| fiware-servicepath | header | | No | string | + +##### Responses + +| Code | Description | +| ---- | ----------- | +| 200 | Successful Response | +| 404 | Not found | +| 422 | Validation Error | + +#### PUT +##### Summary: + +Update a policy for a given Tenant and Service Path + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ---- | +| policy_id | path | | Yes | string | + +##### Responses + +| Code | Description | +| ---- | ----------- | +| 204 | Successful Response | +| 404 | Not found | +| 422 | Validation Error | + +#### DELETE +##### Summary: + +Delete a policy for a given Tenant and Service Path + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ---- | +| policy_id | path | | Yes | string | + +##### Responses + +| Code | Description | +| ---- | ----------- | +| 204 | Successful Response | +| 404 | Not found | +| 422 | Validation Error | + ### / #### GET diff --git a/open-api-spec/openapi.json b/open-api-spec/openapi.json index d8ac72c..c2d3d02 100644 --- a/open-api-spec/openapi.json +++ b/open-api-spec/openapi.json @@ -1498,13 +1498,13 @@ } } }, - "/v1/resources/": { + "/v1/middleware/resources": { "get": { "tags": [ - "resources" + "middleware" ], "summary": "List resources managed (for a given Tenant and Service Path)", - "operationId": "resources_v1_resources__get", + "operationId": "resources_v1_middleware_resources_get", "parameters": [ { "required": false, @@ -1569,7 +1569,7 @@ "content": { "application/json": { "schema": { - "title": "Response Resources V1 Resources Get", + "title": "Response Resources V1 Middleware Resources Get", "type": "array", "items": { "$ref": "#/components/schemas/Resource" @@ -1594,13 +1594,13 @@ } } }, - "/v1/resources/mine": { + "/v1/middleware/resources/mine": { "get": { "tags": [ - "resources" + "middleware" ], "summary": "List resources owned by me", - "operationId": "my_resources_v1_resources_mine_get", + "operationId": "my_resources_v1_middleware_resources_mine_get", "parameters": [ { "required": false, @@ -1656,7 +1656,7 @@ "content": { "application/json": { "schema": { - "title": "Response My Resources V1 Resources Mine Get", + "title": "Response My Resources V1 Middleware Resources Mine Get", "type": "array", "items": { "$ref": "#/components/schemas/Resource" @@ -1686,6 +1686,312 @@ ] } }, + "/v1/middleware/policies": { + "get": { + "tags": [ + "middleware" + ], + "summary": "List policies for a given resource", + "operationId": "read_policies_v1_middleware_policies_get", + "parameters": [ + { + "required": false, + "schema": { + "title": "Resource", + "type": "string" + }, + "name": "resource", + "in": "query" + }, + { + "required": false, + "schema": { + "title": "Resource Type", + "type": "string" + }, + "name": "resource_type", + "in": "query" + }, + { + "required": false, + "schema": { + "title": "Skip", + "type": "integer", + "default": 0 + }, + "name": "skip", + "in": "query" + }, + { + "required": false, + "schema": { + "title": "Limit", + "type": "integer", + "default": 100 + }, + "name": "limit", + "in": "query" + }, + { + "required": false, + "schema": { + "title": "Fiware-Service", + "type": "string" + }, + "name": "fiware-service", + "in": "header" + }, + { + "required": false, + "schema": { + "title": "Fiware-Servicepath", + "type": "string" + }, + "name": "fiware-servicepath", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "title": "Response Read Policies V1 Middleware Policies Get", + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "post": { + "tags": [ + "middleware" + ], + "summary": "Create a policy for a given Tenant and Service Path", + "operationId": "create_policy_v1_middleware_policies_post", + "parameters": [ + { + "required": false, + "schema": { + "title": "Owner", + "type": "string" + }, + "name": "owner", + "in": "header" + }, + { + "required": false, + "schema": { + "title": "Fiware-Service", + "type": "string" + }, + "name": "fiware-service", + "in": "header" + }, + { + "required": false, + "schema": { + "title": "Fiware-Servicepath", + "type": "string", + "default": "/" + }, + "name": "fiware-servicepath", + "in": "header" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyCreate" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Successful Response" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/v1/middleware/policies/{policy_id}": { + "get": { + "tags": [ + "middleware" + ], + "summary": "Get a policy", + "operationId": "read_policy_v1_middleware_policies__policy_id__get", + "parameters": [ + { + "required": true, + "schema": { + "title": "Policy Id", + "type": "string" + }, + "name": "policy_id", + "in": "path" + }, + { + "required": false, + "schema": { + "title": "Fiware-Service", + "type": "string" + }, + "name": "fiware-service", + "in": "header" + }, + { + "required": false, + "schema": { + "title": "Fiware-Servicepath", + "type": "string" + }, + "name": "fiware-servicepath", + "in": "header" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Policy" + } + } + } + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "put": { + "tags": [ + "middleware" + ], + "summary": "Update a policy for a given Tenant and Service Path", + "operationId": "update_v1_middleware_policies__policy_id__put", + "parameters": [ + { + "required": true, + "schema": { + "title": "Policy Id", + "type": "string" + }, + "name": "policy_id", + "in": "path" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyCreate" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "middleware" + ], + "summary": "Delete a policy for a given Tenant and Service Path", + "operationId": "delete_policy_v1_middleware_policies__policy_id__delete", + "parameters": [ + { + "required": true, + "schema": { + "title": "Policy Id", + "type": "string" + }, + "name": "policy_id", + "in": "path" + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, "/": { "get": { "summary": "Return Anubis API endpoints",