{"type":"api","title":"List Usage Metrics","meta":{"id":"/apps/pubhub/media/cloud-security-apis-in-eft/b34da64e8f0ce39c7999a1ce93b43851038fcded/7fb2a271-ae5d-3333-a7a7-1c93d01aa0af","info":{"version":"1.0.0","title":"Cisco Secure Access Metering API","description":"Report on the usage metrics for the organization.","contact":{"name":"Cloud Security Developer Community"}},"security":[{"oauthFlow":[]}],"tags":[{"name":"Usage Metrics"},{"name":"Secure Access"}],"x-parser-conf":{"overview":{"markdownPath":"secure-access/reference/reports/metering-overview.md","uri":"secure-access-api-reference-metering-overview"}},"openapi":"3.0.2","servers":[{"url":"https://api.sse.cisco.com/{basePath}","variables":{"basePath":{"default":"reports/v2"}}}],"securitySchemes":{"oauthFlow":{"type":"oauth2","description":"client credential flow","flows":{"clientCredentials":{"tokenUrl":"https://api.sse.cisco.com/auth/v2/token","scopes":{"reports.usage.metrics:read":"Get usage data"}}}}}},"spec":{"summary":"List Usage Metrics","description":"List the usage metrics for the organization.","tags":["Usage Metrics","Secure Access"],"operationId":"getUsageMetrics","security":[{"oauthFlow":["reports.usage.metrics:read"]}],"parameters":[{"name":"organization_id","in":"query","required":true,"schema":{"type":"integer"},"description":"The unique Secure Access organization ID.","example":1234567,"$$ref":"#/components/parameters/organization_id"},{"name":"product_id","in":"query","required":true,"schema":{"type":"string","format":"int32"},"description":"The unique source ID of the usage report, for example: SWG, RAVPN, CHNE.\nUse `0` to search for all products.","example":"0","$$ref":"#/components/parameters/product_id"},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"description":"The start of the time window to search for records in the collection.\nFilter for data in the collection that is recorded after this time.\nSpecify the time in ISO 8601 format.","example":"2020-01-01T20:52:02.987000","$$ref":"#/components/parameters/from"},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"description":"The end of the time window to search for records in the collection.\nFilter for data that appears before this time.\nSpecify the time in ISO 8601 format.","example":"2020-02-01T20:52:02.987000","$$ref":"#/components/parameters/to"},{"name":"time_grouping_interval","in":"query","required":true,"schema":{"type":"string","enum":["HOUR","DAY","WEEK","MONTH"]},"description":"A time period specified as a segment of time. The usage report is collected\nwithin the time internal. Valid values are: `HOUR`, `DAY`, `WEEK`, `MONTH`.","example":"DAY","$$ref":"#/components/parameters/time_grouping_interval"},{"name":"page","in":"query","schema":{"type":"string","format":"int32"},"description":"The page number that represents where to start reading in the collection.\nA page in the collection has a maximum of 1000 records.\nWhen a response has more than 1000 records, the `next` field is returned in the response.\nThe `next` field is set to the API request URL for the next page of records\nin the collection.","example":"2","$$ref":"#/components/parameters/page"}],"responses":{"200":{"description":"Success. Usage retrieved.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","body"],"properties":{"statusCode":{"type":"integer"},"body":{"type":"object","required":["usages"],"properties":{"usages":{"type":"array","items":{"type":"object","required":["organization_id","product","registered_at","usage_meter_items"],"properties":{"organization_id":{"type":"integer","description":"The unique Secure Access organization ID.","format":"int32","example":123456,"$$ref":"#/components/schemas/organization_id"},"product":{"type":"string","format":"int32","description":"The name of the Secure Access data source service.","example":"CNHE","$$ref":"#/components/schemas/product"},"registered_at":{"type":"string","format":"date-time","description":"The ISO 8601 timestamp when the usage was recorded in the origin service.\nThe timestamp uses the UTC format following the ISO 8601 date time standard.","example":"2020-01-01T20:52:02.987000","$$ref":"#/components/schemas/registered_at"},"usage_meter_items":{"type":"object","required":["bytes_in_delta","bytes_out_delta"],"properties":{"bytes_in_delta":{"type":"integer","description":"The number of cumulative bytes received by Secure Access during the time window.","format":"int64","example":15642,"$$ref":"#/components/schemas/bytes_in_delta"},"bytes_out_delta":{"type":"integer","description":"The number of cumulative bytes sent to Secure Access during the time window.","format":"int64","example":14896,"$$ref":"#/components/schemas/bytes_out_delta"}},"example":{"bytes_in_delta":1000000,"bytes_out_delta":2000000},"description":"The amount of data received and sent during the time window.","$$ref":"#/components/schemas/UsageMeterItem"}},"description":"The usage data and information about this usage.","example":{"organization_id":5432871,"product":"CNHE","registered_at":"2020-01-01T20:52:02.987000","usage_meter_items":{"bytes_in_delta":1000000,"bytes_out_delta":100000}},"$$ref":"#/components/schemas/Usage"}}},"example":{"usages":[{"organization_id":5432871,"product":"SWG","registered_at":"2020-01-01T20:52:02.987000","usage_meter_items":{"bytes_in_delta":1000000,"bytes_out_delta":2000000}}]}},"next":{"type":"string","description":"The URL of the next set of usage metric records in the collection.\n\"https://api.sse.cisco.com/reports/v2/usage/metrics?from=2022-07-15T20:00:00.000&to=2022-07-16T21:00:00.000\"","example":"https://api.sse.com/reports/v2/usage/metrics?from=2022-07-15T20:00:00.000&to=2022-07-16T21:00:00.000"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["body","statusCode"],"properties":{"statusCode":{"type":"integer","example":400},"body":{"type":"object","properties":{"Param error":{"type":"string","description":"There is an error in the parameter(s)","example":"Invalid time range: Datetime needs to follow ISO8601:%Y-%m-%dT%H:%M:%S.%f, e.g. 2022-06-18T20:52:02.987000 and FROM should be earlier than TO"}}}},"example":{"statusCode":400,"body":{"Param error":"Invalid time range: Datetime needs to follow ISO8601:%Y-%m-%dT%H:%M:%S.%f, e.g. 2022-06-18T20:52:02.987000 and FROM should be earlier than TO"}},"$$ref":"#/components/schemas/statusCode"}}},"$$ref":"#/components/responses/400Error"},"401":{"description":"Unauthorized request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"example":{"message":"Unauthorized request"}}}},"$$ref":"#/components/responses/401Error"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"example":{"message":"Access Forbidden"}}}},"$$ref":"#/components/responses/403Error"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"example":{"message":"Not Found"}}}},"$$ref":"#/components/responses/404Error"},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"example":{"message":"Server error"}}}},"$$ref":"#/components/responses/500Error"}},"__originalOperationId":"getUsageMetrics","method":"get","path":"/usage/metrics"}}