<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../xslt/schema.xslt"?>

<!-- (C) 2011 OpenStack LLC., All Rights Reserved -->

<schema
        elementFormDefault="qualified"
        attributeFormDefault="unqualified"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
        xmlns:OS-KSCATALOG="http://docs.openstack.org/identity/api/ext/OS-KSCATALOG/v1.0"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
        xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
        xmlns:atom="http://www.w3.org/2005/Atom"
        targetNamespace="http://docs.openstack.org/identity/api/ext/OS-KSCATALOG/v1.0"
    >
    <!-- Import ATOM specific schema definitions -->
    <import vc:minVersion="1.1" namespace="http://www.w3.org/2005/Atom"
            schemaLocation="atom/atom.xsd" />

    <import namespace="http://docs.openstack.org/identity/api/v2.0"
        schemaLocation="api.xsd" />
    
    <element name="endpointTemplates" type="OS-KSCATALOG:EndpointTemplateList">
        <annotation>
            <xsd:documentation
                    xml:lang="EN"
                    xmlns="http://www.w3.org/1999/xhtml">
                <p>
                    A list of Endpoint Templates.
                </p>
            </xsd:documentation>
        </annotation>
    </element>
    
    <element name="endpointTemplate" type="OS-KSCATALOG:EndpointTemplate">
        <annotation>
            <xsd:documentation
                    xml:lang="EN"
                    xmlns="http://www.w3.org/1999/xhtml">
                <p>
                    An Endpoint Template.
                </p>
            </xsd:documentation>
        </annotation>
    </element>

    <!-- Complex Types -->
    <complexType name="EndpointTemplate">
        <sequence>
            <element name="version" type="identity:VersionForService" maxOccurs="1" minOccurs="0">
                <annotation>
                    <xsd:documentation
                        xml:lang="EN"
                        xmlns="http://www.w3.org/1999/xhtml">
                        <p>
                            Version details.
                        </p>
                    </xsd:documentation>
                </annotation>               
            </element>
            <element vc:minVersion="1.1" ref="atom:link" minOccurs="0" maxOccurs="unbounded" />
            <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </sequence>
        <attribute name="id" type="xsd:string" use="required">
            <annotation>
                <xsd:documentation
                        xml:lang="EN"
                        xmlns="http://www.w3.org/1999/xhtml">
                    <p>
                        An ID uniquely identifying the Endpoint Template.
                    </p>
                </xsd:documentation>
            </annotation>
        </attribute>
        <attribute name="type" type="identity:ExtensibleServiceType" use="optional">
            <annotation>
                <xsd:documentation
                    xml:lang="EN"
                    xmlns="http://www.w3.org/1999/xhtml">
                    <p>
                        The OpenStack-registered type (e.g. 'compute', 'object-store', etc).
                    </p>
                </xsd:documentation>
            </annotation>
        </attribute>
        <attribute name="name" type="xsd:string" use="optional">
            <annotation>
                <xsd:documentation
                    xml:lang="EN"
                    xmlns="http://www.w3.org/1999/xhtml">
                    <p>
                        The commercial service name (e.g. 'My Nova Cloud Servers').
                    </p>
                </xsd:documentation>
            </annotation>
        </attribute>
        <attribute name="region" type="xsd:string" use="optional">
            <annotation>
                <xsd:documentation
                        xml:lang="EN"
                        xmlns="http://www.w3.org/1999/xhtml">
                    <p>
                        The region of Endpoint Template.
                    </p>
                </xsd:documentation>
            </annotation>
        </attribute>
        <attribute name="publicURL" type="xsd:anyURI" use="optional">
            <annotation>
                <xsd:documentation
                        xml:lang="EN"
                        xmlns="http://www.w3.org/1999/xhtml">
                    <p>
                        The public URL to access represented service.
                    </p>
                </xsd:documentation>
            </annotation>
        </attribute>
        <attribute name="internalURL" type="xsd:anyURI" use="optional">
            <annotation>
                <xsd:documentation
                        xml:lang="EN"
                        xmlns="http://www.w3.org/1999/xhtml">
                    <p>
                        The internal version of the public URL.
                    </p>
                </xsd:documentation>
            </annotation>
        </attribute>
        <attribute name="adminURL" type="xsd:anyURI" use="optional">
            <annotation>
                <xsd:documentation
                        xml:lang="EN"
                        xmlns="http://www.w3.org/1999/xhtml">
                    <p>
                        The admin URL.
                    </p>
                </xsd:documentation>
            </annotation>
        </attribute>
        <attribute name="global" type="xsd:boolean" default="false" use="optional">
            <annotation>
                <xsd:documentation
                        xml:lang="EN"
                        xmlns="http://www.w3.org/1999/xhtml">
                    <p>
                        If true the Endpoint Template is automatically part of every account.
                    </p>
                </xsd:documentation>
            </annotation>
        </attribute>
        <attribute name="enabled" type="xsd:boolean" default="true" use="optional">
            <annotation>
                <xsd:documentation
                    xml:lang="EN"
                    xmlns="http://www.w3.org/1999/xhtml">
                    <p>
                        True if the Endpoint Template is enabled (active). 
                        A Endpoint Template cannot be added if it's disabled or inactive (false). 
                    </p>
                </xsd:documentation>
            </annotation>
        </attribute>
        <anyAttribute namespace="##other" processContents="lax"/>
    </complexType>

    <complexType name="EndpointTemplateList">
        <sequence>
            <element name="endpointTemplate" type="OS-KSCATALOG:EndpointTemplate" minOccurs="0" maxOccurs="unbounded"/>
            <element vc:minVersion="1.1" ref="atom:link" minOccurs="0" maxOccurs="unbounded" />
            <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
        </sequence>
         <anyAttribute namespace="##other" processContents="lax"/>
    </complexType>
    
    <complexType name="EndpointTemplateWithOnlyId">
        <complexContent>
            <restriction base="OS-KSCATALOG:EndpointTemplate">
                 <attribute name="id" type="xsd:string" use="required"/>
                 <attribute name="type" type="identity:ExtensibleServiceType" use="prohibited"/>
                 <attribute name="name" type="xsd:string" use="prohibited"/>
                 <attribute name="region" type="xsd:string" use="prohibited"/>
                 <attribute name="publicURL" type="xsd:anyURI" use="prohibited"/>
                 <attribute name="internalURL" type="xsd:anyURI" use="prohibited"/>
                 <attribute name="adminURL" type="xsd:anyURI" use="prohibited"/>
                 <attribute name="global" type="xsd:boolean" use="prohibited"/>
                 <attribute name="enabled" type="xsd:boolean" use="prohibited"/>
            </restriction>
        </complexContent>
    </complexType>   
</schema>
