# Utilization

Utilization data

## GET /{contract}/utilization

> Get a high-granularity data of resources utilization

```json
{"openapi":"3.0.0","info":{"title":"IONOS Cloud Billing API","version":"3.9.0"},"tags":[{"name":"utilization","description":"Utilization data"}],"servers":[{"url":"https://api.ionos.com/billing","description":"Production API"}],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"ContractParameter":{"name":"contract","in":"path","description":"Contract number","required":true,"schema":{"type":"integer","pattern":"[0-9]{5,10}"}},"DcQueryParameter":{"name":"dc","in":"query","description":"Filter out by particular VDC UUID (or \"Bucket\" UUID for non-vdc related resources)","required":false,"schema":{"type":"string","format":"uuid"}},"ResourceQueryParameter":{"name":"resource","in":"query","description":"Filter out by particular resource UUID (e.g.VM UUID, NIC UUID)","required":false,"schema":{"type":"string","format":"uuid"}},"TypeQueryParameter":{"name":"type","in":"query","description":"Filter out by particular type of items","required":false,"schema":{"$ref":"#/components/schemas/ResourceTypes"}}},"schemas":{"ResourceTypes":{"type":"string","enum":["SERVER","STORAGE","SNAPSHOT","NATGATEWAY","NIC","IP","IP_ADDRESS","CUBETEMPLATE","LOADBALANCER","BACKUP","S3","TRAFFIC","DB","BMC","DBAAS","CRAAS","LAAS","DSAAS","DNS"]},"UtilizationDataCenter":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"meters":{"type":"array","items":{"$ref":"#/components/schemas/UtilizationMeter"}}}},"UtilizationMeter":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"resourceId":{"type":"string","format":"uuid","nullable":true},"serverId":{"type":"string","format":"uuid","nullable":true},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ResourceTypes"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"exists":{"type":"boolean","nullable":true},"meterId":{"type":"string","enum":["A01000","ALB1000","ALB1100","BU1100","BU1200","BU1300","BU1400","BU1500","C01000","C02000","C03000","CC1000","CR1000","CUBExxxx","CWSQL1001","CWSQL2001","CWSQL3001","CWSQL1000","CWSQL2000","DAS1000","DBPGB1000","DBPGC1000","DBPGR1000","DBPGS1000","DBPGS2000","DBPGS3000","NAT1000","NC1000","NLB1000","NLB1100","R01000","S01000","S02000","S03000","S05000","S3AU1100","S3AU1200","S3AU1300","S3RD1100","S3SU1100","S3SU1200","S3SU1300","S3TI1000","S3TI1100","S3TO1000","S3TO1100","S3TO1200","S3TO1300","S3TO1400","S3WR1100","TI1000","TO1000","WL1000","WL2000","WL3000","WL4000","WL5000","WL6000"]},"meterDesc":{"type":"string"},"region":{"type":"string"},"quantity":{"type":"object","properties":{"quantity":{"type":"number"},"unit":{"type":"string"}}}}},"MetaData":{"type":"object","properties":{"contractId":{"type":"integer"},"customerId":{"type":"integer"},"reference":{"type":"string","nullable":true}}}},"responses":{"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object"}}}},"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object"}}}},"NotFound":{"description":"The contract not found or doesn't belong to the user","content":{"application/json":{"schema":{"type":"object"}}}},"Unprocessable":{"description":"Wrong period format specified","content":{"application/json":{"schema":{"type":"object"}}}},"InternalError":{"description":"Unexpected internal server error","content":{"application/json":{"schema":{"type":"object"}}}}}},"paths":{"/{contract}/utilization":{"get":{"tags":["utilization"],"description":"Get a high-granularity data of resources utilization","operationId":"utilizationGet","parameters":[{"$ref":"#/components/parameters/ContractParameter"},{"$ref":"#/components/parameters/DcQueryParameter"},{"$ref":"#/components/parameters/ResourceQueryParameter"},{"$ref":"#/components/parameters/TypeQueryParameter"}],"responses":{"200":{"description":"Result data","content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"datacenters":{"type":"array","items":{"$ref":"#/components/schemas/UtilizationDataCenter"}},"metadata":{"$ref":"#/components/schemas/MetaData"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Unprocessable"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## GET /{contract}/utilization/{period}

> Get a high-granularity data of resources utilization for a certain period

```json
{"openapi":"3.0.0","info":{"title":"IONOS Cloud Billing API","version":"3.9.0"},"tags":[{"name":"utilization","description":"Utilization data"}],"servers":[{"url":"https://api.ionos.com/billing","description":"Production API"}],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"ContractParameter":{"name":"contract","in":"path","description":"Contract number","required":true,"schema":{"type":"integer","pattern":"[0-9]{5,10}"}},"PeriodParameter":{"name":"period","in":"path","description":"Period of interest in format YYYY-MM","required":true,"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}|null)$"}},"DcQueryParameter":{"name":"dc","in":"query","description":"Filter out by particular VDC UUID (or \"Bucket\" UUID for non-vdc related resources)","required":false,"schema":{"type":"string","format":"uuid"}},"ResourceQueryParameter":{"name":"resource","in":"query","description":"Filter out by particular resource UUID (e.g.VM UUID, NIC UUID)","required":false,"schema":{"type":"string","format":"uuid"}},"TypeQueryParameter":{"name":"type","in":"query","description":"Filter out by particular type of items","required":false,"schema":{"$ref":"#/components/schemas/ResourceTypes"}}},"schemas":{"ResourceTypes":{"type":"string","enum":["SERVER","STORAGE","SNAPSHOT","NATGATEWAY","NIC","IP","IP_ADDRESS","CUBETEMPLATE","LOADBALANCER","BACKUP","S3","TRAFFIC","DB","BMC","DBAAS","CRAAS","LAAS","DSAAS","DNS"]},"UtilizationDataCenter":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"meters":{"type":"array","items":{"$ref":"#/components/schemas/UtilizationMeter"}}}},"UtilizationMeter":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"resourceId":{"type":"string","format":"uuid","nullable":true},"serverId":{"type":"string","format":"uuid","nullable":true},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ResourceTypes"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"exists":{"type":"boolean","nullable":true},"meterId":{"type":"string","enum":["A01000","ALB1000","ALB1100","BU1100","BU1200","BU1300","BU1400","BU1500","C01000","C02000","C03000","CC1000","CR1000","CUBExxxx","CWSQL1001","CWSQL2001","CWSQL3001","CWSQL1000","CWSQL2000","DAS1000","DBPGB1000","DBPGC1000","DBPGR1000","DBPGS1000","DBPGS2000","DBPGS3000","NAT1000","NC1000","NLB1000","NLB1100","R01000","S01000","S02000","S03000","S05000","S3AU1100","S3AU1200","S3AU1300","S3RD1100","S3SU1100","S3SU1200","S3SU1300","S3TI1000","S3TI1100","S3TO1000","S3TO1100","S3TO1200","S3TO1300","S3TO1400","S3WR1100","TI1000","TO1000","WL1000","WL2000","WL3000","WL4000","WL5000","WL6000"]},"meterDesc":{"type":"string"},"region":{"type":"string"},"quantity":{"type":"object","properties":{"quantity":{"type":"number"},"unit":{"type":"string"}}}}},"MetaData":{"type":"object","properties":{"contractId":{"type":"integer"},"customerId":{"type":"integer"},"reference":{"type":"string","nullable":true}}}},"responses":{"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object"}}}},"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object"}}}},"NotFound":{"description":"The contract not found or doesn't belong to the user","content":{"application/json":{"schema":{"type":"object"}}}},"Unprocessable":{"description":"Wrong period format specified","content":{"application/json":{"schema":{"type":"object"}}}},"InternalError":{"description":"Unexpected internal server error","content":{"application/json":{"schema":{"type":"object"}}}}}},"paths":{"/{contract}/utilization/{period}":{"get":{"tags":["utilization"],"description":"Get a high-granularity data of resources utilization for a certain period","operationId":"utilizationFindByPeriod","parameters":[{"$ref":"#/components/parameters/ContractParameter"},{"$ref":"#/components/parameters/PeriodParameter"},{"$ref":"#/components/parameters/DcQueryParameter"},{"$ref":"#/components/parameters/ResourceQueryParameter"},{"$ref":"#/components/parameters/TypeQueryParameter"}],"responses":{"200":{"description":"Result data","content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"datacenters":{"type":"array","items":{"$ref":"#/components/schemas/UtilizationDataCenter"}},"metadata":{"$ref":"#/components/schemas/MetaData"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Unprocessable"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## GET /{contract}/utilization/daily/{date}

