One document matched: draft-ietf-cdni-control-triggers-03.xml


<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc7159 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7159.xml">
<!ENTITY rfc7231 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7231.xml">
<!ENTITY rfc7232 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7232.xml">
<!ENTITY rfc2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc3986 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml">
<!ENTITY rfc6707 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6707.xml">
<!ENTITY I-D.draft-ietf-cdni-metadata-06 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-cdni-metadata-06.xml">
<!ENTITY I-D.draft-ietf-cdni-framework-14 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-cdni-framework-14.xml">
<!ENTITY I-D.draft-ietf-cdni-requirements-17 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-cdni-requirements-17.xml">
<!ENTITY rfc4287 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4287.xml">
<!ENTITY rfc2818 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2818.xml">
<!ENTITY rfc5288 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5288.xml">
]>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<rfc category="std" docName="draft-ietf-cdni-control-triggers-03"
     ipr="trust200902">
  <front>
    <title abbrev="CDN Interconnect Triggers">CDNI Control Interface /
    Triggers</title>

    <author fullname="Rob Murray" initials="R" surname="Murray">
      <organization>Velocix (Alcatel-Lucent)</organization>

      <address>
        <postal>
          <street>3 Ely Road</street>

          <city>Milton</city>

          <region>Cambridge</region>

          <code>CB24 6DD</code>

          <country>UK</country>
        </postal>

        <email>rmurray@velocix.com</email>
      </address>
    </author>

    <author fullname="Ben Niven-Jenkins" initials="B" surname="Niven-Jenkins">
      <organization>Velocix (Alcatel-Lucent)</organization>

      <address>
        <postal>
          <street>3 Ely Road</street>

          <city>Milton</city>

          <region>Cambridge</region>

          <code>CB24 6DD</code>

          <country>UK</country>
        </postal>

        <email>ben@velocix.com</email>
      </address>
    </author>

    <date day="2" month="July" year="2014"/>

    <abstract>
      <t>This document describes the part of the CDN Interconnect Control
      Interface that allows a CDN to trigger activity in an interconnected CDN
      that is configured to deliver content on its behalf. The upstream CDN
      can use this mechanism to request that the downstream CDN pre-positions
      metadata or content, or that it re-validate or purge metadata or
      content. The upstream CDN can monitor the status of activity that it has
      triggered in the downstream CDN.</t>
    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t><xref target="RFC6707"/> introduces the Problem scope for CDN
      Interconnection (CDNI) and lists the four categories of interfaces that
      may be used to compose a CDNI solution (Control, Metadata, Request
      Routing, Logging).</t>

      <t><xref target="I-D.ietf-cdni-framework"/> expands on the information
      provided in <xref target="RFC6707"/> and describes each of the
      interfaces and the relationships between them in more detail.</t>

      <t>This document describes the "CI/T" interface, "CDNI Control interface
      / Triggers". It does not consider those parts of the control interface
      that relate to configuration, bootstrapping or authentication of CDN
      Interconnect interfaces. Requirements for CI/T are the "High" and
      "Medium" priority requirements for the CI identified in section 4 of
      <xref target="I-D.ietf-cdni-requirements"/>, reproduced here for
      convenience:</t>

      <t><list style="empty">
          <t>CI-1 [HIGH] The CDNI Control interface shall allow the Upstream
          CDN to request that the Downstream CDN, including downstream
          cascaded CDNs, delete an object or set of objects and/or its CDNI
          metadata from the CDN surrogates and any storage. Only the object(s)
          and CDNI metadata that pertain to the requesting Upstream CDN are
          allowed to be purged.</t>

          <t>CI-2 [MED] The CDNI Control interface should allow for multiple
          content items identified by a Content Collection ID to be purged
          using a single Content Purge action.</t>

          <t>CI-3 [MED] The CDNI Control interface should allow the Upstream
          CDN to request that the Downstream CDN, including downstream
          cascaded CDNs, mark an object or set of objects and/or its CDNI
          metadata as "stale" and revalidate them before they are delivered
          again.</t>

          <t>CI-4 [HIGH] The CDNI Control interface shall allow the Downstream
          CDN to report on the completion of these actions (by itself, and
          including downstream cascaded CDNs, in a manner appropriate for the
          action (e.g. synchronously or asynchronously). The confirmation
          receipt should include a success or failure indication. The failure
          indication along with the reason are used if the Downstream CDN
          cannot delete the content in its storage.</t>

          <t>CI-5 [MED] The CDNI Control interface should support initiation
          and control by the Upstream CDN of pre-positioned CDNI metadata
          acquisition by the Downstream CDN.</t>

          <t>CI-6 [MED] The CDNI Control interface should support initiation
          and control by the Upstream CDN of pre-positioned content
          acquisition by the Downstream CDN.</t>
        </list></t>

      <t><list style="symbols">
          <t><xref target="model-for-triggers"/> outlines the model for the
          CI/T Interface at a high level.</t>

          <t><xref target="collections-of-triggers"/> describes collections of
          Trigger Resources.</t>

          <t><xref target="trigger-interface"/> defines the web service
          provided by the dCDN.</t>

          <t><xref target="properties-of-triggers"/> lists properties of
          Trigger Requests and Status Resources.</t>

          <t><xref target="json-encoding"/> defines a JSON encoding for
          Trigger Requests and Status Resources.</t>

          <t><xref target="examples"/> contains example messages.</t>
        </list></t>

      <section anchor="terminology" title="Terminology">
        <t>This document reuses the terminology defined in <xref
        target="RFC6707"/>.</t>
      </section>
    </section>

    <section anchor="model-for-triggers" title="Model for CDNI Triggers">
      <t>A trigger, sent from the uCDN to the dCDN, is a request for dCDN to
      do some work relating to data originating from the uCDN.</t>

      <t>The trigger may request action on either metadata or content, the
      following actions can be requested:</t>

      <t><list style="symbols">
          <t>preposition - used to instruct the dCDN to fetch metadata from
          the uCDN, or content from any origin including the uCDN.</t>

          <t>invalidate - used to instruct the dCDN to revalidate specific
          metadata or content before re-using it.</t>

          <t>purge - used to instruct the dCDN to delete specific metadata or
          content.</t>
        </list></t>

      <t>The CI/T interface is a web service offered by the dCDN. It allows
      creation and deletion of triggers, and tracking of the triggered
      activity. When the dCDN accepts a trigger it creates a resource
      describing status of the triggered activity, a Trigger Status Resource.
      The uCDN MAY poll Trigger Status Resources to monitor progress.</t>

      <t>Requests to invalidate and purge metadata or content apply to all
      variants of that data with a given URI.</t>

      <t>The dCDN maintains a collection of Trigger Status Resources for each
      uCDN, each uCDN only has access to its own collection and the location
      of that collection is shared when CDN interconnection is
      established.</t>

      <t>To trigger activity in the dCDN, the uCDN will POST to the collection
      of Trigger Status Resources. If the dCDN accepts the trigger, it creates
      a new Trigger Status Resource and returns its location to the uCDN. To
      monitor progress, the uCDN MAY GET the Trigger Status Resource. To
      cancel a trigger, or remove a trigger from the collection once its
      activity has been completed, the uCDN MAY DELETE the Trigger Status
      Resource.</t>

      <t>In addition to the collection of all Trigger Status Resources for
      uCDN, uCDN has access to filtered views of that collection. These
      filtered views are defined in <xref target="collections-of-triggers"/>
      and include collections of active and completed triggers. These
      collections provide a mechanism for polling the status of multiple
      jobs.</t>

      <t><xref target="high-level-trigger-flow"/> is an example showing the
      basic message flow used by the uCDN to trigger activity in dCDN, and for
      uCDN to discover the status of that activity. Only successful triggering
      is shown. Examples of the messages are given in <xref
      target="examples"/>.</t>

      <figure anchor="high-level-trigger-flow"
              title="Basic CDNI Message Flow for Triggers">
        <artwork><![CDATA[     uCDN                                                   dCDN
      |    (1) POST http://dcdn.example.com/triggers/uCDN     |
     [ ] --------------------------------------------------> [ ]--+
      |                                                      [ ]  | (2)
      |    (3) HTTP 201 Response                             [ ]<-+
     [ ] <-------------------------------------------------- [ ]
      |     Loc: http://dcdn.example.com/triggers/uCDN/123    |
      |                                                       |
      .                           .                           .
      .                           .                           .
      .                           .                           .
      |                                                       |
      |   (4) GET http://dcdn.example.com/triggers/uCDN/123   |
     [ ] --------------------------------------------------> [ ]
      |                                                      [ ]
      |   (5) HTTP 200 Trigger Status Resource               [ ] 
     [ ] <-------------------------------------------------- [ ]
      |                                                       |
      |                                                       |
]]></artwork>
      </figure>

      <t>The steps in <xref target="high-level-trigger-flow"/> are:</t>

      <t><list style="numbers">
          <t>uCDN triggers action in the dCDN by posting to a collection of
          Trigger Status Resources, "http://dcdn.example.com/triggers/uCDN".
          The URL of this was given to the uCDN when the trigger interface was
          established.</t>

          <t>dCDN authenticates the request, validates the trigger and if it
          accepts the request, creates a new Trigger Status Resource.</t>

          <t>dCDN responds to the uCDN with an HTTP 201 response status, and
          the location of the Trigger Status Resource.</t>

          <t>uCDN may repeatedly poll the Trigger Status Resource in the
          dCDN.</t>

          <t>dCDN responds with the Trigger Status Resource, describing
          progress or results of the triggered activity.</t>
        </list></t>

      <t>The remainder of this document describes the messages, Trigger Status
      Resources, and collections of Trigger Status Resources in more
      detail.</t>

      <section title="Timing of Triggered Activity">
        <t>Timing of triggered activity is under the dCDN's control, including
        its start-time and pacing of the activity in the network.</t>

        <t>Invalidate and purge triggers MUST be applied to all data acquired
        before the trigger was created in the dCDN. The dCDN may apply the
        triggers to data acquired after trigger creation.</t>

        <t>If the uCDN wishes to invalidate or purge content, then immediately
        pre-position replacement content at the same URLs, it SHOULD ensure
        the dCDN has completed the invalidate/purge before initiating the
        prepositioning. Otherwise, the dCDN may pre-position the new content
        then immediately invalidate or purge it (as a result of the two uCDN
        requests running in parallel).</t>
      </section>

      <section title="Trigger Results">
        <t>Each Trigger Request may operate on multiple data items. The
        trigger MUST NOT be reported as "complete" unless all actions can be
        completed successfully, otherwise it MUST be reported as "failed" or
        "processed". The reasons for failure and URLs or Patterns affected
        SHOULD be enumerated in the Trigger Status Resource. For more detail,
        see section <xref target="error-handling"/>.</t>

        <t>If a dCDN is also acting as a uCDN in a cascade, it MUST forward
        triggers to any downstream CDNs that may have data affected by the
        trigger. The trigger MUST NOT be reported as complete in a CDN until
        it is complete in all of its downstream CDNs. A trigger MAY be
        reported as failed as soon as it fails in a CDN or in any of its
        downstream CDNs.</t>
      </section>
    </section>

    <section anchor="collections-of-triggers"
             title="Collections of Trigger Status Resources">
      <t>As described in <xref target="model-for-triggers"/>, Trigger Status
      Resources exist in dCDN to report the status of activity triggered by
      each uCDN.</t>

      <t>A collection of Trigger Status Resources is a resource that contains
      a reference to each Trigger Status Resource in that collection.</t>

      <t>To trigger activity in the dCDN, the uCDN creates a new Trigger
      Status Resource by posting to the dCDN's collection of uCDN's Trigger
      Status Resources. The URL of each Trigger Status Resource is generated
      by the dCDN when it accepts the trigger, and returned to the uCDN. This
      immediately enables the uCDN to check the status of that trigger.</t>

      <t>The dCDN MUST present a different set of Trigger Status Resources to
      each interconnected uCDN. Trigger Status Resources belonging to a uCDN
      MUST NOT be visible to any other client. The dCDN may, for example,
      achieve this by offering different collection URLs to uCDNs, or by
      filtering the response based on the client uCDN.</t>

      <t>The dCDN resource representing the collection of all the uCDN's
      Trigger Status Resources is accessible to the uCDN. This collection
      lists all of the uCDN triggers that have been accepted by the dCDN, and
      have not yet been deleted by the uCDN, or expired and removed by the
      dCDN (as described in section <xref target="deleting-triggers"/>).</t>

      <t>In order to allow the uCDN to check status of multiple jobs in a
      single request, the dCDN SHOULD also maintain collections representing
      filtered views of the collection of all Trigger Status Resources. The
      filtered collections are:<list style="symbols">
          <t>Pending - Trigger Status Resources for triggers that have been
          accepted, but not yet acted upon.</t>

          <t>Active - Trigger Status Resources for triggered activity that is
          currently being processed in the dCDN.</t>

          <t>Complete - Trigger Status Resources representing activity that
          completed successfully, or for which no further status updates will
          be made by the dCDN.</t>

          <t>Failed - Trigger Status Resources representing activity that
          failed.</t>
        </list></t>
    </section>

    <section anchor="trigger-interface" title="CDNI Trigger interface">
      <t>This section describes an interface to enable an upstream CDN to
      trigger defined activities in a downstream CDN. The interface is
      intended to be independent of the set of activities defined now, or that
      may be defined in future.</t>

      <t>CI/T is built on the principles of RESTful web services. Requests are
      made over HTTP, and the HTTP Method defines the operation the request
      would like to perform. The corresponding HTTP Response returns the
      status of the operation in the HTTP Status Code and returns the current
      representation of the resource (if appropriate) in the Response Body.
      HTTP Responses from servers implementing CI/T that contain a response
      body SHOULD include an ETag to enable validation of cached versions of
      returned resources.</t>

      <t>Servers implementing CI/T MUST support the HTTP GET, HEAD, POST and
      DELETE methods as defined in <xref target="RFC7231"/>. The only
      representation specified in this document is JSON, <xref
      target="RFC7159"/>.</t>

      <t>The URL of the dCDN's collections of Trigger Status Resources need to
      be either discovered by, or configured in, the uCDN. The mechanism for
      discovery of those URLs is outside the scope of this document.</t>

      <t>Trigger Requests are POSTed to the dCDN's collection of all Trigger
      Status Resources. If the trigger is accepted by the dCDN, it creates a
      new Trigger Status Resource and returns its URI to the dCDN in an HTTP
      201 response. The triggered activity can then be monitored by the uCDN
      using that resource and the collections described in <xref
      target="collections-of-triggers"/>.</t>

      <t>The URI of each Trigger Status Resource is returned to the uCDN when
      it is created. This means all Trigger Status Resources can be
      discovered, so CI/T servers are free to assign whatever structure they
      desire to the URIs for CI/T resources. CI/T clients MUST NOT make any
      assumptions regarding the structure of CI/T URIs or the mapping between
      CI/T objects and their associated URIs. Therefore any URIs present in
      the examples below are purely illustrative and are not intended to
      impose a definitive structure on CI/T interface implementations.</t>

      <t>The CI/T interface builds on top of HTTP, so CI/T servers may make
      use of any HTTP feature when implementing the CI/T interface. For
      example, a CI/T server may make use of HTTP's caching mechanisms to
      indicate that a requested response/representation has not been modified,
      reducing the processing needed to determine whether the status of
      triggered activity has changed.</t>

      <t>This specification is neutral with regard to the transport below the
      HTTP layer.</t>

      <t>The dCDN MUST ensure that activity triggered by the uCDN only affects
      metadata or content originating from that uCDN. Since only one CDN can
      be authoritative for a given item of metadata or content, this
      requirement means there cannot be any "loops" in trigger requests
      between CDNs.</t>

      <section title="Creating Triggers">
        <t>To create a new trigger, the uCDN makes an HTTP POST to the
        unfiltered collection of its triggers. The request body of that POST
        is a Trigger Request.</t>

        <t>The dCDN validates and authenticates that request, if it is
        malformed or the uCDN does not have sufficient access rights it MAY
        reject the request immediately. In this case, it MUST respond with an
        appropriate 4xx HTTP error code and a resource MUST NOT be created on
        dCDN.</t>

        <t>If the request is accepted, the uCDN MUST create a new Trigger
        Status Resource. The HTTP response to the dCDN MUST have status code
        201 and the URI of the Trigger Status Resource in the Location header
        field. The HTTP response SHOULD include the content of the newly
        created Trigger Status Resource, this is recommended particularly in
        cases where the trigger has completed immediately.</t>

        <t>Once a Trigger Status Resource has been created the dCDN MUST NOT
        re-use its location, even after that resource has been removed.</t>

        <t>The "request" property of the Trigger Status Resource contains the
        information posted in the body of the Trigger Request. Note that this
        need not be a byte-for-byte copy. For example, in the JSON
        representation the dCDN may re-serialise the information
        differently.</t>

        <t>If the dCDN is not able to track triggered activity, it MUST
        indicate that indicate that it has accepted the request but will not
        be providing further status updates. To do this, it sets the "status"
        of the Trigger Status Resource to "processed". In this case, CI/T
        processing should continue as for a "complete" request, so the Trigger
        Status Resource MUST be added to the dCDN's collection of Complete
        Triggers. The dCDN SHOULD also provide an estimated completion time
        for the request, by using the "etime" property of the Trigger Status
        Resource. This will allow the uCDN to schedule prepositioning after an
        earlier delete of the same URLs is expected to have finished.</t>

        <t>If the dCDN is able to track triggered activity, the trigger is
        queued by the dCDN for later action, the "status" property of the
        Trigger Status Resource MUST be "pending". Once trigger processing has
        started the "status" MUST be "active". Finally, once the triggered
        activity is complete, the trigger status MUST be set to "complete" or
        "failed".</t>

        <t>A trigger may result in no activity in the dCDN if, for example, it
        is an invalidate or purge request for data the dCDN has not yet
        acquired, or a prepopulate request for data it has already acquired
        and which is still valid. In this case, the "status" of the Trigger
        Status Resource MUST be "processed" or "complete", and the Trigger
        Status Resource MUST be added to the dCDN's collection of Complete
        Triggers.</t>

        <t>Once created, Trigger Status Resources may be deleted by the uCDN
        but not modified. The dCDN MUST reject PUT and POST requests from the
        uCDN to Trigger Status Resources using HTTP status code 403.</t>
      </section>

      <section title="Checking Status">
        <t>The uCDN has two ways to check progress of activity it has
        triggered in the dCDN, described in the following sections.</t>

        <t>To check for change in status of a resource or collection of
        resources without re-fetching the whole resource or collection, Entity
        Tags SHOULD be used by the uCDN as cache validators, as defined in
        <xref target="RFC7232"/>.</t>

        <t>The dCDN SHOULD use the cache control headers for responses to GETs
        for Trigger Status Resources and Collections to indicate the frequency
        at which it recommends uCDN should poll for change.</t>

        <section title="Polling Trigger Status Resource collections">
          <t>The uCDN can fetch the collection of its Trigger Status
          Resources, or filtered views of that collection.</t>

          <t>This makes it possible to poll status of all triggered activity
          in a single request. If the dCDN moves a Trigger Status Resource
          from the Active to the Completed collection, the uCDN may chose to
          fetch the result of that activity.</t>

          <t>When polling in this way, the uCDN SHOULD use HTTP Entity Tags to
          monitor for change, rather than repeatedly fetching the whole
          collection.</t>
        </section>

        <section title="Polling Trigger Status Resources">
          <t>The uCDN has a reference (URI provided by the dCDN) for each
          Trigger Status Resource it has created, it may fetch that resource
          at any time.</t>

          <t>This MAY be used to retrieve progress information, and to fetch
          the result of triggered activity.</t>
        </section>
      </section>

      <section anchor="deleting-triggers" title="Deleting Triggers">
        <t>The uCDN MAY delete Trigger Status Resources at any time, using the
        HTTP DELETE method.</t>

        <t>Once deleted, the references to a Trigger Status Resource MUST be
        removed from all Trigger Status Resource collections. Subsequent
        requests for the resource MUST be handled as required by HTTP, and so
        will receive responses with status 404 or 410.</t>

        <t>If a "pending" Trigger Status Resource is deleted, the dCDN SHOULD
        NOT start processing of that activity. Deleting a "pending" trigger
        does not however guarantee that it is not started because the uCDN
        cannot control the timing of that activity. Processing may, for
        example, start after the DELETE is sent by the uCDN but before the
        DELETE is processed by the dCDN.</t>

        <t>If an "active" Trigger Status Resource is deleted, the dCDN MAY
        stop processing the triggered activity. However, as with deletion of a
        "pending" trigger, the dCDN does not guarantee this.</t>

        <t>Deletion of a "complete", "processed" or "failed" Trigger Status
        Resource requires no processing in the dCDN other than deletion of the
        resource.</t>
      </section>

      <section title="Expiry of Trigger Status Resources">
        <t>The dCDN MAY choose to automatically delete Trigger Status
        Resources some time after they become "complete", "processed" or
        "failed". In this case, the dCDN will remove the resource and respond
        to subsequent requests for it with HTTP status 404 or 410.</t>

        <t>If the dCDN performs this housekeeping, it MUST have reported the
        length of time after which completed Trigger Status Resources become
        stale via a property of the collection of all Trigger Status
        Resources. It is recommended that Trigger Status Resources are not
        automatically deleted for at least 24 hours after they become
        "complete", "processed" or "failed".</t>

        <t>To ensure it has access to the status of its completed and failed
        triggers, it is recommended that the uCDN's polling interval is half
        the time after which records for completed activity will be considered
        stale.</t>
      </section>

      <section anchor="error-handling" title="Error Handling">
        <t>A CI/T server may reject a trigger request using HTTP status codes.
        For example, 400 if the request is malformed, or 401 if the client
        does not have permission to create triggers or it is trying to act on
        another CDN's data.</t>

        <t>If any part of the trigger request fails, the trigger SHOULD be
        reported as "failed" once its activity is complete or if no further
        errors will be reported. The "errors" property in the Trigger Status
        Resource will be used to enumerate which actions failed and the
        reasons for failure, and may be present while the trigger is still
        "pending" or "active", if the trigger is still running for some URLs
        or Patterns in the trigger request.</t>

        <t>Once a request has been accepted, processing errors are reported in
        the Trigger Status Resource using a list of "ErrorDesc". Each
        ErrorDesc is used to report errors against one or more of the URLs or
        Patterns in the trigger request.</t>

        <t>If a surrogate affected by a trigger is offline in the dCDN, or the
        dCDN is unable to pass a trigger request on to any of its cascaded
        dCDNs; the dCDN SHOULD report an error if the request is abandoned.
        Otherwise, it SHOULD keep the trigger in state "pending" or "active"
        until it's acted upon or the uCDN chooses to cancel it. Or, if the
        request is queued and the dCDN will not report further status, the
        dCDN MAY report the trigger as "processed", in which case it SHOULD
        also provide an estimated completion time.</t>

        <t>Note that an "invalidate" trigger may be reported as "complete"
        when surrogates that may have the data are offline. In this case,
        surrogates MUST NOT use the affected data without first revalidating
        it when they are back online. This does not apply to "preposition" or
        "purge" triggers.</t>
      </section>
    </section>

    <section anchor="properties-of-triggers" title="Properties of Triggers">
      <section title="Properties of Trigger Requests">
        <t>Properties of Trigger Requests are defined in the following
        subsections.</t>

        <t><list style="empty">
            <t>Property: type<list style="empty">
                <t>Description: This property defines the type of the
                trigger.</t>

                <t>Type: TriggerType</t>

                <t>Mandatory: Yes</t>
              </list></t>
          </list></t>

        <t><list style="empty">
            <t>Property: metadata.urls<list style="empty">
                <t>Description: The uCDN URL for the metadata the trigger
                applies to.</t>

                <t>Type: URLs</t>

                <t>Mandatory: No, but at least one of 'metadata.*' or
                'content.*' MUST be present and non-empty.</t>
              </list></t>
          </list><list style="empty">
            <t>Property: content.urls<list style="empty">
                <t>Description: URLs of content data the trigger applies to,
                see <xref target="content-urls"/>.</t>

                <t>Type: URLs</t>

                <t>Mandatory: No, but at least one of 'metadata.*' or
                'content.*' MUST be present and non-empty.</t>
              </list></t>
          </list><list style="empty">
            <t>Property: content.ccid<list style="empty">
                <t>Description: The Content Collection IDentifier of data the
                trigger applies to.</t>

                <t>Type: List of strings</t>

                <t>Mandatory: No, but at least one of 'metadata.*' or
                'content.*' MUST be present and non-empty.</t>
              </list></t>
          </list><list style="empty">
            <t>Property: metadata.patterns<list style="empty">
                <t>Description: The metadata the trigger applies to.</t>

                <t>Type: List of PatternMatch</t>

                <t>Mandatory: No, but at least one of 'metadata.*' or
                'content.*' MUST be present and non-empty, and
                metadata.patterns MUST NOT be present if the TriggerType is
                Preposition.</t>
              </list></t>
          </list><list style="empty">
            <t>Property: content.patterns<list style="empty">
                <t>Description: The content data the trigger applies to.</t>

                <t>Type: List of PatternMatch</t>

                <t>Mandatory: No, but at least one of 'metadata.*' or
                'content.*' MUST be present and non-empty, and
                content.patterns MUST NOT be present if the TriggerType is
                Preposition.</t>
              </list></t>
          </list></t>

        <section anchor="content-urls" title="Content URLs">
          <t>To refer to content in the dCDN, the uCDN MUST present URLs in
          the same form clients will use to access content in that dCDN, after
          transformation to remove any surrogate-specific parts of a
          302-redirect URL form. By definition, it is always possible to
          locate content based on URLs in this form.</t>

          <t>If content URLs are transformed by an intermediate CDN in a
          cascade, that intermediate CDN MUST transform URLs in trigger
          requests it passes to its dCDN.</t>

          <t>When processing trigger requests, CDNs MUST ignore the URL scheme
          (http or https) in comparing URLs. For example, for an invalidate or
          purge trigger, content MUST invalidated or purged regardless of the
          protocol clients use to request it.</t>
        </section>
      </section>

      <section anchor="properties-of-trigger-resources"
               title="Properties of Trigger Status Resources">
        <t><list style="empty">
            <t>Property: trigger<list style="empty">
                <t>Description: The properties of trigger request that created
                this record.</t>

                <t>Type: TriggerRequest</t>

                <t>Mandatory: Yes</t>
              </list></t>
          </list></t>

        <t><list style="empty">
            <t>Property: ctime<list style="empty">
                <t>Description: Time at which the request was received by the
                dCDN. Time is determined by the dCDN, there is no requirement
                to synchronise clocks between interconnected CDNs.</t>

                <t>Type: AbsoluteTime</t>

                <t>Mandatory: Yes</t>
              </list></t>
          </list></t>

        <t><list style="empty">
            <t>Property: mtime<list style="empty">
                <t>Description: Time at which the resource was last modified.
                Time is determined by the dCDN, there is no requirement to
                synchronise clocks between interconnected CDNs.</t>

                <t>Type: AbsoluteTime</t>

                <t>Mandatory: Yes</t>
              </list></t>
          </list><list style="empty">
            <t>Property: etime<list style="empty">
                <t>Description: Estimate of the time at which the dCDN expects
                to complete the activity. Time is determined by the dCDN,
                there is no requirement to synchronise clocks between
                interconnected CDNs.</t>

                <t>Type: AbsoluteTime</t>

                <t>Mandatory: No</t>
              </list></t>
          </list></t>

        <t><list style="empty">
            <t>Property: status<list style="empty">
                <t>Description: Current status of the triggered activity.</t>

                <t>Type: TriggerStatus</t>

                <t>Mandatory: Yes</t>
              </list></t>
          </list></t>

        <t><list style="empty">
            <t>Property: errors<list style="empty">
                <t>Description: List of ErrorDesc.</t>

                <t>Mandatory: No.</t>
              </list></t>
          </list></t>
      </section>

      <section title="Properties of ErrorDesc">
        <t>An ErrorDesc object is used to report failure for URLs and patterns
        in a trigger request.<list style="empty">
            <t>Property: error<list style="empty">
                <t>Type: ErrorCode.</t>

                <t>Mandatory: Yes.</t>
              </list></t>
          </list><list style="empty">
            <t>Property: metadata.urls, content.urls, metadata.patterns,
            content.patterns<list style="empty">
                <t>Description: Metadata and content references copied from
                the trigger request. Only those URLs and patterns to which the
                error applies shall be included in each property, but those
                URLs and patterns MUST be exactly as they appear in the
                request, the dCDN must not generalise the URLs. (For example,
                if the uCDN requests prepositioning of URLs
                "http://ucdn.example.com/a" and "http://ucdn.example.com/b",
                the dCDN must not generalise its error report to Pattern
                "http://ucdn.example.com/*").</t>

                <t>Mandatory: At least one of these properties is mandatory in
                each ErrorDesc.</t>
              </list></t>
          </list><list style="empty">
            <t>Property: description<list style="empty">
                <t>Description: A String containing a human-readable
                description of the error.</t>

                <t>Mandatory: No.</t>
              </list></t>
          </list></t>
      </section>

      <section title="Properties of Trigger Collections">
        <t><list style="empty">
            <t>Property: triggers<list style="empty">
                <t>Description: Links to Trigger Status Resources in the
                collection.</t>

                <t>Type: URLs.</t>

                <t>Mandatory: Yes</t>
              </list></t>
          </list><list style="empty">
            <t>Property: staleresourcetime<list style="empty">
                <t>Description: The length of time for which the dCDN
                guarantees to keep a completed Trigger Status Resource. After
                this time, the dCDN MAY delete the resource and all references
                to it from collections.</t>

                <t>Type: Integer, time in seconds.</t>

                <t>Mandatory: Yes, in the collection of all Trigger Status
                Resources if the dCDN deletes stale entries. If the property
                is present in the filtered collections, it MUST have the same
                value as in the collection of all Trigger Status
                Resources.</t>
              </list></t>
          </list></t>
      </section>

      <section title="Trigger Resource Simple Data Type Descriptions">
        <t>This section describes the simpler data types that are used for
        properties of Trigger Status resources.</t>

        <section anchor="trigger-type" title="TriggerType">
          <t>This type defines the type of action being triggered, permitted
          actions are:<list style="symbols">
              <t>Preposition - a request for the dCDN to acquire metadata or
              content.</t>

              <t>Invalidate - a request for the dCDN to invalidate metadata or
              content. After servicing this request the dCDN will not use the
              specified data without first re-validating it using, for
              example, an "If-None-Match" HTTP request. The dCDN need not
              erase the associated data.</t>

              <t>Purge - a request for the dCDN to erase metadata or content.
              After servicing the request, the specified data MUST NOT be held
              on dCDN.</t>
            </list></t>
        </section>

        <section anchor="trigger-status" title="TriggerStatus">
          <t>This type describes the current status of a Trigger, possible
          values are:</t>

          <t><list style="symbols">
              <t>Pending – the trigger has not yet been acted upon.</t>

              <t>Active – the trigger is currently being acted upon.</t>

              <t>Complete – the triggered activity completed
              successfully.</t>

              <t>Processed - the trigger has been accepted and no further
              status update will be made (may be used in cases where
              completion cannot be confirmed).</t>

              <t>Failed – the triggered activity could not be
              completed.</t>
            </list></t>
        </section>

        <section title="URLs">
          <t>This type describes a set of references to metadata or content,
          it is simply a list of absolute URLs.</t>
        </section>

        <section title="AbsoluteTime">
          <t>Times are expressed in seconds since the UNIX epoch.</t>
        </section>

        <section title="ErrorCode">
          <t>This type is used by dCDN to report failures in trigger
          processing.</t>

          <t><list style="symbols">
              <t>EMETA - the dCDN was unable to acquire metadata required to
              fulfil the request.</t>

              <t>ECONTENT - the dCDN was unable to acquire content
              (preposition triggers only).</t>

              <t>EPERM - the uCDN does not have permission to trigger the
              requested activity (for example, the data is owned by another
              CDN).</t>

              <t>EREJECT - the dCDN is not willing to fulfil the request (for
              example, a preposition request for content at a time when dCDN
              would not accept Request Routing requests from uCDN).</t>

              <t>ECDN - An internal error in the dCDN or one of its downstream
              CDNs.</t>
            </list></t>
        </section>
      </section>
    </section>

    <section anchor="json-encoding" title="JSON Encoding of Objects">
      <t>The encoding for a CI/T object is a JSON object containing a
      dictionary of (key,value) pairs where the keys are the property names,
      and the values are the associated property values.</t>

      <t>The keys of the dictionary are the names of the properties associated
      with the object and are therefore dependent on the specific object being
      encoded (i.e. dependent on the MIME Media Type of the returned
      resource). Likewise, the values associated with each key are dependent
      on the specific object being encoded (i.e. dependent on the MIME Media
      Type of the returned resource).</t>

      <t>The "trigger" property of the top level JSON object lists the
      requested action.</t>

      <t><list style="empty">
          <t>Key: trigger<list style="empty">
              <t>Description: An object specifying the trigger type and a set
              of data to act upon.</t>

              <t>Type: A JSON object.</t>

              <t>Mandatory: Yes.</t>
            </list></t>
        </list></t>

      <t>Object keys in JSON are case sensitive and therefore any dictionary
      key defined by this document (for example the names of CI/T object
      properties) MUST always be represented in lowercase.</t>

      <t>In addition to the properties of an object, the following additional
      keys MAY be present.</t>

      <t><list style="empty">
          <t>Key: base<list style="empty">
              <t>Description: Provides a prefix for any relative URLs in the
              object. This is similar to the XML base tag <xref
              target="XML-BASE"/>. If absent, all URLs in the remainder of the
              document MUST be absolute URLs.</t>

              <t>Type: URI</t>

              <t>Mandatory: No</t>
            </list></t>
        </list></t>

      <t><list style="empty">
          <t>Key: _links<list style="empty">
              <t>Description: The relationships of this object to other
              addressable objects.</t>

              <t>Type: Array of Relationships.</t>

              <t>Mandatory: Yes</t>
            </list></t>
        </list></t>

      <section title="JSON Encoding of Embedded Types">
        <section title="TriggerType">
          <t><list style="empty">
              <t>Key: type<list style="empty">
                  <t>Description: One of "preposition", "invalidate" or
                  "purge".</t>

                  <t>Type: string</t>
                </list></t>
            </list></t>
        </section>

        <section title="TriggerStatus">
          <t><list style="empty">
              <t>Key: status<list style="empty">
                  <t>Description: One of "pending", "active", "failed",
                  "complete"</t>

                  <t>Type: string</t>
                </list></t>
            </list></t>
        </section>

        <section title="PatternMatch">
          <t>A PatternMatch is encoded as a JSON Object containing a string to
          match and flags describing the type of match.</t>

          <t><list style="empty">
              <t>Key: pattern<list style="empty">
                  <t>Description: A pattern for string matching. The pattern
                  may contain the wildcards * and ?, where * matches any
                  sequence of characters (including the empty string) and ?
                  matches exactly one character. The three literals \ , * and
                  ? MUST be escaped as \\, \* and \?</t>

                  <t>Type: String</t>

                  <t>Mandatory: Yes</t>
                </list>Key: case-sensitive<list style="empty">
                  <t>Description: Flag indicating whether or not
                  case-sensitive matching should be used.</t>

                  <t>Type: Boolean</t>

                  <t>Mandatory: No, default is case-insensitive match.</t>
                </list>Key: match-query-string<list style="empty">
                  <t>Description: Flag indicating whether or not the query
                  string should be included in the pattern match.</t>

                  <t>Type: Boolean</t>

                  <t>Mandatory: No, default is not to include query.</t>
                </list></t>
            </list>Example of case-sensitive prefix match against
          "http://www.example.com/trailers/":</t>

          <figure>
            <artwork><![CDATA[{
    "pattern": "http://www.example.com/trailers/*",
    "case-sensitive": true
}]]></artwork>
          </figure>
        </section>

        <section title="ErrorDesc">
          <t>ErrorDesc is encoded as a JSON object with the following
          keys:</t>

          <t><list style="empty">
              <t>Key: error<list style="empty">
                  <t>Type: ErrorCode</t>

                  <t>Mandatory: Yes</t>
                </list>Keys: metadata.urls, content.urls<list style="empty">
                  <t>Type: Array of strings</t>

                  <t>Mandatory: At least one of metadata.* or content.* MUST
                  be present.</t>
                </list>Keys: metadata.patterns, content.patterns<list
                  style="empty">
                  <t>Type: Array of PatternMatch</t>

                  <t>Mandatory: At least one of metadata.* or content.* MUST
                  be present.</t>
                </list></t>

              <t>Key: description<list style="empty">
                  <t>Type: String</t>

                  <t>Mandatory: No.</t>
                </list></t>
            </list></t>
        </section>

        <section title="ErrorCode">
          <t>One of the strings "EMETA", "ECONTENT", "EPERM", "EREJECT" or
          "ECDN".</t>
        </section>
      </section>

      <section anchor="media-types" title="MIME Media Types">
        <t><xref target="triggers-media-types-table"/> lists the MIME Media
        Type for the trigger request, and each trigger object (resource) that
        is retrievable through the CI/T interface.</t>

        <texttable anchor="triggers-media-types-table"
                   title="MIME Media Types for CDNI Trigger resources">
          <ttcol>Data Object</ttcol>

          <ttcol>MIME Media Type</ttcol>

          <c>TriggerRequest</c>

          <c>application/cdni.ci.TriggerRequest+json</c>

          <c>TriggerStatus</c>

          <c>application/cdni.ci.TriggerStatus+json</c>

          <c>TriggerCollection</c>

          <c>application/cdni.ci.TriggerCollection+json</c>
        </texttable>

        <t/>
      </section>
    </section>

    <section anchor="examples" title="Examples">
      <t>The following sections provide examples of different CI/T objects
      encoded as JSON.</t>

      <t>No authentication is shown in the following illustrative examples, it
      is anticipated that authentication mechanisms will be aligned with other
      CDNI Interfaces as and when those mechanisms are defined.</t>

      <t>Discovery of the triggers interface is out of scope of this document.
      In an implementation, all URLs are under the control of the dCDN. The
      uCDN MUST NOT attempt to ascribe any meaning to individual elements of
      the path. In examples in this section, the following URLs are used as
      the location of the collections of triggers:</t>

      <t><list style="symbols">
          <t>Collection of all Triggers belonging to one uCDN:<list
              style="empty">
              <t>http://dcdn.example.com/triggers</t>
            </list></t>

          <t>Filtered collections:<list style="empty">
              <t>Pending: http://dcdn.example.com/triggers/pending</t>

              <t>Active: http://dcdn.example.com/triggers/active</t>

              <t>Complete: http://dcdn.example.com/triggers/complete</t>

              <t>Failed: http://dcdn.example.com/triggers/failed</t>
            </list></t>
        </list></t>

      <section title="Creating Triggers">
        <t>Examples of uCDN triggering activity in dCDN:</t>

        <section title="Preposition">
          <t>An example of a preposition request, a POST to the "AllTriggers"
          collection.</t>

          <t>Note that "metadata.patterns" and "content.patterns" are not
          allowed in a preposition trigger request.</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  POST /triggers HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*
  Content-Type: application/cdni.ci.TriggerRequest+json
  Content-Length: 315

  {
    "trigger" : {
      "type": "preposition",

      "metadata.urls" : [ "http://metadata.example.com/a/b/c" ],
      "content.urls" : [
          "http://www.example.com/a/b/c/1",
          "http://www.example.com/a/b/c/2",
          "http://www.example.com/a/b/c/3",
          "http://www.example.com/a/b/c/4"
        ]
    }
  }

RESPONSE:

  HTTP/1.1 201 Created
  Date: Wed, 02 Jul 2014 18:57:19 GMT
  Content-Length: 472
  Content-Type: application/cdni.ci.TriggerStatus+json
  Location: http://dcdn.example.com/triggers/0
  Server: example-server/0.1

  {
      "ctime": 1404327439,
      "etime": 1404327447,
      "mtime": 1404327439,
      "status": "pending",
      "trigger": {
          "content.urls": [
              "http://www.example.com/a/b/c/1",
              "http://www.example.com/a/b/c/2",
              "http://www.example.com/a/b/c/3",
              "http://www.example.com/a/b/c/4"
          ],
          "metadata.urls": [
              "http://metadata.example.com/a/b/c"
          ],
          "type": "preposition"
      }
  }]]></artwork>
          </figure>
        </section>

        <section title="Invalidate">
          <t>An example of an invalidate request, another POST to the
          "AllTriggers" collection. This instructs the dCDN to re-validate the
          content at "http://www.example.com/a/index.html", as well as any
          metadata and content whose URLs are prefixed by
          "http://metadata.example.com/a/b/" and "http://www.example.com/a/b/"
          respectively, using case-insensitive matching.</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  POST /triggers HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*
  Content-Type: application/cdni.ci.TriggerRequest+json
  Content-Length: 352

  {
    "trigger" : {
      "type": "invalidate",

      "metadata.patterns" : [
          { "pattern" : "http://metadata.example.com/a/b/*" }
        ],

      "content.urls" : [ "http://www.example.com/a/index.html" ],
      "content.patterns" : [
          { "pattern" : "http://www.example.com/a/b/*",
            "case-sensitive" : true
          }
        ]
    }
  }

