UsageReportManager

The type is used to implement Usage Report API

GraphViz

Schema

The considered APS type (download) extends the Resource APS type(s) and looks as follows:

{
  "name": "UsageReportManager",
  "id": "http://com.odin.rating/usage-report-manager/1.0",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "operations": {
    "getUsageReports": {
      "path": "usageReports",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "UsageReportDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "getUsageReport": {
      "path": "usageReports/{reportId}",
      "verb": "GET",
      "response": {
        "type": "UsageReportDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "reportId": {
          "kind": "path",
          "type": "integer"
        }
      }
    },
    "updateUsageReport": {
      "path": "usageReports/{reportId}",
      "verb": "PUT",
      "response": {
        "type": "UsageReportDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "reportId": {
          "kind": "path",
          "type": "integer"
        },
        "updatedUsageReport": {
          "kind": "body",
          "type": "UsageReportDTO"
        }
      }
    },
    "getUsageReportRecords": {
      "path": "usageReports/{reportId}/records",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "UsageRecordDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "reportId": {
          "kind": "path",
          "type": "integer"
        }
      }
    },
    "updateUsageRecordStatuses": {
      "path": "usageReports/{reportId}/recordStatuses",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "reportId": {
          "kind": "path",
          "type": "integer"
        },
        "usageRecordStatusesDTO": {
          "kind": "body",
          "type": "UpdateUsageRecordStatusesDTO"
        }
      }
    },
    "getUsageRecord": {
      "path": "usageRecords/{recordId}",
      "verb": "GET",
      "response": {
        "type": "UsageRecordDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "recordId": {
          "kind": "path",
          "type": "integer"
        }
      }
    },
    "getUsageReportErrors": {
      "path": "usageReports/{reportId}/errors",
      "verb": "GET",
      "response": {
        "type": "object"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "reportId": {
          "kind": "path",
          "type": "integer"
        }
      }
    },
    "rerunUsageReportProcessing": {
      "path": "usageReports/{reportId}/rerunProcessing",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "reportId": {
          "kind": "path",
          "type": "integer"
        }
      }
    },
    "cancelUsageReport": {
      "path": "usageReports/{reportId}/cancel",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "reportId": {
          "kind": "path",
          "type": "integer"
        }
      }
    }
  },
  "structures": {
    "VendorUsageReportDetailsDTO": {
      "type": "object",
      "properties": {
        "reportId": {
          "type": "string"
        },
        "reportName": {
          "type": "string"
        },
        "reportNote": {
          "type": "string"
        },
        "productId": {
          "type": "string"
        },
        "productName": {
          "type": "string"
        }
      }
    },
    "UsageReportDTO": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "uploadDate": {
          "type": "string",
          "format": "date-time"
        },
        "modifiedDate": {
          "type": "string",
          "format": "date-time"
        },
        "source": {
          "type": "string",
          "enum": [
            "BATCH",
            "FILE"
          ]
        },
        "vendorDetails": {
          "type": "VendorUsageReportDetailsDTO"
        },
        "status": {
          "type": "string",
          "enum": [
            "VALIDATION_FAILED",
            "GUIDING_FAILED",
            "IMPORTING",
            "IMPORTED",
            "CANCELED",
            "RATING_RUNNING",
            "RATED",
            "RATING_FAILED",
            "ORDERS_PLACING",
            "ORDERS_PLACED",
            "ORDERS_PLACING_FAILED"
          ]
        }
      }
    },
    "UsageRecordDTO": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "externalId": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "ALL_LEVELS",
            "COS",
            "MSRP",
            "QUANTITY"
          ]
        },
        "accountId": {
          "type": "integer"
        },
        "accountUUID": {
          "type": "string"
        },
        "subscriptionId": {
          "type": "integer"
        },
        "subscriptionUUID": {
          "type": "string"
        },
        "resourceId": {
          "type": "integer"
        },
        "resourceUUID": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "mpn": {
          "type": "string"
        },
        "poNumber": {
          "type": "string"
        },
        "uom": {
          "type": "string"
        },
        "quantity": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        },
        "price": {
          "type": "number"
        },
        "amount": {
          "type": "number"
        },
        "attributes": {
          "type": "dictionary"
        },
        "description": {
          "type": "string"
        },
        "externalHash": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "IMPORTED",
            "RATED",
            "RATING_FAILED",
            "ORDER_PLACED",
            "ORDER_PLACING_FAILED"
          ]
        },
        "errorMessage": {
          "type": "string"
        }
      }
    },
    "UpdateUsageRecordStatusDTO": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "status": {
          "type": "string",
          "enum": [
            "IMPORTED",
            "RATED",
            "RATING_FAILED",
            "ORDERS_CREATED",
            "ORDERS_CREATION_FAILED"
          ]
        },
        "errorMessage": {
          "type": "string"
        }
      }
    },
    "UpdateUsageRecordStatusesDTO": {
      "type": "object",
      "properties": {
        "usageRecordStatuses": {
          "type": "array",
          "items": {
            "type": "UpdateUsageRecordStatusDTO"
          }
        }
      }
    }
  }
}

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