> Get a high-granularity data of resources utilization for a certain date

```json
{"openapi":"3.0.0","info":{"title":"IONOS Cloud Billing API","version":"3.9.0"},"tags":[{"name":"utilization","description":"Utilization data"}],"servers":[{"url":"https://api.ionos.com/billing","description":"Production API"}],"security":[{"basicAuth":[]},{"bearerAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"ContractParameter":{"name":"contract","in":"path","description":"Contract number","required":true,"schema":{"type":"integer","pattern":"[0-9]{5,10}"}},"DateParameter":{"name":"date","in":"path","description":"Date of interest in format YYYY-MM-DD","required":true,"schema":{"type":"string","nullable":true,"pattern":"^(\\d{4}-\\d{2}-\\d{2})$"}},"DcQueryParameter":{"name":"dc","in":"query","description":"Filter out by particular VDC UUID (or \"Bucket\" UUID for non-vdc related resources)","required":false,"schema":{"type":"string","format":"uuid"}},"ResourceQueryParameter":{"name":"resource","in":"query","description":"Filter out by particular resource UUID (e.g.VM UUID, NIC UUID)","required":false,"schema":{"type":"string","format":"uuid"}},"TypeQueryParameter":{"name":"type","in":"query","description":"Filter out by particular type of items","required":false,"schema":{"$ref":"#/components/schemas/ResourceTypes"}}},"schemas":{"ResourceTypes":{"type":"string","enum":["SERVER","STORAGE","SNAPSHOT","NATGATEWAY","NIC","IP","IP_ADDRESS","CUBETEMPLATE","LOADBALANCER","BACKUP","S3","TRAFFIC","DB","BMC","DBAAS","CRAAS","LAAS","DSAAS","DNS"]},"UtilizationDataCenter":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"meters":{"type":"array","items":{"$ref":"#/components/schemas/UtilizationMeter"}}}},"UtilizationMeter":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"resourceId":{"type":"string","format":"uuid","nullable":true},"serverId":{"type":"string","format":"uuid","nullable":true},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ResourceTypes"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"exists":{"type":"boolean","nullable":true},"meterId":{"type":"string","enum":["A01000","ALB1000","ALB1100","BU1100","BU1200","BU1300","BU1400","BU1500","C01000","C02000","C03000","CC1000","CR1000","CUBExxxx","CWSQL1001","CWSQL2001","CWSQL3001","CWSQL1000","CWSQL2000","DAS1000","DBPGB1000","DBPGC1000","DBPGR1000","DBPGS1000","DBPGS2000","DBPGS3000","NAT1000","NC1000","NLB1000","NLB1100","R01000","S01000","S02000","S03000","S05000","S3AU1100","S3AU1200","S3AU1300","S3RD1100","S3SU1100","S3SU1200","S3SU1300","S3TI1000","S3TI1100","S3TO1000","S3TO1100","S3TO1200","S3TO1300","S3TO1400","S3WR1100","TI1000","TO1000","WL1000","WL2000","WL3000","WL4000","WL5000","WL6000"]},"meterDesc":{"type":"string"},"region":{"type":"string"},"quantity":{"type":"object","properties":{"quantity":{"type":"number"},"unit":{"type":"string"}}}}},"MetaData":{"type":"object","properties":{"contractId":{"type":"integer"},"customerId":{"type":"integer"},"reference":{"type":"string","nullable":true}}}},"responses":{"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object"}}}},"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object"}}}},"NotFound":{"description":"The contract not found or doesn't belong to the user","content":{"application/json":{"schema":{"type":"object"}}}},"Unprocessable":{"description":"Wrong period format specified","content":{"application/json":{"schema":{"type":"object"}}}},"InternalError":{"description":"Unexpected internal server error","content":{"application/json":{"schema":{"type":"object"}}}}}},"paths":{"/{contract}/utilization/daily/{date}":{"get":{"tags":["utilization"],"description":"Get a high-granularity data of resources utilization for a certain date","operationId":"utilizationDailyFindById","parameters":[{"$ref":"#/components/parameters/ContractParameter"},{"$ref":"#/components/parameters/DateParameter"},{"$ref":"#/components/parameters/DcQueryParameter"},{"$ref":"#/components/parameters/ResourceQueryParameter"},{"$ref":"#/components/parameters/TypeQueryParameter"}],"responses":{"200":{"description":"Result data","content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"datacenters":{"type":"array","items":{"$ref":"#/components/schemas/UtilizationDataCenter"}},"metadata":{"$ref":"#/components/schemas/MetaData"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Unprocessable"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```