RESPONSE:

  HTTP/1.1 201 Created
  Date: Wed, 02 Jul 2014 18:57:20 GMT
  Content-Length: 551
  Content-Type: application/cdni.ci.TriggerStatus+json
  Location: http://dcdn.example.com/triggers/1
  Server: example-server/0.1

  {
      "ctime": 1404327440,
      "etime": 1404327448,
      "mtime": 1404327440,
      "status": "pending",
      "trigger": {
          "content.patterns": [
              {
                  "case-sensitive": true,
                  "pattern": "http://www.example.com/a/b/*"
              }
          ],
          "content.urls": [
              "http://www.example.com/a/index.html"
          ],
          "metadata.patterns": [
              {
                  "pattern": "http://metadata.example.com/a/b/*"
              }
          ],
          "type": "invalidate"
      }
  }]]></artwork>
          </figure>

          <t/>
        </section>
      </section>

      <section title="Examining Trigger Status">
        <t>Once triggers have been created, the uCDN can check their status as
        shown in these examples.</t>

        <section title="Collection of All Triggers">
          <t>The uCDN can fetch the set of all the triggers it has created and
          which have not yet been deleted or removed as expired. After
          creation of the "preposition" and "invalidate" triggers shown above,
          this collection might look as follows:</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 200 OK
  Content-Length: 153
  Expires: Wed, 02 Jul 2014 18:58:20 GMT
  Server: example-server/0.1
  Etag: "9179988753593038498"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:20 GMT
  Content-Type: application/cdni.ci.TriggerCollection+json

  {
      "staleresourcetime": 86400,
      "triggers": [
          "http://dcdn.example.com/triggers/0",
          "http://dcdn.example.com/triggers/1"
      ]
  }]]></artwork>
          </figure>
        </section>

        <section title="Filtered Collections of Triggers">
          <t>The filtered collections are also available to uCDN. Before the
          dCDN starts processing the two triggers shown above, both will
          appear in the collection of Pending Triggers, for example:</t>

          <figure>
            <artwork><![CDATA[RREQUEST:

  GET /triggers/pending HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 200 OK
  Content-Length: 153
  Expires: Wed, 02 Jul 2014 18:58:20 GMT
  Server: example-server/0.1
  Etag: "5012053611544832286"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:20 GMT
  Content-Type: application/cdni.ci.TriggerCollection+json

  {
      "staleresourcetime": 86400,
      "triggers": [
          "http://dcdn.example.com/triggers/0",
          "http://dcdn.example.com/triggers/1"
      ]
  }]]></artwork>
          </figure>

          <t/>

          <t>At this point, if no other triggers had been created, the other
          filtered views of the triggers would be empty. For example:</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers/complete HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 200 OK
  Content-Length: 56
  Expires: Wed, 02 Jul 2014 18:58:20 GMT
  Server: example-server/0.1
  Etag: "2986340333785000363"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:20 GMT
  Content-Type: application/cdni.ci.TriggerCollection+json

  {
      "staleresourcetime": 86400,
      "triggers": []
  }]]></artwork>
          </figure>

          <t/>
        </section>

        <section title="Trigger Status Resources">
          <t>The Trigger Status Resources can also be examined for detail
          about individual triggers. For example, for the "preposition" and
          "invalidate" triggers from previous examples:</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers/0 HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 200 OK
  Content-Length: 472
  Expires: Wed, 02 Jul 2014 18:58:20 GMT
  Server: example-server/0.1
  Etag: "-3651695664007658154"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:20 GMT
  Content-Type: application/cdni.ci.TriggerStatus+json

  {
      "ctime": 1404327439,
      "etime": 1404327447,
      "mtime": 1404327439,
      "status": "pending",
      "trigger": {
          "content.urls": [
              "http://www.example.com/a/b/c/1",
              "http://www.example.com/a/b/c/2",
              "http://www.example.com/a/b/c/3",
              "http://www.example.com/a/b/c/4"
          ],
          "metadata.urls": [
              "http://metadata.example.com/a/b/c"
          ],
          "type": "preposition"
      }
  }]]></artwork>
          </figure>

          <t/>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers/1 HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 200 OK
  Content-Length: 551
  Expires: Wed, 02 Jul 2014 18:58:20 GMT
  Server: example-server/0.1
  Etag: "-7664987687828084413"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:20 GMT
  Content-Type: application/cdni.ci.TriggerStatus+json

  {
      "ctime": 1404327440,
      "etime": 1404327448,
      "mtime": 1404327440,
      "status": "pending",
      "trigger": {
          "content.patterns": [
              {
                  "case-sensitive": true,
                  "pattern": "http://www.example.com/a/b/*"
              }
          ],
          "content.urls": [
              "http://www.example.com/a/index.html"
          ],
          "metadata.patterns": [
              {
                  "pattern": "http://metadata.example.com/a/b/*"
              }
          ],
          "type": "invalidate"
      }
  }]]></artwork>
          </figure>
        </section>

        <section title="Polling for Change">
          <t>The uCDN may use the Entity Tags of collections or resources when
          polling for change in status, as shown in the following
          examples:</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers/pending HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*
  If-None-Match: "5012053611544832286"


RESPONSE:

  HTTP/1.1 304 Not Modified
  Content-Length: 0
  Expires: Wed, 02 Jul 2014 18:58:20 GMT
  Server: example-server/0.1
  Etag: "5012053611544832286"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:20 GMT
  Content-Type: application/cdni.ci.TriggerCollection+json]]></artwork>
          </figure>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers/0 HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*
  If-None-Match: "-3651695664007658154"


RESPONSE:

  HTTP/1.1 304 Not Modified
  Content-Length: 0
  Expires: Wed, 02 Jul 2014 18:58:20 GMT
  Server: example-server/0.1
  Etag: "-3651695664007658154"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:20 GMT
  Content-Type: application/cdni.ci.TriggerStatus+json]]></artwork>
          </figure>

          <t/>

          <t>When the triggered activity is complete, the contents of the
          filtered collections will be updated, along with their Entity Tags.
          For example, when the two example triggers are complete, the
          collections of pending and complete triggers may look like:</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers/pending HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 200 OK
  Content-Length: 56
  Expires: Wed, 02 Jul 2014 18:58:24 GMT
  Server: example-server/0.1
  Etag: "-4471185573414616962"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:24 GMT
  Content-Type: application/cdni.ci.TriggerCollection+json

  {
      "staleresourcetime": 86400,
      "triggers": []
  }]]></artwork>
          </figure>

          <t/>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers/complete HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 200 OK
  Content-Length: 153
  Expires: Wed, 02 Jul 2014 18:58:31 GMT
  Server: example-server/0.1
  Etag: "-1508172875796647067"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:31 GMT
  Content-Type: application/cdni.ci.TriggerCollection+json

  {
      "staleresourcetime": 86400,
      "triggers": [
          "http://dcdn.example.com/triggers/0",
          "http://dcdn.example.com/triggers/1"
      ]
  }]]></artwork>
          </figure>
        </section>

        <section title="Cancelling or Removing a Trigger">
          <t>To request the dCDN to cancel a Trigger, the uCDN may delete the
          Trigger Resource. It may also delete completed and failed triggers
          to reduce the size of the collections. For example, to remove the
          "preposition" request from earlier examples:</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  DELETE /triggers/0 HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 204 No Content
  Date: Wed, 02 Jul 2014 18:57:31 GMT
  Content-Length: 0
  Content-Type: text/html; charset=UTF-8
  Server: example-server/0.1]]></artwork>
          </figure>

          <t/>

          <t>This would, for example, cause the collection of completed
          triggers shown in the example above to be updated to:</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers/complete HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 200 OK
  Content-Length: 106
  Expires: Wed, 02 Jul 2014 18:58:31 GMT
  Server: example-server/0.1
  Etag: "-1842390246836476263"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 18:57:31 GMT
  Content-Type: application/cdni.ci.TriggerCollection+json

  {
      "staleresourcetime": 86400,
      "triggers": [
          "http://dcdn.example.com/triggers/1"
      ]
  }]]></artwork>
          </figure>
        </section>

        <section title="Error Reporting">
          <t>In this example the uCDN has requested prepositioning of
          "http://newsite.example.com/index.html", but the dCDN was unable to
          locate metadata for that site:</t>

          <figure>
            <artwork><![CDATA[REQUEST:

  GET /triggers/2 HTTP/1.1
  User-Agent: example-user-agent/0.1
  Host: dcdn.example.com
  Accept: */*


RESPONSE:

  HTTP/1.1 200 OK
  Content-Length: 505
  Expires: Wed, 02 Jul 2014 19:16:48 GMT
  Server: example-server/0.1
  Etag: "-6310233270471598826"
  Cache-Control: max-age=60
  Date: Wed, 02 Jul 2014 19:15:48 GMT
  Content-Type: application/cdni.ci.TriggerStatus+json

  {
      "ctime": 1404328544,
      "errors": [
          {
              "content.urls": [
                  "http://newsite.example.com/index.html"
              ],
              "description":
                  "No HostIndex entry found for newsite.example.com",
              "error": "EMETA"
          }
      ],
      "etime": 1404328552,
      "mtime": 1404328548,
      "status": "active",
      "trigger": {
          "content.urls": [
              "http://newsite.example.com/index.html"
          ],
          "type": "preposition"
      }
  }]]></artwork>
          </figure>
        </section>
      </section>
    </section>

    <section title="IANA Considerations">
      <t/>

      <section anchor="mime-types" title="CI/T MIME Media Types">
        <t>The IANA is requested to allocate the following MIME Media Types in
        the MIME Media Types registry:</t>

        <t><list style="symbols">
            <t>application/cdni.ci.TriggerRequest</t>

            <t>application/cdni.ci.TriggerStatus</t>

            <t>application/cdni.ci.TriggerCollection</t>
          </list>Use of these types is specified in <xref
        target="media-types"/> of the present document.</t>
      </section>
    </section>

    <section anchor="Security" title="Security Considerations">
      <section title="Authentication, Confidentiality, Integrity Protection">
        <t>A CI/T dCDN server implementation MUST support TLS transport for
        HTTP (https) as per <xref target="RFC2818"/>. The use of TLS for
        transport of the CI/T interface allows the dCDN and the uCDN to
        authenticate each other (to ensure they are receiving trigger requests
        from, or reporting status to, an authenticated CDN).</t>

        <t>HTTP requests that attempt to access or operate on CI/T data
        belonging to another CDN MUST be rejected using either HTTP "403
        Forbidden" or "404 Not Found". (Note that in a "diamond"
        configuration, where one uCDN's content can be acquired via more than
        one directly-connected uCDN, it may not be possible for the dCDN to
        determine from which uCDN it acquired content. In this case, it MUST
        allow each upstream that may have been responsible for acquisition of
        that content to act upon it using trigger requests.)</t>

        <t>Trigger creation requests that attempt to operate on metadata or
        content not acquired from the uCDN making the request MUST be
        rejected. The rejection can either be signalled to dCDN using HTTP
        "403 Forbidden" or "404 Not Found", or a Trigger Status Resource can
        be created with an ErrorDesc value of EPERM for any affected URLs.</t>

        <t>In an environment where any such protection is required, TLS SHOULD
        be used for transport of the CI/T requests and responses, unless
        alternate methods are used for ensuring that only authorised clients
        are able to access their own data (such as setting up an IPsec tunnel
        between the two CDNs, or using a physically secured internal network
        between two CDNs that are owned by the same corporate entity). Both
        parties of the transaction (the uCDN and the dCDN) SHOULD use mutual
        authentication.</t>

        <t>A CI/T implementation MUST support the
        TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 cipher suite (<xref
        target="RFC5288"/>). An implementation of the CI/T Interface SHOULD
        prefer cipher suites which support perfect forward secrecy over cipher
        suites that don't.</t>
      </section>

      <section title="Denial of Service">
        <t>This document does not define a specific mechanism to protect
        against Denial of Service (DoS) attacks on the CI/T. However, CI/T
        endpoints can be protected against DoS attacks through the use of TLS
        transport and/or via mechanisms outside the scope of the CI/T
        interface, such as firewalling or use of Virtual Private Networks
        (VPNs).</t>
      </section>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors thank Kevin Ma for his ongoing input.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &rfc2119;

      &rfc7231;

      &rfc7232;

      &rfc7159;

      &rfc3986;
    </references>

    <references title="Informative References">
      &rfc6707;

      &I-D.draft-ietf-cdni-framework-14;

      &I-D.draft-ietf-cdni-requirements-17;

      &I-D.draft-ietf-cdni-metadata-06;

      &rfc4287;

      &rfc2818;

      &rfc5288;

      <reference anchor="XML-BASE">
        <front>
          <title>XML Base (Second Edition) -
          http://www.w3.org/TR/xmlbase/</title>

          <author fullname="Jonathan" initials="J" role="editor"
                  surname="Marsh">
            <organization/>
          </author>

          <author fullname="Richard" initials="R" role="editor"
                  surname="Tobin">
            <organization/>

            <address>
              <postal>
                <street/>

                <city/>

                <region/>

                <code/>

                <country/>
              </postal>

              <phone/>

              <facsimile/>

              <email/>

              <uri/>
            </address>
          </author>

          <date day="28" month="January" year="2009"/>
        </front>
      </reference>
    </references>
  </back>
</rfc>

PAFTECH AB 2003-20262026-04-24 01:09:40