getUsageReports

GET

/usageReports

List of UsageReportDTO

Gets information about usage reports

getUsageReport

GET

/usageReports/{reportId}

UsageReportDTO

Gets information about usage reports

updateUsageReport

PUT

/usageReports/{reportId}

UsageReportDTO

Updates usage report status

getUsageReportRecords

GET

/usageReports/{reportId}/records

List of UsageRecordDTO

Gets usage records of usage reports

updateUsageRecordStatuses

POST

/usageReports/{reportId}/recordStatuses

UsageReportDTO

Updates usage report status

getUsageRecord

GET

/usageRecords/{recordId}

UsageRecordDTO

Gets information about the usage record

getUsageReportErrors

GET

/usageReports/{reportId}/errors

Get report errors as CSV file

rerunUsageReportProcessing

POST

/usageReports/{reportId}/rerunProcessing

Re-run usage report processing

cancelUsageReport

POST

/usageReports/{reportId}/cancel

Cancel usage report

getUsageReports

HTTP Request

GET /aps/2/resources/{aps-id}/usageReports

Description

Gets information about usage reports

Returns

List of UsageReportDTO

getUsageReport

HTTP Request

GET /aps/2/resources/{aps-id}/usageReports/{reportId}

Description

Gets information about usage reports

Parameters

PARAMETER

TYPE

DESCRIPTION

reportId

Integer

Returns

UsageReportDTO

updateUsageReport

HTTP Request

PUT /aps/2/resources/{aps-id}/usageReports/{reportId}

Description

Updates usage report status

Parameters

PARAMETER

TYPE

DESCRIPTION

reportId

Integer

updatedUsageReport

UsageReportDTO

Returns

UsageReportDTO

getUsageReportRecords

HTTP Request

GET /aps/2/resources/{aps-id}/usageReports/{reportId}/records

Description

Gets usage records of usage reports

Parameters

PARAMETER

TYPE

DESCRIPTION

reportId

Integer

Returns

List of UsageRecordDTO

updateUsageRecordStatuses

HTTP Request

POST /aps/2/resources/{aps-id}/usageReports/{reportId}/recordStatuses

Description

Updates usage report status

Parameters

PARAMETER

TYPE

DESCRIPTION

reportId

Integer

usageRecordStatusesDTO

UpdateUsageRecordStatusesDTO

Returns

UsageReportDTO

getUsageRecord

HTTP Request

GET /aps/2/resources/{aps-id}/usageRecords/{recordId}

Description

Gets information about the usage record

Parameters

PARAMETER

TYPE

DESCRIPTION

recordId

Integer

Returns

UsageRecordDTO

getUsageReportErrors

HTTP Request

GET /aps/2/resources/{aps-id}/usageReports/{reportId}/errors

Description

Get report errors as CSV file

Parameters

PARAMETER

TYPE

DESCRIPTION

reportId

Integer

Returns

rerunUsageReportProcessing

HTTP Request

POST /aps/2/resources/{aps-id}/usageReports/{reportId}/rerunProcessing

Description

Re-run usage report processing

Parameters

PARAMETER

TYPE

DESCRIPTION

reportId

Integer

Returns

cancelUsageReport

HTTP Request

POST /aps/2/resources/{aps-id}/usageReports/{reportId}/cancel

Description

Cancel usage report

Parameters

PARAMETER

TYPE

DESCRIPTION

reportId

Integer

Returns

Structures

VendorUsageReportDetailsDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

reportId

String

Not Required

reportName

String

Not Required

reportNote

String

Not Required

productId

String

Not Required

productName

String

Not Required

UsageReportDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

id

Integer

Not Required

uploadDate

String

Not Required

modifiedDate

String

Not Required

source

Enum

Not Required

vendorDetails

VendorUsageReportDetailsDTO

Not Required

status

Enum

Not Required

UsageRecordDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

id

Integer

Not Required

externalId

String

Not Required

type

Enum

Not Required

accountId

Integer

Not Required

accountUUID

String

Not Required

subscriptionId

Integer

Not Required

subscriptionUUID

String

Not Required

resourceId

Integer

Not Required

resourceUUID

String

Not Required

startDate

String

Not Required

endDate

String

Not Required

mpn

String

Not Required

poNumber

String

Not Required

uom

String

Not Required

quantity

Number

Not Required

currency

String

Not Required

price

Number

Not Required

amount

Number

Not Required

attributes

Dictionary

Not Required

description

String

Not Required

externalHash

String

Not Required

status

Enum

Not Required

errorMessage

String

Not Required

UpdateUsageRecordStatusDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

id

Integer

Not Required

status

Enum

Not Required

errorMessage

String

Not Required

UpdateUsageRecordStatusesDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

usageRecordStatuses

Array of UpdateUsageRecordStatusDTO

Not Required

Examples

Since the considered APS type contains custom operations, refer to Custom Operations for the general explanation of their structure and examples of operation calls.