<?xml version="1.0" encoding="UTF-8"?>
<!-- (C) 2011 OpenStack LLC., All Rights Reserved -->
<!--*******************************************************-->
<!--         Import Common XML Entities                    -->
<!--                                                       -->
<!--     You can resolve the entites with xmllint          -->
<!--                                                       -->
<!--        xmllint -noent OS-KSCATALOG-admin.wadl         -->
<!--*******************************************************-->
<!DOCTYPE application [
<!ENTITY % common  SYSTEM "../common/common.ent">
%common;
]>

<application xmlns="http://wadl.dev.java.net/2009/02"
	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:capi="http://docs.openstack.org/common/api/v2.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
	xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 ../common/xsd/api.xsd
		http://docs.openstack.org/common/api/v1.0 ../common/xsd/api-common.xsd
		http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
		http://docs.openstack.org/identity/api/ext/OS-KSCATALOG/v1.0 ../common/xsd/OS-KSCATALOG.xsd
		">

    <grammars>
        <include href="../common/xsd/api.xsd"/>
        <include href="../common/xsd/api-common.xsd"/>
        <include href="../common/xsd/OS-KSCATALOG.xsd"/>
    </grammars>
    <!--*******************************************************-->
    <!--             All Resoruces                             -->
    <!--*******************************************************-->

    <!-- We should use SSL in production -->
    <resources base="http://localhost:5001">
        <resource id="version" path="v2.0">

            <resource id="tenants" path="tenants">
                <param name="X-Auth-Token" style="header" type="xsd:string" required="true"/>
                <resource id="tenantId" path="{tenantId}">
                    <param name="tenantId" style="template" type="xsd:string"/>
                    <resource id="endpoints-OS-KSCATALOG" path="OS-KSCATALOG">                    
                        <resource id="endpoints" path="endpoints">
                            <method href="#listEndpoints"/>
                            <method href="#addEndpoint"/>
                            <resource id="endpoint" path="{endpointId}">
                                <param name="endpointId" style="template" type="xsd:string"/>
                                <method href="#getEndpoint"/>
                                <method href="#deleteEndpoint"/>
                            </resource>
                        </resource>
                     </resource>
                </resource>    
            </resource>
            
            <resource id="role-service-OS-KSCATALOG" path="OS-KSCATALOG">
                <resource id="endpointTemplates" path="endpointTemplates">
                    <param name="X-Auth-Token" style="header" type="xsd:string" required="true"/>
                    <method href="#listEndpointTemplates"/>
                    <method href="#addEndpointTemplate"/>
                    <resource id="endpointTemplateId" path="{endpointTemplateId}">
                        <param name="X-Auth-Token" style="header" type="xsd:string" required="true"/>
                        <param name="endpointTemplateId" style="template" type="xsd:int"/>
                        <method href="#getEndpointTemplate"/>
                        <method href="#deleteEndpointTemplate"/>
                    </resource>
                </resource>
            </resource>
        </resource>
    </resources>

    <!--*******************************************************-->
    <!--               All Methods                             -->
    <!--*******************************************************-->

    <!-- EndPoint Templates -->
    
    <method name="GET" id="listEndpointTemplates">
        <doc xml:lang="EN" title="List Endpoint Templates">
            <p xmlns="http://www.w3.org/1999/xhtml">List Endpoint Templates.</p>
            
        </doc>        
        <request>
            <param name="serviceId" style="query" required="false" type="xsd:string"/>
        </request>
        <response status="200 203">
            <representation mediaType="application/xml" element="OS-KSCATALOG:endpointTemplates">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplates.xml"/>
            </doc>
         </representation>
            <representation mediaType="application/json">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplates.json"/>
            </doc>
         </representation>
        </response>
        &commonFaults;
        &getFaults;
    </method>
    
    <method name="GET" id="getEndpointTemplate">
        <doc xml:lang="EN" title="Get Endpoint Template">
            <p xmlns="http://www.w3.org/1999/xhtml">Get Endpoint Template.</p>
            
        </doc>
        <response status="200 203">
            <representation mediaType="application/xml" element="OS-KSCATALOG:endpointTemplate">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplate.xml"/>
            </doc>
         </representation>
            <representation mediaType="application/json">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplate.json"/>
            </doc>
         </representation>
        </response>
        &commonFaults;
        &getFaults;
    </method>
    
    <method name="POST" id="addEndpointTemplate">
        <doc xml:lang="EN" title="Add Endpoint Template">
            <p xmlns="http://www.w3.org/1999/xhtml">Add Endpoint Template.</p>
            
            
        </doc>
        <request>
            <representation mediaType="application/xml" element="OS-KSCATALOG:endpointTemplate">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplate.xml"/>
            </doc>
         </representation>
            <representation mediaType="application/json">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplate.json"/>
            </doc>
         </representation>
        </request>
        <response status="201">
            <representation mediaType="application/xml" element="OS-KSCATALOG:endpointTemplate">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplate.xml"/>
            </doc>
                <param name="Location" type="xsd:anyURI" style="header"/>
            </representation>
            <representation mediaType="application/json">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplate.json"/>
            </doc>
                <param name="Location" type="xsd:anyURI" style="header"/>
            </representation>
        </response>
        &commonFaults;
        &getFaults;
        &postPutFaults;
    </method>
    
    <method name="DELETE" id="deleteEndpointTemplate">
        <doc xml:lang="EN" title="Delete Endpoint Template.">
            <p xmlns="http://www.w3.org/1999/xhtml">Delete a Endpoint Template.</p>
        </doc>    
        <response status="204"/>
        &commonFaults;
        &getFaults;
    </method>
    
    <method name="POST" id="addEndpoint">
        <doc xml:lang="EN" title="Add Endpoint">
            <p xmlns="http://www.w3.org/1999/xhtml">Add Endpoint to a tenant.</p>
            
            
        </doc>
        <request>
            <representation mediaType="application/xml" element="OS-KSCATALOG:endpointTemplate">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplateWithOnlyId.xml"/>
            </doc>
            <param name="endpoint" style="plain" path="/"
                   type="OS-KSCATALOG:EndpointTemplateWithOnlyId"/>
         </representation>
            <representation mediaType="application/json">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpointTemplateWithOnlyId.json"/>
            </doc>
            </representation>
        </request>
        <response status="201">
            <representation mediaType="application/xml" element="identity:endpoint">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpoint.xml"/>
            </doc>
                <param name="Location" type="xsd:anyURI" style="header"/>
            </representation>
            <representation mediaType="application/json">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpoint.json"/>
            </doc>
                <param name="Location" type="xsd:anyURI" style="header"/>
            </representation>
        </response>
        &commonFaults;
        &getFaults;
        &postPutFaults;
    </method>
    
    <method name="GET" id="listEndpoints">
        <doc xml:lang="EN" title="List Endpoints">
            <p xmlns="http://www.w3.org/1999/xhtml">List Endpoints of a Tenant.</p>
            
        </doc>        
        <response status="200 203">
            <representation mediaType="application/xml" element="identity:endpoints">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpoints.xml"/>
            </doc>
         </representation>
            <representation mediaType="application/json">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpoints.json"/>
            </doc>
         </representation>
        </response>
        &commonFaults;
        &getFaults;
    </method>
    
    <method name="GET" id="getEndpoint">
        <doc xml:lang="EN" title="Get Endpoint">
            <p xmlns="http://www.w3.org/1999/xhtml">Get Endpoint of a Tenant.</p>
            
        </doc>
        <response status="200 203">
            <representation mediaType="application/xml" element="identity:endpoint">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpoint.xml"/>
            </doc>
         </representation>
            <representation mediaType="application/json">
            <doc xml:lang="EN">
               <xsdxt:code href="../common/samples/endpoint.json"/>
            </doc>
         </representation>
        </response>
        &commonFaults;
        &getFaults;
    </method>
    
    <method name="DELETE" id="deleteEndpoint">
        <doc xml:lang="EN" title="Delete Endpoint.">
            <p xmlns="http://www.w3.org/1999/xhtml">Delete a Endpoint from a Tenant.</p>
        </doc>    
        <response status="204"/>
        &commonFaults;
        &getFaults;
    </method>
</application>
