Skip to content

Get Cost Categories

costexplorer_get_cost_categories R Documentation

Retrieves an array of Cost Category names and values incurred cost

Description

Retrieves an array of Cost Category names and values incurred cost.

If some Cost Category names and values are not associated with any cost, they will not be returned by this API.

Usage

costexplorer_get_cost_categories(SearchString, TimePeriod,
  CostCategoryName, Filter, SortBy, MaxResults, NextPageToken)

Arguments

SearchString

The value that you want to search the filter values for.

If you don't specify a CostCategoryName, SearchString is used to filter Cost Category names that match the SearchString pattern. If you specify a CostCategoryName, SearchString is used to filter Cost Category values that match the SearchString pattern.

TimePeriod

[required]

CostCategoryName
Filter
SortBy

The value that you sort the data by.

The key represents the cost and usage metrics. The following values are supported:

  • BlendedCost

  • UnblendedCost

  • AmortizedCost

  • NetAmortizedCost

  • NetUnblendedCost

  • UsageQuantity

  • NormalizedUsageAmount

The supported key values for the SortOrder value are ASCENDING and DESCENDING.

When you use the SortBy value, the NextPageToken and SearchString key values aren't supported.

MaxResults

This field is only used when the SortBy value is provided in the request.

The maximum number of objects that are returned for this request. If MaxResults isn't specified with the SortBy value, the request returns 1000 results as the default value for this parameter.

For get_cost_categories, MaxResults has an upper quota of 1000.

NextPageToken

If the number of objects that are still available for retrieval exceeds the quota, Amazon Web Services returns a NextPageToken value in the response. To retrieve the next batch of objects, provide the NextPageToken from the previous call in your next request.

Value

A list with the following syntax:

list(
  NextPageToken = "string",
  CostCategoryNames = list(
    "string"
  ),
  CostCategoryValues = list(
    "string"
  ),
  ReturnSize = 123,
  TotalSize = 123
)

Request syntax

svc$get_cost_categories(
  SearchString = "string",
  TimePeriod = list(
    Start = "string",
    End = "string"
  ),
  CostCategoryName = "string",
  Filter = list(
    Or = list(
      list()
    ),
    And = list(
      list()
    ),
    Not = list(),
    Dimensions = list(
      Key = "AZ"|"INSTANCE_TYPE"|"LINKED_ACCOUNT"|"LINKED_ACCOUNT_NAME"|"OPERATION"|"PURCHASE_TYPE"|"REGION"|"SERVICE"|"SERVICE_CODE"|"USAGE_TYPE"|"USAGE_TYPE_GROUP"|"RECORD_TYPE"|"OPERATING_SYSTEM"|"TENANCY"|"SCOPE"|"PLATFORM"|"SUBSCRIPTION_ID"|"LEGAL_ENTITY_NAME"|"DEPLOYMENT_OPTION"|"DATABASE_ENGINE"|"CACHE_ENGINE"|"INSTANCE_TYPE_FAMILY"|"BILLING_ENTITY"|"RESERVATION_ID"|"RESOURCE_ID"|"RIGHTSIZING_TYPE"|"SAVINGS_PLANS_TYPE"|"SAVINGS_PLAN_ARN"|"PAYMENT_OPTION"|"AGREEMENT_END_DATE_TIME_AFTER"|"AGREEMENT_END_DATE_TIME_BEFORE"|"INVOICING_ENTITY"|"ANOMALY_TOTAL_IMPACT_ABSOLUTE"|"ANOMALY_TOTAL_IMPACT_PERCENTAGE",
      Values = list(
        "string"
      ),
      MatchOptions = list(
        "EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL"
      )
    ),
    Tags = list(
      Key = "string",
      Values = list(
        "string"
      ),
      MatchOptions = list(
        "EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL"
      )
    ),
    CostCategories = list(
      Key = "string",
      Values = list(
        "string"
      ),
      MatchOptions = list(
        "EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL"
      )
    )
  ),
  SortBy = list(
    list(
      Key = "string",
      SortOrder = "ASCENDING"|"DESCENDING"
    )
  ),
  MaxResults = 123,
  NextPageToken = "string"
)