Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST /platforms/:platform/known-hosts #53

Open
davidraker opened this issue Mar 8, 2022 · 0 comments
Open

POST /platforms/:platform/known-hosts #53

davidraker opened this issue Mar 8, 2022 · 0 comments

Comments

@davidraker
Copy link
Contributor

Create a new known-host record for another platform known to the specified platform.

The Location header will return a route to the new resource, with :known-host having the format :address-:port.

Note: Attempting to create a known host entry when one already exists for the same address/port combination will return 409 Conflict with a Content-Location header pointing to the route of the conflicting record.

⚠️ The colon is a reserved character in a URI. The path known-hosts variable is delimited by a dash: e.g.: :address-:port.

Request:

  • Authorization: BEARER <jwt_token>
    • Content Type: application/json
    • Body:
      {
          "address": "<address>",
          "port": "<port>",
          "key": "<server_key>"
      },
      

Response:

  • With valid BEARER token on success: 201 Created
    • Location: /platforms/:platform/known-hosts/:known-host
  • With valid BEARER token if group name already exists: 409 Conflict
    • Content Type: application/json
    • Content-Location: /vui/platforms/:platform/known-hosts/:address-:port
    • Body:
      {
          "error": "Unable to create known-host entry: :address-:port, as a known host entry with this address and port already exists ."
      }
      
  • With valid BEARER token on other failure: 400 Bad Request
    • Content Type: application/json
    • Body:
      {
          "error": "<Error Message>"
      }
      
  • With invalid BEARER token: 401 Unauthorized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant