<?xml version="1.0" encoding="UTF-8"?>
<book version="5.0" xmlns="http://docbook.org/ns/docbook"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:svg="http://www.w3.org/2000/svg"
      xmlns:m="http://www.w3.org/1998/Math/MathML"
      xmlns:html="http://www.w3.org/1999/xhtml"
      xmlns:db="http://docbook.org/ns/docbook">
  <info>
    <title>OGF OCCI-WG Deliverables</title>

    <author>
      <personname>OCCI-WG</personname>
    </author>

    <org>
      <orgname>Open Grid Forum (OGF)</orgname>
    </org>

    <pubdate>May 2009</pubdate>
  </info>

  <article>
    <title>OCCI Core</title>

    <section>
      <title>Introduction</title>

      <para>The Open Cloud Computing Interface is an open community consensus
      API, initially targeting cloud infrastructure services or
      "Infrastructure as a Service (IaaS)". A "Resource Oriented Architecture
      (ROA)", it is as close as possible to the underlying HyperText Transfer
      Protocol (HTTP), deviating only where absolutely necessary. Each
      resource (identified by a canonical URL) can have multiple
      representations which may or may not be hypertext (e.g. HTML). Metadata
      including associations between resources is exposed via HTTP headers
      (e.g. the Link: header), except in the case of collections where Atom is
      used as the meta-model.</para>
    </section>

    <section>
      <title>Basics</title>

      <bridgehead>URL Namespace</bridgehead>

      <para>A single URL entry point (and optionally, suitable credentials for
      HTTP based authentication schemes) is all a client requires. Each
      resource type or "noun" (e.g. compute, network, storage) is visible as a
      collection at the root level (e.g.
      http://example.com/compute)<remark>Perhaps we should consider allowing
      them anywhere/everywhere as is the case today</remark> and the resources
      themselves appear under these collections (e.g.
      http://example.com/compute/123). Implementors should also expose an
      AtomPub service document at the root to enable enumeration of resource
      types, supported formats and categories.</para>

      <bridgehead>Nouns, Verbs and Attributes</bridgehead>

      <para>Interfaces expose "nouns" which have "attributes" and on which
      "verbs" can be performed. The attributes are exposed as key-value pairs
      and appropriate verbs as links, following HATEOAS principles.</para>

      <bridgehead>CRUD Operations</bridgehead>

      <para>Create, Retrieve, Update and Delete (CRUD) operations map to the
      POST, GET, PUT and DELETE HTTP verbs respectively. HEAD and OPTIONS
      verbs may be used to retrieve metadata and valid operations without the
      entity body to improve performance. Additionally, all existing HTTP
      functionality is available for caching, proxying, gatewaying and other
      advanced functionality.</para>

      <glosslist>
        <glossentry>
          <glossterm>POST (Create)</glossterm>

          <glossdef>
            <para>POSTing a representation (e.g. OVF) to a collection (e.g.
            /compute) will result in a new resource being created (e.g.
            /compute/123) and returned in the Location: header. POST is also
            used with HTML form data to trigger verbs (e.g. restart)</para>
          </glossdef>
        </glossentry>

        <glossentry>
          <glossterm>GET (Retrieve)</glossterm>

          <glossdef>
            <para>GETting a resource (e.g. /compute/123) will return a
            representation of that resource in the most appropriate supported
            format specified by the client in the Accept header. Otherwise
            "406 Not Acceptable" will be returned.</para>
          </glossdef>
        </glossentry>

        <glossentry>
          <glossterm>PUT (Update)</glossterm>

          <glossdef>
            <para>PUTting a representation (e.g. OVF) to a URL (e.g.
            /compute/123) will result in the resource being created or
            updated. The URL is known or selected by the client (in which case
            UUIDs should be used), in contrast to POSTs where the URL is
            selected by the server.</para>
          </glossdef>
        </glossentry>

        <glossentry>
          <glossterm>DELETE (Delete)</glossterm>

          <glossdef>
            <para>DELETE results in the deletion of the resource (and
            everything "under" it, as appropriate).</para>
          </glossdef>
        </glossentry>
      </glosslist>

      <bridgehead>Web Linking</bridgehead>

      <para>Linked cloud resources extend the World Wide Web (WWW) of linked
      hypertext (e.g. HTML) documents, only the links themselves are expressed
      out-of-band rather than inline.</para>

      <bridgehead>Collections</bridgehead>

      <para>Operations that return multiple resources (e.g. categories,
      searches) are rendered as an Atom feed with an Atom entry per resource.
      Metadata that would normally appear in the HTTP headers appears in
      standard Atom elements with the entity-body itself being passed by
      reference or by value in the Atom content element.</para>

      <bridgehead>Versioning</bridgehead>

      <para>Clients and servers should expose the protocol version (e.g.
      OCCI/1.0) via the User-Agent and Server HTTP headers respectively.
      Should second or subsequent versions of the descriptor format be
      required the version will be added to the Internet media type (e.g.
      application/occi2+xml).</para>
    </section>

    <section>
      <title>References</title>

      <para>The following standards are referenced by this
      implementation.</para>

      <itemizedlist>
        <listitem>
          <para>RFC 2616 Hypertext Transfer Protocol -- HTTP/1.1</para>
        </listitem>

        <listitem>
          <para>RFC 4287 The Atom Syndication Format</para>
        </listitem>

        <listitem>
          <para>RFC 5023 The Atom Publishing Protocol</para>
        </listitem>
      </itemizedlist>

      <para>Additionally RFC 2119 Requirement Levels are used
      throughout.</para>
    </section>
  </article>

  <article>
    <title>OCCI Infrastructure</title>

    <para>OCCI Infrastructure defines three nouns and various extensions
    relating to management of cloud infrastructure services (IaaS).</para>

    <section>
      <title>Nouns</title>

      <para>Cloud infrastructure can be modeled using three primary nouns:
      compute, network and storage.</para>

      <section>
        <title>Compute</title>

        <para>A compute resource is capable of conducting computations (e.g. a
        virtual machine).</para>

        <table>
          <title>Compute Attributes</title>

          <tgroup cols="3">
            <colspec align="center" />

            <thead>
              <row>
                <entry align="left">Attribute</entry>

                <entry>Type</entry>

                <entry>Description</entry>
              </row>
            </thead>

            <tbody>
              <row>
                <entry align="left">occi.compute.arch</entry>

                <entry>Enum (x86, x64)</entry>

                <entry>CPU Architecture (e.g. x64)</entry>
              </row>

              <row>
                <entry align="left">occi.compute.cores</entry>

                <entry>Integer</entry>

                <entry>Number of CPU cores (e.g. 1, 2)</entry>
              </row>

              <row>
                <entry align="left">occi.compute.memory</entry>

                <entry>Float (2^20 bytes)</entry>

                <entry>RAM in megabytes (e.g. 2048)</entry>
              </row>

              <row>
                <entry align="left">occi.compute.speed</entry>

                <entry>Float (10^9 Hertz)</entry>

                <entry>Clock speed in gigahertz (e.g. 2.4)</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </section>

      <section>
        <title>Network</title>

        <para>A network resource is capable of transferring data (e.g. a
        virtual network or VLAN).</para>

        <table>
          <title>Network Attributes</title>

          <tgroup cols="3">
            <colspec align="center" />

            <thead>
              <row>
                <entry align="left">Attribute</entry>

                <entry>Type</entry>

                <entry>Description</entry>
              </row>
            </thead>

            <tbody>
              <row>
                <entry align="left">occi.network.vlan-id</entry>

                <entry>Integer (0..4095)</entry>

                <entry>802.1q VLAN ID (e.g. 4095)</entry>
              </row>

              <row>
                <entry align="left">occi.network.vlan-tag</entry>

                <entry>Token</entry>

                <entry>Tag based VLANs (e.g. external-dmz)</entry>
              </row>

              <row>
                <entry align="left">occi.network.ipv4[].gateway</entry>

                <entry>IPv4 Address</entry>

                <entry>IPv4 gateway address (e.g. 192.168.0.1)</entry>
              </row>

              <row>
                <entry align="left">occi.network.ipv4[].netmask</entry>

                <entry>IPv4 Address</entry>

                <entry>IPv4 netmask address (e.g. 255.255.255.0)</entry>
              </row>

              <row>
                <entry align="left">occi.network.ipv4[].network</entry>

                <entry>IPv4 Address</entry>

                <entry>IPv4 network address (e.g. 192.168.0.0)</entry>
              </row>

              <row>
                <entry align="left">occi.network.ipv4[].cidr</entry>

                <entry>Integer (0..32)</entry>

                <entry>Netmask in CIDR notation (e.g. 24)</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </section>

      <section>
        <title>Storage</title>

        <para>A storage resource is capable of mass storage of data (e.g. a
        virtual hard drive).</para>

        <table>
          <title>Storage Attributes</title>

          <tgroup cols="3">
            <colspec align="center" />

            <thead>
              <row>
                <entry align="left">Attribute</entry>

                <entry>Type</entry>

                <entry>Description</entry>
              </row>
            </thead>

            <tbody>
              <row>
                <entry align="left">occi.storage.persistence</entry>

                <entry>Enum (transient, persistent, reliable)</entry>

                <entry>Qualitative device persistence (e.g. transient)</entry>
              </row>

              <row>
                <entry align="left">occi.storage.size</entry>

                <entry>Integer (10^9 bytes)</entry>

                <entry>Drive size in gigabytes (e.g. 40)</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </section>
    </section>

    <section>
      <title>Extensions</title>

      <para>Various extensions provide for more advanced management
      functionality such as billing, monitoring and reporting.</para>

      <section>
        <title>State machine (state)</title>

        <para>The state machine extension allows for the modeling of
        arbitrarily complex state machines and associated transitions (e.g.
        start, stop, restart).</para>
      </section>
    </section>
  </article>

  <article>
    <title>OCCI Registries</title>

    <table>
      <title>HTTP Status Codes</title>

      <tgroup cols="3">
        <thead>
          <row>
            <entry>Code</entry>

            <entry>Description</entry>

            <entry>Example</entry>
          </row>
        </thead>

        <tbody>
          <row>
            <entry>200 OK</entry>

            <entry>Request completed successfully</entry>

            <entry>Response is returned</entry>
          </row>

          <row>
            <entry>201 Created</entry>

            <entry>Request completed successfully, resource was
            created</entry>

            <entry>Pointer to new resource returned</entry>
          </row>

          <row>
            <entry>202 Accepted</entry>

            <entry>Request accepted, processing not completed</entry>

            <entry>Workload starting but not yet active</entry>
          </row>

          <row>
            <entry>301 Moved Permanently</entry>

            <entry>Resource has been assigned a new permanent URI</entry>

            <entry>Workload migrated to another installation</entry>
          </row>

          <row>
            <entry>302 Found</entry>

            <entry>Resource resides temporarily under a different URI</entry>

            <entry>Alias pointing to UUID can be updated</entry>
          </row>

          <row>
            <entry>304 Not Modified</entry>

            <entry>Conditional GET on resource that is unchanged</entry>

            <entry>Client already has the latest version of the
            resource</entry>
          </row>

          <row>
            <entry>400 Bad Request</entry>

            <entry>Request could not be understood by the server due to
            malformed syntax</entry>

            <entry>Client sent a representation that was unable to be
            understood</entry>
          </row>

          <row>
            <entry>401 Unauthorized</entry>

            <entry>The request requires user authentication</entry>

            <entry>Client must retry with authentication</entry>
          </row>

          <row>
            <entry>402 Payment Required</entry>

            <entry>The server has refused to fulfill the request</entry>

            <entry>Credit limit exceeded</entry>
          </row>

          <row>
            <entry>403 Forbidden</entry>

            <entry>The server understood the request, but is refusing to
            fulfill it</entry>

            <entry>Attempt to access resource without permission</entry>
          </row>

          <row>
            <entry>404 Not Found</entry>

            <entry>The server has not found the resource</entry>

            <entry>Feed or entry unknown</entry>
          </row>

          <row>
            <entry>405 Method Not Allowed</entry>

            <entry>The method specified is not allowed for the
            resource</entry>

            <entry>Attempt to delete an immutable resource</entry>
          </row>

          <row>
            <entry>406 Not Acceptable</entry>

            <entry>The resource is not capable of requested content
            characteristics</entry>

            <entry>Unsupported output format requested</entry>
          </row>

          <row>
            <entry>409 Conflict</entry>

            <entry>Request is in conflict with the current state of the
            resource</entry>

            <entry>Resource updated by a third-party in the interim</entry>
          </row>

          <row>
            <entry>410 Gone</entry>

            <entry>Resource is gone, no forwarding address</entry>

            <entry>Resource was deleted</entry>
          </row>

          <row>
            <entry>500 Internal Server Error</entry>

            <entry>Server encountered an unexpected condition</entry>

            <entry>An unknown failure has occurred (e.g. out of
            memory)</entry>
          </row>

          <row>
            <entry>501 Not Implemented</entry>

            <entry>Functionality required to fulfill request is not
            implemented</entry>

            <entry>A missing extension was called</entry>
          </row>

          <row>
            <entry>502 Bad Gateway</entry>

            <entry>An invalid response was received from an upstream
            server</entry>

            <entry>The gateway received a malformed response from a
            node</entry>
          </row>

          <row>
            <entry>503 Service Unavailable</entry>

            <entry>Server is temporarily unable to handle the request</entry>

            <entry>Server may be overloaded or down for maintenance</entry>
          </row>

          <row>
            <entry>504 Gateway Timeout</entry>

            <entry>No response was received from an upstream server</entry>

            <entry>The gateway did not receive a response within the timeout
            period</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </article>
</book>
