-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* build, dotenv rhsm api endpoint * build, scripts and temporary rhsm swagger for local doc run * rhelServices, implement rhsm endpoint, mock added * redux, action, reducer, types * unit tests, snapshots
- Loading branch information
Showing
12 changed files
with
388 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
openapi: "3.0.2" | ||
info: | ||
title: "rhsm-subscriptions-api" | ||
description: "REST interface for the rhsm-subscriptions service." | ||
version: 1.0.0 | ||
|
||
servers: | ||
- url: http://localhost:8080/api/rhsm-subscriptions/v1 | ||
- url: https://ci.cloud.paas.upshift.redhat.com/api/rhsm-subscriptions/v1 | ||
- url: https://qa.cloud.paas.upshift.redhat.com/api/rhsm-subscriptions/v1 | ||
- url: https://stage.cloud.paas.upshift.redhat.com/api/rhsm-subscriptions/v1 | ||
- url: https://cloud.redhat.com/api/rhsm-subscriptions/v1 | ||
|
||
paths: | ||
/tally/accounts/{account_number}/products/{product_id}: | ||
description: "Operations for a tally report of a specific account and product." | ||
parameters: | ||
- name: x-rh-identity | ||
in: header | ||
required: true | ||
schema: | ||
type: string | ||
format: byte | ||
description: "Identity header provided by 3Scale." | ||
- name: account_number | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
description: "Account number to fetch data for. Must match the authenticated account number." | ||
- name: product_id | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
description: "The ID for the product we wish to query" | ||
get: | ||
summary: "Fetch a tally report for an account and product." | ||
operationId: getTallyReport | ||
parameters: | ||
- name: granularity | ||
in: query | ||
required: true | ||
schema: | ||
type: string | ||
description: "The level of granularity to return." | ||
- name: beginning | ||
in: query | ||
required: false | ||
schema: | ||
type: string | ||
format: date-time | ||
description: "Defines the start of the report period. Dates should be provided in ISO 8601 | ||
format but the only accepted offset is UTC. E.g. 2017-07-21T17:32:28Z" | ||
- name: ending | ||
in: query | ||
required: false | ||
schema: | ||
type: string | ||
format: date-time | ||
description: "Defines the end of the report period. Defaults to the current time. Dates should | ||
be provided in UTC." | ||
responses: | ||
'200': | ||
description: 'The request for a tally report was successful.' | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: "#/components/schemas/TallyReport" | ||
'400': | ||
$ref: '#/components/responses/BadRequest' | ||
'403': | ||
$ref: '#/components/responses/Forbidden' | ||
'404': | ||
$ref: '#/components/responses/ResourceNotFound' | ||
'500': | ||
$ref: '#/components/responses/InternalServerError' | ||
tags: | ||
- tally | ||
/openapi.json: | ||
get: | ||
description: "Get the OpenAPI spec in JSON format." | ||
operationId: getOpenApiJson | ||
tags: | ||
- root | ||
responses: | ||
'200': | ||
description: "The request to get the OpenAPI JSON was successful." | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
/openapi.yaml: | ||
get: | ||
description: "Get the OpenAPI spec in YAML format." | ||
operationId: getOpenApiYaml | ||
tags: | ||
- root | ||
responses: | ||
'200': | ||
description: "The request to get the OpenAPI YAML was successful." | ||
content: | ||
application/x-yaml: | ||
schema: | ||
type: string | ||
|
||
components: | ||
responses: | ||
InternalServerError: | ||
description: "An internal server error has occurred and is not recoverable." | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: "#/components/schemas/Errors" | ||
BadRequest: | ||
description: "The server could could not process the current request." | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: "#/components/schemas/Errors" | ||
Forbidden: | ||
description: "The request was valid, but the request was refused by the server." | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: "#/components/schemas/Errors" | ||
ResourceNotFound: | ||
description: "The requested resource was not found." | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: "#/components/schemas/Errors" | ||
ServiceUnavailable: | ||
description: "The server is currently unavailable." | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: "#/components/schemas/Errors" | ||
|
||
schemas: | ||
TallyReport: | ||
properties: | ||
product: | ||
type: string | ||
granularity: | ||
description: "Describes the significance of each date in the TallySnapshot list. For example if the | ||
granularity is set to 'weekly', the dates in the TallySnapshot list will represent the start of a | ||
seven day period." | ||
type: string | ||
tally_snapshots: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/TallySnapshot" | ||
|
||
TallySnapshot: | ||
# Container for fields we capture from the IT endpoint for upload to inventory service. The element | ||
# being reported should be the only non-required element. E.g. snapshots containing memory will have | ||
# date, instance count, and memory elements while snapshots containing cores will contain date, | ||
# instance count, and cores. | ||
required: | ||
- date | ||
- instance_count | ||
properties: | ||
date: | ||
type: string | ||
format: date-time | ||
description: "The start date for this snapshot entry. Dates are returned in UTC. Clients must | ||
consult the 'granularity' field in the TallyReport to determine the length of time each | ||
TallySnapshot covers." | ||
instance_count: | ||
type: integer | ||
format: int32 | ||
minimum: 0 | ||
cores: | ||
type: integer | ||
format: int32 | ||
minimum: 0 | ||
|
||
Errors: | ||
required: | ||
- errors | ||
properties: | ||
errors: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/Error" | ||
|
||
Error: | ||
required: | ||
- status | ||
- code | ||
- title | ||
properties: | ||
status: | ||
type: string | ||
code: | ||
type: string | ||
title: | ||
type: string | ||
detail: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.