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
[WIP] Add swagger docs for new OEM partners API #454
Conversation
We need to document the new API for pre-activation of OEM partner orders (to be implemented yet). As a first start, I documented the current API with Swagger/OpenAPI.
In this commit, I add documentation for the coming endpoints `partner_orders/pre_activation` and `partner_order/renewal`, which are yet to be implemented.
doc/OEM-Partner-API.md
Outdated
@@ -1,5 +1,17 @@ | |||
The purpose of this document is to describe the way of communication between OEM partners and SUSE Customer Center API. | |||
|
|||
A Swagger documentation is available in this repository. You just need to server it locally with the following commands: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Swagger documentation is available in this repository. You just need to server it locally with the following commands: | |
A Swagger documentation is available in this repository. You just need to serve it locally with the following commands: |
api_docs/swagger/swagger.yaml
Outdated
`APIAuth-HMAC-SHA256 112233:wvSi7Ach641iUvDTVE5AEVQCwXdH0uSfUQecJTlLSIolxVmqmk7gESkUIi+65R4x6OcDNy6ytVNBbQ5hlLzBpH0V3QolvYFHRgwQqcGhcbSDrUX7nQyVREilfVJ4FYaIirBnfXWYwi9K43bXHcEWj/mBQ1A8c7vpViWpalCdf8M=` | ||
|
||
servers: | ||
- url: "{protocol}://scc.suse.com/api/oem" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required: true | ||
type: array | ||
items: | ||
$ref: '/swagger/swagger.yaml#/components/requestBodies/PartnerOrderItemPayload' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I miss the description
of these fields.
What are they for? Do they need to follow a format? Do they have any validations?
And also importantly: what does SCC do with the data?
For example:
- Does OEM token need to be unique?
In the case of in-activated subs, we could document that end-users need to use the token to claim their subscriptions; in the case of pre-activated subs, end-users don't need it, but we should state that the renewal order needs to have the same token as the original order, etc. - Email: do we send the user something? Is only 1 email allowed?
- starts at: how does the end date get calculated? does it really need to be a
date-time
, or can we allow a simple date? - end_user_account_number: what is this for? Does it need to follow a format?
schema: | ||
$ref: '/swagger/swagger.yaml#/components/requestBodies/PartnerOrderPayload' | ||
responses: | ||
'200': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 200 the only possible response? What about errors? How are they presented, in terms of error code and message format?
- $ref: '/swagger/swagger.yaml#/components/parameters/Date' | ||
- $ref: '/swagger/swagger.yaml#/components/parameters/ContentMd5' | ||
- $ref: '/swagger/swagger.yaml#/components/parameters/Authorization' | ||
summary: Place a pre-activated OEM partner order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we explain somewhere the difference between a "pre-activated" partner order and "regular" (?) partner order?
I know I left a lot of comments, but don't take it the wrong way =) I think this is a GREAT improvement over our existing documentation! |
required: true | ||
type: string | ||
example: 987654 | ||
end_user_account_number: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we accept UC site id's here, in addition to SF account numbers?
I ask because brand new SUSE customers will not have a SF account number.
Right now, we allow customers to enable OEM subs on a UC org, and at that point we create the account in SF and assign its SF account number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should work only with the UC site IDs then? If this is data which the end user can always inform OEM partners, maybe it's a better option to consider.
Otherwise, do you think we should accept both UC site IDs and SF account numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand, most FJ customers are also SUSE customers, so they will have an SF account number.
But there will be some that are not SUSE customers yet, and will therefore not have an SF acct num.
Therefore, I think we could accept both.
content: | ||
application/json: | ||
schema: | ||
$ref: '/swagger/swagger.yaml#/components/schemas/PartnerOrder' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the call today, did I understand correctly that renewal partner orders do not need to receive a starts_at
nor a the end user account number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is right. And also I understand that there'll be no use for the expires_at
date once subscriptions' lifespans will be computed using the SKU duration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok; I think we are still displaying those fields in the docs for the renewal endpoint though, aren't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the PartnerOrder
schema is the same in all endpoints, just the payloads differ.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes, I commented on the wrong line, sorry! I meant about the payload. Are the different payloads for new/renew orders documented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm improving the field and operations descriptions to match the the same style used in the SCC API Swagger.
Well Done! Your tests are still passing. |
Closing this PR since we moved the Swagger documentation to https://scc.suse.com/connect/v4/documentation/. |
In this pull request I implement Swagger for documenting the OEM partners API.