M2A Cache External API (local)

Download OpenAPI specification:Download

Endpoints to perform CRUD (create, read, update, delete) operations on M2A Cache resources.

Cache Access Control Configurations

Overview

Cache Access Control Configurations define access policies for M2A Cache resources. These policies include IP allowlists, CIDR-based rules, and HTTP header matching to ensure secure and controlled access to cached content. Users can perform CRUD (create, read, update, delete) operations to manage these configurations.

Terminology

  • Cache Access Control Configuration: A resource representing the set of rules that control access to M2A caches.
  • IP Allowlist: A list of IP ranges (e.g., in CIDR notation) that are granted access.
  • HTTP Header Rules: Rules that match specific HTTP headers to allow or deny access.
  • Owner: The account responsible for the access control configuration.

API Structure

The API follows the JSON:API standard (https://jsonapi.org/format/). Key relationships include:

  • Owner: The owner of the access control configuration (one-to-one relationship).
  • IP Rules: A collection of IP ranges that define allowlist policies (one-to-many relationship).

Each configuration must be associated with a valid owner. Any invalid owner or rule will result in a Resource Not Found error.

HTTP Headers

All API requests must include the following headers:

{
  'Accept': 'application/vnd.api+json',
  'Content-Type': 'application/vnd.api+json'
}

Example Payload

The following is an example payload for creating a new Cache Access Control Configuration:

{
  'data': {
    'type': 'cache-ac-config',
    'attributes': {
      'name': 'Example Configuration',
      'ip-allowlist': [
        {'range': '192.168.1.0/24', 'description': 'Corporate Network'}
      ]
    },
    'relationships': {
      'owner': {
        'data': {
          'id': '12345',
          'type': 'target-account'
        }
      }
    }
  }
}

List configurations

Authorizations:
http_security_schema
query Parameters
owner
required
string <uuid>
page[offset]
string non-empty
header Parameters
Accept
string
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
{
  • "links": {
    },
  • "data": [
    ]
}

Create configuration

Maximum number of configurations per target account is 50.

Authorizations:
http_security_schema
header Parameters
Content-Type
string
Value: "application/vnd.api+json"

The original media type of the resource.

Accept
string
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Request Body schema: application/vnd.api+json
required
object (Access Control Configuration primary data)

Responses

Request samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Get configuration

Authorizations:
http_security_schema
path Parameters
config_id
required
string
query Parameters
owner
required
string <uuid>
header Parameters
Accept
string
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Cache

Overview

Cache instances represent the configuration and setup of caching resources. These resources are typically used for CDN, cloud storage, or other high-performance data caching solutions. Users can perform CRUD (create, read, update, delete) operations to manage cache instances, including defining cache resources, settings, and routing tables.

Terminology

  • Cache Instance: A resource representing the setup of a cache, including configurations for cache types, route tables, and distribution settings.
  • Cache Resources: Settings that define the routing and access to cached data, such as route tables.
  • Cache Settings: Includes properties like cache type, domain name, HTTP version, and logging settings.
  • Owner: The account responsible for the cache instance.

API Structure

The API follows the JSON:API standard (https://jsonapi.org/format/). Key relationships include:

  • Owner: The owner of the cache instance (one-to-one relationship).

Each cache instance must be associated with a valid owner. Any invalid owner or missing required data will result in a Resource Not Found error.

HTTP Headers

All API requests must include the following headers:

{
  'Accept': 'application/vnd.api+json',
  'Content-Type': 'application/vnd.api+json'
}

Example Payload

The following is an example payload for creating a new Cache Instance:

{
  'data': {
    'type': 'cache-instance',
    'attributes': {
      'name': 'DAZN CDN',
      'description': 'Cache instance for DAZN',
      'cache-settings': {
        'cache-resources': {
          'route-table-name': 'm2a-prod-cache-route',
          'route-table-region': 'eu-west-1',
          'route-table-role-arn': 'arn:aws:iam::566556316321:role/m2a-stable-cache-routes-writer-cross-account-role'
        },
        'cache-type': 'cloudfront-emp-prog',
        'cf-domain-name': 'https://d3k2p84llfqf43.cloudfront.net',
        'distribution-id': '1',
        'status': 'ACTIVE',
        'price-class': 'North America',
        'http-version': 'http2',
        'ip-v6-enable': false,
        'log-s3-bucket': 'bucket',
        'log-s3-prefix': '/prefix'
      }
    },
    'relationships': {
      'owner': {
        'data': {
          'id': '12345',
          'type': 'target-account'
        }
      }
    }
  }
}

List of Caches

Authorizations:
http_security_schema
query Parameters
owner
required
string <uuid>
page[offset]
string non-empty
header Parameters
Accept
string
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
{
  • "links": {
    },
  • "data": [
    ]
}

Get Cache

Authorizations:
http_security_schema
path Parameters
cache_id
required
string
query Parameters
owner
required
string <uuid>
header Parameters
Accept
string
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}