Skip to content

Conversation

@teferi
Copy link
Collaborator

@teferi teferi commented Dec 16, 2016

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling 3c2be20 on api_raml into f3303a9 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling 5c0ca1e on api_raml into f3303a9 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling 07203d5 on api_raml into f3303a9 on master.

Copy link

@maretskiy maretskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why runbooks write-requests contains forms data instead of JSON (like in other projects)? This is very strange to me

title: Read Only Runbook API Service
version: v1
mediaType: application/json
baseUri: /api/{version}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

baseUri must include protocol and hostname.

(conform to the URI specification [RFC2396] or a Level 1 Template URI as defined in RFC 6570)

https://github.com/raml-org/raml-spec/blob/0.8/raml-0.8.md#base-uri-and-baseuriparameters

By the way Abao uses baseUri as default endpoint so this can simplify Abao CLI args on gates further if set to this value:

baseUri: http://127.0.0.1:5000/api/{version}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, looks like you're right. I just wanted to use it as a shorthand, will remove

runbook_id:
description: Id of a particular runbook
type: string
put:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not clear to me, how runbook_id could be known before PUT is complete? Normally, all PUT requests are made for the same URL (for example .../region/{region}/runbooks) and runbook_id of created runbook is returned with the PUT response, isn't it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, all PUT requests are made for the same URL
well, no. This url allows altering a specific runbook, so you already know the resource id.
as per RFC
The PUT method requests that the state of the target resource be
created or replaced with the state defined by the representation
enclosed in the request message payload
so a PUT request to .../runbooks should replace the entire collection with another collection.
https://en.wikipedia.org/wiki/Representational_state_transfer#Relationship_between_URL_and_HTTP_methods this article gives a nice overview on how restfull api's usually correspond to http methods
or this article http://restful-api-design.readthedocs.io/en/latest/methods.html#standard-methods
Usually PUT is used on resource-scope, not collection

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Agree

description: Update contents of a runbook
body:
application/json:
formParameters: !include forms/runbook.yaml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whty forms???? This is not a request from a WEB page! This is simple JSON data in the request body. No form-encoded data.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would you describe which parameters are acceptable and which are mandatory? it's a form with application/json type request

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsonschema

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

Successfully merging this pull request may close these issues.

4 participants