Adds api site including WADLs for Compute, Identity, and Image APIs
Change-Id: Id0dae44d9dca3005f3c77aa8f0575ca411f9c225
This commit is contained in:
parent
158a25d7da
commit
4b0ab21f2c
|
@ -0,0 +1,171 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<!-- POM Build file for the Keystone Developer Guide -->
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.openstack.identity</groupId>
|
||||
<artifactId>docs</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>OpenStack API Page Test Project</name>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>Rackspace Research Repositories</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>rackspace-research</id>
|
||||
<name>Rackspace Research Repository</name>
|
||||
<url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>rackspace-research</id>
|
||||
<name>Rackspace Research Repository</name>
|
||||
<url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<doctools.version>1.0.11-SNAPSHOT</doctools.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- We need Saxon 9 and clouddocs-maven-plugin here to normalize wadls -->
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.saxon</groupId>
|
||||
<artifactId>saxon</artifactId>
|
||||
<version>9.1.0.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rackspace.cloud.api</groupId>
|
||||
<artifactId>clouddocs-maven-plugin</artifactId>
|
||||
<version>${doctools.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- Unpack the wadl normalization xslts -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-shared-resources</id>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<phase>generate-sources</phase>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
|
||||
<includeGroupIds>com.rackspace.cloud.api</includeGroupIds>
|
||||
<includeArtifactIds>clouddocs-maven-plugin</includeArtifactIds>
|
||||
<!-- <includeClassifiers>ns-resources</includeClassifiers> -->
|
||||
<excludeTransitive>true</excludeTransitive>
|
||||
<includes>**/normalizeWadl/*.xsl</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>xml-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
</goals>
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- Comment out this phase and uncomment the phase for the -->
|
||||
<!-- plugin above to switch to grabbing the wadl from the -->
|
||||
<!-- web. -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<phase>generate-sources</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<transformationSets>
|
||||
<transformationSet>
|
||||
<dir>src/wadls/image-api/src</dir>
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- Add other wadls to be normalized here -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<includes>
|
||||
<include>os-image-*.wadl</include>
|
||||
</includes>
|
||||
<stylesheet>${project.build.directory}/generated-resources/cloud/normalizeWadl/normalizeWadl.xsl</stylesheet>
|
||||
<!--
|
||||
This is optional. By default, the xslts look for the samples relative the to wadl.
|
||||
-->
|
||||
<!--
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>samples.path</name>
|
||||
<value>${project.build.directory}/../src/docbkx</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
-->
|
||||
</transformationSet>
|
||||
<transformationSet>
|
||||
<dir>src/wadls/identity-api/src/service</dir>
|
||||
<includes>
|
||||
<include>identity.wadl</include>
|
||||
</includes>
|
||||
<stylesheet>${project.build.directory}/generated-resources/cloud/normalizeWadl/normalizeWadl.xsl</stylesheet>
|
||||
</transformationSet>
|
||||
<transformationSet>
|
||||
<dir>src/wadls/compute-api/src</dir>
|
||||
<includes>
|
||||
<include>*.wadl</include>
|
||||
</includes>
|
||||
<stylesheet>${project.build.directory}/generated-resources/cloud/normalizeWadl/normalizeWadl.xsl</stylesheet>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.sf.saxon</groupId>
|
||||
<artifactId>saxon</artifactId>
|
||||
<version>8.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.rackspace.cloud.api</groupId>
|
||||
<artifactId>clouddocs-maven-plugin</artifactId>
|
||||
<version>${doctools.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>g1</id>
|
||||
<goals>
|
||||
<goal>generate-html</goal>
|
||||
</goals>
|
||||
<phase>generate-sources</phase>
|
||||
<configuration>
|
||||
<highlightSource>false</highlightSource>
|
||||
<enableGoogleAnalytics>1</enableGoogleAnalytics>
|
||||
<googleAnalyticsId>UA-17511903-8</googleAnalyticsId>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!-- These parameters apply to pdf and webhelp -->
|
||||
<xincludeSupported>true</xincludeSupported>
|
||||
<sourceDirectory>src/docbkx</sourceDirectory>
|
||||
<includes>
|
||||
index.xml
|
||||
</includes>
|
||||
<profileSecurity>reviewer</profileSecurity>
|
||||
<branding>rackspace</branding>
|
||||
<trimWadlUriCount>1</trimWadlUriCount>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<book
|
||||
xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:wadl="http://wadl.dev.java.net/2009/02"
|
||||
version="5.0-extension RackBook-2.0"
|
||||
xml:id="api.openstack.org">
|
||||
<info>
|
||||
<title>OpenStack APIs</title>
|
||||
<copyright>
|
||||
<year>2010-2012</year>
|
||||
</copyright>
|
||||
<legalnotice role="apache2">
|
||||
<para/>
|
||||
</legalnotice>
|
||||
</info>
|
||||
<preface xml:id="Overview">
|
||||
<title>OpenStack API Reference</title>
|
||||
|
||||
<para>The OpenStack system has several key projects that are
|
||||
separate installations but can work together depending on your
|
||||
cloud needs: OpenStack Compute, OpenStack Object Storage,
|
||||
OpenStack Identity Service, and OpenStack Image Service.</para>
|
||||
|
||||
<para>This page covers the basics for working with your OpenStack
|
||||
cloud through the Compute API and Image API after authorizing with
|
||||
the Identity Service API. You can then build a cloud by launching
|
||||
images and assigning metadata to instances, all through an
|
||||
API. Refer to the <link
|
||||
xlink:href="http://docs.openstack.org/api/quick-start/content/">API Quick Start
|
||||
Guide</link> for details about using the APIs referenced here, and
|
||||
go to <link
|
||||
xlink:href="http://docs.openstack.org/api/">docs.openstack.org/api</link>
|
||||
for specifications of each API.
|
||||
</para>
|
||||
</preface>
|
||||
<chapter xml:id="identity">
|
||||
<title>Identity</title>
|
||||
<para>With the Identity API, you obtain a token that lasts 24 hours so you can gain access to the Compute API. The version of the Identity API is 2.0.</para>
|
||||
<wadl:resources
|
||||
href="identity.wadl"
|
||||
xmlns:wadl="http://wadl.dev.java.net/2009/02"/>
|
||||
</chapter>
|
||||
<chapter xml:id="compute">
|
||||
<title>Compute</title>
|
||||
<para>With the Compute API, you launch virtual machines based on
|
||||
the images uploaded to the system. You can reboot the server
|
||||
when needed, resize it larger or smaller, and connect to the
|
||||
server securely through SSH once it is started. The v1.1 API is
|
||||
identical to the v2 API.</para>
|
||||
<wadl:resources
|
||||
href="os-compute-1.1.wadl"
|
||||
xmlns:wadl="http://wadl.dev.java.net/2009/02"/>
|
||||
</chapter>
|
||||
<chapter xml:id="files">
|
||||
<title>Image</title>
|
||||
<para>With the Image API, you load images for use at launch time
|
||||
by the Compute API. Some cloud implementations do not expose
|
||||
this API and offer pre-tested images only. You can also assign
|
||||
metadata to images with this API. </para>
|
||||
<wadl:resources
|
||||
href="os-image-1.0.wadl"
|
||||
xmlns:wadl="http://wadl.dev.java.net/2009/02"/>
|
||||
</chapter>
|
||||
</book>
|
|
@ -0,0 +1,126 @@
|
|||
|
||||
<!--
|
||||
A collection of common faults, these are pretty much expected
|
||||
in every request.
|
||||
-->
|
||||
<!ENTITY commonFaults
|
||||
'
|
||||
<response xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:computeFault"/>
|
||||
<representation mediaType="application/json"/>
|
||||
</response>
|
||||
<response status="503" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:serviceUnavailable"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="401" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:unauthorized"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="403" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:forbidden"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="400" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:badRequest"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="405" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:badMethod"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
<response status="413" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:overLimit"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
<!--
|
||||
Faults on GET
|
||||
-->
|
||||
<!ENTITY getFaults
|
||||
'
|
||||
<response status="404" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:itemNotFound"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
<!--
|
||||
Faults on POST/PUT
|
||||
-->
|
||||
<!ENTITY postPutFaults
|
||||
'
|
||||
<response status="415" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:badMediaType"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
<!--
|
||||
Faults that can occur when we are building servers or images.
|
||||
-->
|
||||
<!ENTITY buildFaults
|
||||
'
|
||||
<response status="503" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:serverCapacityUnavailable"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
<!--
|
||||
Holds build in progress which occurs when an operation fails
|
||||
because the server is in the process of being built.
|
||||
-->
|
||||
<!ENTITY inProgressFault
|
||||
'
|
||||
<response status="409" xmlns="http://wadl.dev.java.net/2009/02">
|
||||
<representation mediaType="application/xml" element="csapi:buildInProgress"/>
|
||||
<representation mediaType="applicaiton/json"/>
|
||||
</response>
|
||||
'>
|
||||
|
||||
<!-- Image List Parameters -->
|
||||
|
||||
<!ENTITY imageListParameters
|
||||
'
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="changes-since" style="query" required="false" type="xsd:dateTime"><doc><p xmlns="http://www.w3.org/1999/xhtml">A time/date stamp for when the image last changed status.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="server" style="query" required="false" type="xsd:anyURI"><doc><p xmlns="http://www.w3.org/1999/xhtml">Name of the server in URL format.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="name" style="query" required="false" type="xsd:string"><doc><p xmlns="http://www.w3.org/1999/xhtml">Name of the image as a string.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="status" style="query" required="false" type="csapi:ImageStatus"><doc><p xmlns="http://www.w3.org/1999/xhtml">Value of the status of the image so that you can filter on "ACTIVE" for example.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="marker" style="query" required="false" type="csapi:UUID"><doc><p xmlns="http://www.w3.org/1999/xhtml">UUID of the image at which you want to set a marker.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="limit" style="query" required="false" type="xsd:int"><doc><p xmlns="http://www.w3.org/1999/xhtml">Integer value for the limit of values to return.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="type" style="query" required="false" type="xsd:string" default="ALL"><doc><p xmlns="http://www.w3.org/1999/xhtml">Value of the type of image, such as BASE, SERVER, or ALL.</p></doc>
|
||||
<option value="BASE"/>
|
||||
<option value="SERVER"/>
|
||||
<option value="ALL"/>
|
||||
</param>
|
||||
'>
|
||||
|
||||
<!-- Server List Parameters -->
|
||||
|
||||
<!ENTITY serverListParameters
|
||||
'
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="changes-since" style="query" required="false" type="xsd:dateTime"><doc><p xmlns="http://www.w3.org/1999/xhtml">A time/date stamp for when the server last changed status.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="image" style="query" required="false" type="xsd:anyURI"><doc><p xmlns="http://www.w3.org/1999/xhtml">Name of the image in URL format.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="flavor" style="query" required="false" type="xsd:anyURI"><doc><p xmlns="http://www.w3.org/1999/xhtml">Name of the flavor in URL format.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="name" style="query" required="false" type="xsd:string"><doc><p xmlns="http://www.w3.org/1999/xhtml">Name of the server as a string.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="marker" style="query" required="false" type="csapi:UUID"><doc><p xmlns="http://www.w3.org/1999/xhtml">UUID of the server at which you want to set a marker.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="limit" style="query" required="false" type="xsd:int"><doc><p xmlns="http://www.w3.org/1999/xhtml">Integer value for the limit of values to return.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="status" style="query" required="false" type="csapi:ServerStatus"><doc><p xmlns="http://www.w3.org/1999/xhtml">Value of the status of the server so that you can filter on "ACTIVE" for example.</p></doc></param>
|
||||
'>
|
||||
|
||||
<!-- Flavor List Parameters -->
|
||||
|
||||
<!ENTITY flavorListParameters
|
||||
'
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="changes-since" style="query" required="false" type="xsd:dateTime"><doc><p xmlns="http://www.w3.org/1999/xhtml">A time/date stamp for when the flavor last changed.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="minDisk" style="query" required="false" type="xsd:int"><doc><p xmlns="http://www.w3.org/1999/xhtml">Integer value for the minimum disk space in GB so you can filter results.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="minRam" style="query" required="false" type="xsd:int"><doc><p xmlns="http://www.w3.org/1999/xhtml">Integer value for the minimum RAM so you can filter results.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="marker" style="query" required="false" type="csapi:UUID"><doc><p xmlns="http://www.w3.org/1999/xhtml">UUID of the flavor at which you want to set a marker.</p></doc></param>
|
||||
<param xmlns="http://wadl.dev.java.net/2009/02" name="limit" style="query" required="false" type="xsd:int"><doc><p xmlns="http://www.w3.org/1999/xhtml">Integer value for the limit of values to return.</p></doc></param>
|
||||
'>
|
||||
|
||||
<!-- Useful for describing APIs -->
|
||||
|
||||
<!ENTITY GET '<command xmlns="http://docbook.org/ns/docbook">GET</command>'>
|
||||
<!ENTITY PUT '<command xmlns="http://docbook.org/ns/docbook">PUT</command>'>
|
||||
<!ENTITY POST '<command xmlns="http://docbook.org/ns/docbook">POST</command>'>
|
||||
<!ENTITY DELETE '<command xmlns="http://docbook.org/ns/docbook">DELETE</command>'>
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 433 B |
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg:svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.0"
|
||||
width="13.895596"
|
||||
height="6.3500013"
|
||||
viewBox="0 0 13.895595 6.3500013"
|
||||
id="svg2868"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.48.0 r9654"
|
||||
sodipodi:docname="Arrow_east.svg"><svg:metadata
|
||||
id="metadata3857"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></svg:metadata><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1131"
|
||||
inkscape:window-height="740"
|
||||
id="namedview3855"
|
||||
showgrid="false"
|
||||
inkscape:zoom="11.313708"
|
||||
inkscape:cx="8.6182271"
|
||||
inkscape:cy="-2.2709277"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg2868"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" /><svg:defs
|
||||
id="defs2874" />
|
||||
|
||||
|
||||
<namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
pageopacity="0.0"
|
||||
pageshadow="2"
|
||||
window-width="640"
|
||||
window-height="541"
|
||||
zoom="0.34493828"
|
||||
cx="372.04722"
|
||||
cy="256.66814"
|
||||
window-x="75"
|
||||
window-y="152"
|
||||
current-layer="svg2033">
|
||||
</namedview>
|
||||
<svg:g
|
||||
transform="matrix(-0.01540104,0,0,-0.01741068,13.895596,6.3500014)"
|
||||
id="Ebene_1">
|
||||
<svg:polygon
|
||||
points="902.25049,222.98633 233.17773,222.98633 233.17773,364.71875 0,182.35938 233.17773,0 233.17773,141.73242 902.25049,141.73242 902.25049,222.98633 "
|
||||
id="path2050" />
|
||||
</svg:g>
|
||||
</svg:svg>
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 651 B |
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="19.21315"
|
||||
height="18.294994"
|
||||
id="svg2"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.45"
|
||||
sodipodi:modified="true"
|
||||
version="1.0">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
gridtolerance="10000"
|
||||
guidetolerance="10"
|
||||
objecttolerance="10"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.9195959"
|
||||
inkscape:cx="17.757032"
|
||||
inkscape:cy="7.298821"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:window-width="984"
|
||||
inkscape:window-height="852"
|
||||
inkscape:window-x="148"
|
||||
inkscape:window-y="66" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-192.905,-516.02064)">
|
||||
<path
|
||||
style="fill:#000000"
|
||||
d="M 197.67968,534.31563 C 197.40468,534.31208 196.21788,532.53719 195.04234,530.37143 L 192.905,526.43368 L 193.45901,525.87968 C 193.76371,525.57497 194.58269,525.32567 195.27896,525.32567 L 196.5449,525.32567 L 197.18129,527.33076 L 197.81768,529.33584 L 202.88215,523.79451 C 205.66761,520.74678 208.88522,517.75085 210.03239,517.13691 L 212.11815,516.02064 L 207.90871,520.80282 C 205.59351,523.43302 202.45735,527.55085 200.93947,529.95355 C 199.42159,532.35625 197.95468,534.31919 197.67968,534.31563 z "
|
||||
id="path2223" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
|
@ -0,0 +1,337 @@
|
|||
if (! this.sh_languages) {
|
||||
this.sh_languages = {};
|
||||
}
|
||||
sh_languages['java'] = [
|
||||
[
|
||||
[
|
||||
/\b(?:import|package)\b/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\/\/\//g,
|
||||
'sh_comment',
|
||||
1
|
||||
],
|
||||
[
|
||||
/\/\//g,
|
||||
'sh_comment',
|
||||
7
|
||||
],
|
||||
[
|
||||
/\/\*\*/g,
|
||||
'sh_comment',
|
||||
8
|
||||
],
|
||||
[
|
||||
/\/\*/g,
|
||||
'sh_comment',
|
||||
9
|
||||
],
|
||||
[
|
||||
/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,
|
||||
'sh_number',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
10
|
||||
],
|
||||
[
|
||||
/'/g,
|
||||
'sh_string',
|
||||
11
|
||||
],
|
||||
[
|
||||
/(\b(?:class|interface))([ \t]+)([$A-Za-z0-9_]+)/g,
|
||||
['sh_keyword', 'sh_normal', 'sh_classname'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b(?:abstract|assert|break|case|catch|class|const|continue|default|do|else|extends|false|final|finally|for|goto|if|implements|instanceof|interface|native|new|null|private|protected|public|return|static|strictfp|super|switch|synchronized|throw|throws|true|this|transient|try|volatile|while)\b/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b(?:int|byte|boolean|char|long|float|double|short|void)\b/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,
|
||||
'sh_symbol',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\{|\}/g,
|
||||
'sh_cbracket',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,
|
||||
'sh_function',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,
|
||||
['sh_usertype', 'sh_usertype', 'sh_normal'],
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/$/g,
|
||||
null,
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
2,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
4,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/@[A-Za-z]+/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\?>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\\(?:\\|")/g,
|
||||
null,
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/-->/g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/$/g,
|
||||
null,
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\*\//g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
2,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
4,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/@[A-Za-z]+/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\*\//g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/\\./g,
|
||||
'sh_specialchar',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/'/g,
|
||||
'sh_string',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/\\./g,
|
||||
'sh_specialchar',
|
||||
-1
|
||||
]
|
||||
]
|
||||
];
|
|
@ -0,0 +1,347 @@
|
|||
if (! this.sh_languages) {
|
||||
this.sh_languages = {};
|
||||
}
|
||||
sh_languages['javascript'] = [
|
||||
[
|
||||
[
|
||||
/\/\/\//g,
|
||||
'sh_comment',
|
||||
1
|
||||
],
|
||||
[
|
||||
/\/\//g,
|
||||
'sh_comment',
|
||||
7
|
||||
],
|
||||
[
|
||||
/\/\*\*/g,
|
||||
'sh_comment',
|
||||
8
|
||||
],
|
||||
[
|
||||
/\/\*/g,
|
||||
'sh_comment',
|
||||
9
|
||||
],
|
||||
[
|
||||
/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,
|
||||
['sh_symbol', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,
|
||||
['sh_number', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,
|
||||
['sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,
|
||||
'sh_regexp',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,
|
||||
'sh_number',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
10
|
||||
],
|
||||
[
|
||||
/'/g,
|
||||
'sh_string',
|
||||
11
|
||||
],
|
||||
[
|
||||
/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,
|
||||
'sh_symbol',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\{|\}/g,
|
||||
'sh_cbracket',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,
|
||||
'sh_predef_var',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,
|
||||
'sh_predef_func',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,
|
||||
'sh_function',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/$/g,
|
||||
null,
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
2,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
4,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/@[A-Za-z]+/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\?>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\\(?:\\|")/g,
|
||||
null,
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/-->/g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
3
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/$/g,
|
||||
null,
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\*\//g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
2,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
4,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
5
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,
|
||||
'sh_keyword',
|
||||
6,
|
||||
1
|
||||
],
|
||||
[
|
||||
/@[A-Za-z]+/g,
|
||||
'sh_type',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\*\//g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,
|
||||
'sh_url',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/(?:TODO|FIXME|BUG)(?:[:]?)/g,
|
||||
'sh_todo',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/\\./g,
|
||||
'sh_specialchar',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/'/g,
|
||||
'sh_string',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/\\./g,
|
||||
'sh_specialchar',
|
||||
-1
|
||||
]
|
||||
]
|
||||
];
|
|
@ -0,0 +1,538 @@
|
|||
/*
|
||||
SHJS - Syntax Highlighting in JavaScript
|
||||
Copyright (C) 2007, 2008 gnombat@users.sourceforge.net
|
||||
License: http://shjs.sourceforge.net/doc/gplv3.html
|
||||
*/
|
||||
|
||||
if (! this.sh_languages) {
|
||||
this.sh_languages = {};
|
||||
}
|
||||
var sh_requests = {};
|
||||
|
||||
function sh_isEmailAddress(url) {
|
||||
if (/^mailto:/.test(url)) {
|
||||
return false;
|
||||
}
|
||||
return url.indexOf('@') !== -1;
|
||||
}
|
||||
|
||||
function sh_setHref(tags, numTags, inputString) {
|
||||
var url = inputString.substring(tags[numTags - 2].pos, tags[numTags - 1].pos);
|
||||
if (url.length >= 2 && url.charAt(0) === '<' && url.charAt(url.length - 1) === '>') {
|
||||
url = url.substr(1, url.length - 2);
|
||||
}
|
||||
if (sh_isEmailAddress(url)) {
|
||||
url = 'mailto:' + url;
|
||||
}
|
||||
tags[numTags - 2].node.href = url;
|
||||
}
|
||||
|
||||
/*
|
||||
Konqueror has a bug where the regular expression /$/g will not match at the end
|
||||
of a line more than once:
|
||||
|
||||
var regex = /$/g;
|
||||
var match;
|
||||
|
||||
var line = '1234567890';
|
||||
regex.lastIndex = 10;
|
||||
match = regex.exec(line);
|
||||
|
||||
var line2 = 'abcde';
|
||||
regex.lastIndex = 5;
|
||||
match = regex.exec(line2); // fails
|
||||
*/
|
||||
function sh_konquerorExec(s) {
|
||||
var result = [''];
|
||||
result.index = s.length;
|
||||
result.input = s;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
Highlights all elements containing source code in a text string. The return
|
||||
value is an array of objects, each representing an HTML start or end tag. Each
|
||||
object has a property named pos, which is an integer representing the text
|
||||
offset of the tag. Every start tag also has a property named node, which is the
|
||||
DOM element started by the tag. End tags do not have this property.
|
||||
@param inputString a text string
|
||||
@param language a language definition object
|
||||
@return an array of tag objects
|
||||
*/
|
||||
function sh_highlightString(inputString, language) {
|
||||
if (/Konqueror/.test(navigator.userAgent)) {
|
||||
if (! language.konquered) {
|
||||
for (var s = 0; s < language.length; s++) {
|
||||
for (var p = 0; p < language[s].length; p++) {
|
||||
var r = language[s][p][0];
|
||||
if (r.source === '$') {
|
||||
r.exec = sh_konquerorExec;
|
||||
}
|
||||
}
|
||||
}
|
||||
language.konquered = true;
|
||||
}
|
||||
}
|
||||
|
||||
var a = document.createElement('a');
|
||||
var span = document.createElement('span');
|
||||
|
||||
// the result
|
||||
var tags = [];
|
||||
var numTags = 0;
|
||||
|
||||
// each element is a pattern object from language
|
||||
var patternStack = [];
|
||||
|
||||
// the current position within inputString
|
||||
var pos = 0;
|
||||
|
||||
// the name of the current style, or null if there is no current style
|
||||
var currentStyle = null;
|
||||
|
||||
var output = function(s, style) {
|
||||
var length = s.length;
|
||||
// this is more than just an optimization - we don't want to output empty <span></span> elements
|
||||
if (length === 0) {
|
||||
return;
|
||||
}
|
||||
if (! style) {
|
||||
var stackLength = patternStack.length;
|
||||
if (stackLength !== 0) {
|
||||
var pattern = patternStack[stackLength - 1];
|
||||
// check whether this is a state or an environment
|
||||
if (! pattern[3]) {
|
||||
// it's not a state - it's an environment; use the style for this environment
|
||||
style = pattern[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (currentStyle !== style) {
|
||||
if (currentStyle) {
|
||||
tags[numTags++] = {pos: pos};
|
||||
if (currentStyle === 'sh_url') {
|
||||
sh_setHref(tags, numTags, inputString);
|
||||
}
|
||||
}
|
||||
if (style) {
|
||||
var clone;
|
||||
if (style === 'sh_url') {
|
||||
clone = a.cloneNode(false);
|
||||
}
|
||||
else {
|
||||
clone = span.cloneNode(false);
|
||||
}
|
||||
clone.className = style;
|
||||
tags[numTags++] = {node: clone, pos: pos};
|
||||
}
|
||||
}
|
||||
pos += length;
|
||||
currentStyle = style;
|
||||
};
|
||||
|
||||
var endOfLinePattern = /\r\n|\r|\n/g;
|
||||
endOfLinePattern.lastIndex = 0;
|
||||
var inputStringLength = inputString.length;
|
||||
while (pos < inputStringLength) {
|
||||
var start = pos;
|
||||
var end;
|
||||
var startOfNextLine;
|
||||
var endOfLineMatch = endOfLinePattern.exec(inputString);
|
||||
if (endOfLineMatch === null) {
|
||||
end = inputStringLength;
|
||||
startOfNextLine = inputStringLength;
|
||||
}
|
||||
else {
|
||||
end = endOfLineMatch.index;
|
||||
startOfNextLine = endOfLinePattern.lastIndex;
|
||||
}
|
||||
|
||||
var line = inputString.substring(start, end);
|
||||
|
||||
var matchCache = [];
|
||||
for (;;) {
|
||||
var posWithinLine = pos - start;
|
||||
|
||||
var stateIndex;
|
||||
var stackLength = patternStack.length;
|
||||
if (stackLength === 0) {
|
||||
stateIndex = 0;
|
||||
}
|
||||
else {
|
||||
// get the next state
|
||||
stateIndex = patternStack[stackLength - 1][2];
|
||||
}
|
||||
|
||||
var state = language[stateIndex];
|
||||
var numPatterns = state.length;
|
||||
var mc = matchCache[stateIndex];
|
||||
if (! mc) {
|
||||
mc = matchCache[stateIndex] = [];
|
||||
}
|
||||
var bestMatch = null;
|
||||
var bestPatternIndex = -1;
|
||||
for (var i = 0; i < numPatterns; i++) {
|
||||
var match;
|
||||
if (i < mc.length && (mc[i] === null || posWithinLine <= mc[i].index)) {
|
||||
match = mc[i];
|
||||
}
|
||||
else {
|
||||
var regex = state[i][0];
|
||||
regex.lastIndex = posWithinLine;
|
||||
match = regex.exec(line);
|
||||
mc[i] = match;
|
||||
}
|
||||
if (match !== null && (bestMatch === null || match.index < bestMatch.index)) {
|
||||
bestMatch = match;
|
||||
bestPatternIndex = i;
|
||||
if (match.index === posWithinLine) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bestMatch === null) {
|
||||
output(line.substring(posWithinLine), null);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
// got a match
|
||||
if (bestMatch.index > posWithinLine) {
|
||||
output(line.substring(posWithinLine, bestMatch.index), null);
|
||||
}
|
||||
|
||||
var pattern = state[bestPatternIndex];
|
||||
|
||||
var newStyle = pattern[1];
|
||||
var matchedString;
|
||||
if (newStyle instanceof Array) {
|
||||
for (var subexpression = 0; subexpression < newStyle.length; subexpression++) {
|
||||
matchedString = bestMatch[subexpression + 1];
|
||||
output(matchedString, newStyle[subexpression]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
matchedString = bestMatch[0];
|
||||
output(matchedString, newStyle);
|
||||
}
|
||||
|
||||
switch (pattern[2]) {
|
||||
case -1:
|
||||
// do nothing
|
||||
break;
|
||||
case -2:
|
||||
// exit
|
||||
patternStack.pop();
|
||||
break;
|
||||
case -3:
|
||||
// exitall
|
||||
patternStack.length = 0;
|
||||
break;
|
||||
default:
|
||||
// this was the start of a delimited pattern or a state/environment
|
||||
patternStack.push(pattern);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// end of the line
|
||||
if (currentStyle) {
|
||||
tags[numTags++] = {pos: pos};
|
||||
if (currentStyle === 'sh_url') {
|
||||
sh_setHref(tags, numTags, inputString);
|
||||
}
|
||||
currentStyle = null;
|
||||
}
|
||||
pos = startOfNextLine;
|
||||
}
|
||||
|
||||
return tags;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// DOM-dependent functions
|
||||
|
||||
function sh_getClasses(element) {
|
||||
var result = [];
|
||||
var htmlClass = element.className;
|
||||
if (htmlClass && htmlClass.length > 0) {
|
||||
var htmlClasses = htmlClass.split(' ');
|
||||
for (var i = 0; i < htmlClasses.length; i++) {
|
||||
if (htmlClasses[i].length > 0) {
|
||||
result.push(htmlClasses[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function sh_addClass(element, name) {
|
||||
var htmlClasses = sh_getClasses(element);
|
||||
for (var i = 0; i < htmlClasses.length; i++) {
|
||||
if (name.toLowerCase() === htmlClasses[i].toLowerCase()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
htmlClasses.push(name);
|
||||
element.className = htmlClasses.join(' ');
|
||||
}
|
||||
|
||||
/**
|
||||
Extracts the tags from an HTML DOM NodeList.
|
||||
@param nodeList a DOM NodeList
|
||||
@param result an object with text, tags and pos properties
|
||||
*/
|
||||
function sh_extractTagsFromNodeList(nodeList, result) {
|
||||
var length = nodeList.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
var node = nodeList.item(i);
|
||||
switch (node.nodeType) {
|
||||
case 1:
|
||||
if (node.nodeName.toLowerCase() === 'br') {
|
||||
var terminator;
|
||||
if (/MSIE/.test(navigator.userAgent)) {
|
||||
terminator = '\r';
|
||||
}
|
||||
else {
|
||||
terminator = '\n';
|
||||
}
|
||||
result.text.push(terminator);
|
||||
result.pos++;
|
||||
}
|
||||
else {
|
||||
result.tags.push({node: node.cloneNode(false), pos: result.pos});
|
||||
sh_extractTagsFromNodeList(node.childNodes, result);
|
||||
result.tags.push({pos: result.pos});
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
result.text.push(node.data);
|
||||
result.pos += node.length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Extracts the tags from the text of an HTML element. The extracted tags will be
|
||||
returned as an array of tag objects. See sh_highlightString for the format of
|
||||
the tag objects.
|
||||
@param element a DOM element
|
||||
@param tags an empty array; the extracted tag objects will be returned in it
|
||||
@return the text of the element
|
||||
@see sh_highlightString
|
||||
*/
|
||||
function sh_extractTags(element, tags) {
|
||||
var result = {};
|
||||
result.text = [];
|
||||
result.tags = tags;
|
||||
result.pos = 0;
|
||||
sh_extractTagsFromNodeList(element.childNodes, result);
|
||||
return result.text.join('');
|
||||
}
|
||||
|
||||
/**
|
||||
Merges the original tags from an element with the tags produced by highlighting.
|
||||
@param originalTags an array containing the original tags
|
||||
@param highlightTags an array containing the highlighting tags - these must not overlap
|
||||
@result an array containing the merged tags
|
||||
*/
|
||||
function sh_mergeTags(originalTags, highlightTags) {
|
||||
var numOriginalTags = originalTags.length;
|
||||
if (numOriginalTags === 0) {
|
||||
return highlightTags;
|
||||
}
|
||||
|
||||
var numHighlightTags = highlightTags.length;
|
||||
if (numHighlightTags === 0) {
|
||||
return originalTags;
|
||||
}
|
||||
|
||||
var result = [];
|
||||
var originalIndex = 0;
|
||||
var highlightIndex = 0;
|
||||
|
||||
while (originalIndex < numOriginalTags && highlightIndex < numHighlightTags) {
|
||||
var originalTag = originalTags[originalIndex];
|
||||
var highlightTag = highlightTags[highlightIndex];
|
||||
|
||||
if (originalTag.pos <= highlightTag.pos) {
|
||||
result.push(originalTag);
|
||||
originalIndex++;
|
||||
}
|
||||
else {
|
||||
result.push(highlightTag);
|
||||
if (highlightTags[highlightIndex + 1].pos <= originalTag.pos) {
|
||||
highlightIndex++;
|
||||
result.push(highlightTags[highlightIndex]);
|
||||
highlightIndex++;
|
||||
}
|
||||
else {
|
||||
// new end tag
|
||||
result.push({pos: originalTag.pos});
|
||||
|
||||
// new start tag
|
||||
highlightTags[highlightIndex] = {node: highlightTag.node.cloneNode(false), pos: originalTag.pos};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (originalIndex < numOriginalTags) {
|
||||
result.push(originalTags[originalIndex]);
|
||||
originalIndex++;
|
||||
}
|
||||
|
||||
while (highlightIndex < numHighlightTags) {
|
||||
result.push(highlightTags[highlightIndex]);
|
||||
highlightIndex++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
Inserts tags into text.
|
||||
@param tags an array of tag objects
|
||||
@param text a string representing the text
|
||||
@return a DOM DocumentFragment representing the resulting HTML
|
||||
*/
|
||||
function sh_insertTags(tags, text) {
|
||||
var doc = document;
|
||||
|
||||
var result = document.createDocumentFragment();
|
||||
var tagIndex = 0;
|
||||
var numTags = tags.length;
|
||||
var textPos = 0;
|
||||
var textLength = text.length;
|
||||
var currentNode = result;
|
||||
|
||||
// output one tag or text node every iteration
|
||||
while (textPos < textLength || tagIndex < numTags) {
|
||||
var tag;
|
||||
var tagPos;
|
||||
if (tagIndex < numTags) {
|
||||
tag = tags[tagIndex];
|
||||
tagPos = tag.pos;
|
||||
}
|
||||
else {
|
||||
tagPos = textLength;
|
||||
}
|
||||
|
||||
if (tagPos <= textPos) {
|
||||
// output the tag
|
||||
if (tag.node) {
|
||||
// start tag
|
||||
var newNode = tag.node;
|
||||
currentNode.appendChild(newNode);
|
||||
currentNode = newNode;
|
||||
}
|
||||
else {
|
||||
// end tag
|
||||
currentNode = currentNode.parentNode;
|
||||
}
|
||||
tagIndex++;
|
||||
}
|
||||
else {
|
||||
// output text
|
||||
currentNode.appendChild(doc.createTextNode(text.substring(textPos, tagPos)));
|
||||
textPos = tagPos;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
Highlights an element containing source code. Upon completion of this function,
|
||||
the element will have been placed in the "sh_sourceCode" class.
|
||||
@param element a DOM <pre> element containing the source code to be highlighted
|
||||
@param language a language definition object
|
||||
*/
|
||||
function sh_highlightElement(element, language) {
|
||||
sh_addClass(element, 'sh_sourceCode');
|
||||
var originalTags = [];
|
||||
var inputString = sh_extractTags(element, originalTags);
|
||||
var highlightTags = sh_highlightString(inputString, language);
|
||||
var tags = sh_mergeTags(originalTags, highlightTags);
|
||||
var documentFragment = sh_insertTags(tags, inputString);
|
||||
while (element.hasChildNodes()) {
|
||||
element.removeChild(element.firstChild);
|
||||
}
|
||||
element.appendChild(documentFragment);
|
||||
}
|
||||
|
||||
function sh_getXMLHttpRequest() {
|
||||
if (window.ActiveXObject) {
|
||||
return new ActiveXObject('Msxml2.XMLHTTP');
|
||||
}
|
||||
else if (window.XMLHttpRequest) {
|
||||
return new XMLHttpRequest();
|
||||
}
|
||||
throw 'No XMLHttpRequest implementation available';
|
||||
}
|
||||
|
||||
function sh_load(language, element, prefix, suffix) {
|
||||
if (language in sh_requests) {
|
||||
sh_requests[language].push(element);
|
||||
return;
|
||||
}
|
||||
sh_requests[language] = [element];
|
||||
var request = sh_getXMLHttpRequest();
|
||||
var url = prefix + 'sh_' + language + suffix;
|
||||
request.open('GET', url, true);
|
||||
request.onreadystatechange = function () {
|
||||
if (request.readyState === 4) {
|
||||
try {
|
||||
if (! request.status || request.status === 200) {
|
||||
eval(request.responseText);
|
||||
var elements = sh_requests[language];
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
sh_highlightElement(elements[i], sh_languages[language]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw 'HTTP error: status ' + request.status;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
request = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
request.send(null);
|
||||
}
|
||||
|
||||
/**
|
||||
Highlights all elements containing source code on the current page. Elements
|
||||
containing source code must be "pre" elements with a "class" attribute of
|
||||
"sh_LANGUAGE", where LANGUAGE is a valid language identifier; e.g., "sh_java"
|
||||
identifies the element as containing "java" language source code.
|
||||
*/
|
||||
function sh_highlightDocument(prefix, suffix) {
|
||||
var nodeList = document.getElementsByTagName('pre');
|
||||
for (var i = 0; i < nodeList.length; i++) {
|
||||
var element = nodeList.item(i);
|
||||
var htmlClasses = sh_getClasses(element);
|
||||
for (var j = 0; j < htmlClasses.length; j++) {
|
||||
var htmlClass = htmlClasses[j].toLowerCase();
|
||||
if (htmlClass === 'sh_sourcecode') {
|
||||
continue;
|
||||
}
|
||||
if (htmlClass.substr(0, 3) === 'sh_') {
|
||||
var language = htmlClass.substring(3);
|
||||
if (language in sh_languages) {
|
||||
sh_highlightElement(element, sh_languages[language]);
|
||||
}
|
||||
else if (typeof(prefix) === 'string' && typeof(suffix) === 'string') {
|
||||
sh_load(language, element, prefix, suffix);
|
||||
}
|
||||
else {
|
||||
throw 'Found <pre> element with class="' + htmlClass + '", but no such language exists';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
if (! this.sh_languages) {
|
||||
this.sh_languages = {};
|
||||
}
|
||||
sh_languages['xml'] = [
|
||||
[
|
||||
[
|
||||
/<\?xml/g,
|
||||
'sh_preproc',
|
||||
1,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!DOCTYPE/g,
|
||||
'sh_preproc',
|
||||
3,
|
||||
1
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
4
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-1
|
||||
],
|
||||
[
|
||||
/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,
|
||||
'sh_keyword',
|
||||
5,
|
||||
1
|
||||
],
|
||||
[
|
||||
/&(?:[A-Za-z0-9]+);/g,
|
||||
'sh_preproc',
|
||||
-1
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\?>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/\\(?:\\|")/g,
|
||||
null,
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
-2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/>/g,
|
||||
'sh_preproc',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
2
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/-->/g,
|
||||
'sh_comment',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/<!--/g,
|
||||
'sh_comment',
|
||||
4
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
/(?:\/)?>/g,
|
||||
'sh_keyword',
|
||||
-2
|
||||
],
|
||||
[
|
||||
/([^=" \t>]+)([ \t]*)(=?)/g,
|
||||
['sh_type', 'sh_normal', 'sh_symbol'],
|
||||
-1
|
||||
],
|
||||
[
|
||||
/"/g,
|
||||
'sh_string',
|
||||
2
|
||||
]
|
||||
]
|
||||
];
|
|
@ -0,0 +1,184 @@
|
|||
/**
|
||||
controller.js
|
||||
|
||||
(C) 2009 Rackspace Hosting, All Rights Reserved
|
||||
|
||||
This file definas a single object in global scope:
|
||||
|
||||
trc.schema.controller
|
||||
|
||||
The controller object is responsible for displaying a menu that
|
||||
allows users to view schema source and jump to various definitions
|
||||
in the schema.
|
||||
**/
|
||||
|
||||
|
||||
//
|
||||
// Initialization code...
|
||||
//
|
||||
(function()
|
||||
{
|
||||
//
|
||||
// Make sure dependecies are defined in the global scope, throw
|
||||
// an error if they are not.
|
||||
//
|
||||
if ((!window.trc) ||
|
||||
(!trc.util))
|
||||
{
|
||||
throw new Error("Require trc/util.js to be loaded.");
|
||||
}
|
||||
|
||||
//
|
||||
// We use YUI to build our controller menu make sure we have the
|
||||
// proper dependecies loaded, call init when we do...
|
||||
//
|
||||
|
||||
function InitController()
|
||||
{
|
||||
trc.schema.controller._init();
|
||||
}
|
||||
|
||||
trc.util.yui.loadYUIDeps (["menu"], InitController);
|
||||
})();
|
||||
|
||||
|
||||
if (!trc.schema)
|
||||
{
|
||||
trc.schema = new Object();
|
||||
}
|
||||
|
||||
trc.schema.controller = {
|
||||
//
|
||||
// Internal and external links by type:
|
||||
//
|
||||
// type --> array of links
|
||||
//
|
||||
// possible types include: import, include, element,
|
||||
// attribute, complextype, simpleType
|
||||
//
|
||||
// each link contains the following properties:
|
||||
// name : the name of the link
|
||||
// href : the link itself
|
||||
// title : a description of the link
|
||||
links : new Object(),
|
||||
|
||||
//
|
||||
// A single link that points to the schema index document.
|
||||
//
|
||||
index : null,
|
||||
|
||||
//
|
||||
// Our initialization function
|
||||
//
|
||||
_init : function() {
|
||||
//
|
||||
// Load the menu...
|
||||
//
|
||||
var controllerDiv = document.getElementById("Controller");
|
||||
var mainMenu = this._menuMarkup("mainmenu");
|
||||
|
||||
for (var linkType in this.links)
|
||||
{
|
||||
var subItem = this._menuItemMarkup(mainMenu, linkType, "#", null);
|
||||
var subMenu = this._menuMarkup (linkType+"_subMenu");
|
||||
|
||||
var items = this.links[linkType];
|
||||
for (var i=0;i<items.length;i++)
|
||||
{
|
||||
this._menuItemMarkup (subMenu,
|
||||
items[i].name,
|
||||
items[i].href,
|
||||
items[i].title);
|
||||
}
|
||||
subItem.item.appendChild (subMenu.main);
|
||||
}
|
||||
|
||||
//
|
||||
// Toggle view source menu
|
||||
//
|
||||
this._menuItemMarkup (mainMenu, "toggle src view",
|
||||
"javascript:trc.schema.sampleManager.toggleSrcView()", null);
|
||||
|
||||
//
|
||||
// Index schema document
|
||||
//
|
||||
if (this.index != null)
|
||||
{
|
||||
this._menuItemMarkup (mainMenu, this.index.name,
|
||||
this.index.href, this.index.title);
|
||||
}
|
||||
|
||||
controllerDiv.appendChild (mainMenu.main);
|
||||
var oMenu = new YAHOO.widget.Menu("mainmenu", {position: "static"});
|
||||
oMenu.render();
|
||||
oMenu.show();
|
||||
},
|
||||
|
||||
//
|
||||
// Builds menu markup returns the associated divs in the
|
||||
// properties main, body, header, footer, and list
|
||||
//
|
||||
_menuMarkup : function(id /*Id for main part*/)
|
||||
{
|
||||
//
|
||||
// Build our menu div...
|
||||
//
|
||||
var mainDiv = document.createElement("div");
|
||||
var headerDiv = document.createElement("div");
|
||||
var bodyDiv = document.createElement("div");
|
||||
var footerDiv = document.createElement("div");
|
||||
var listDiv = document.createElement("ul");
|
||||
|
||||
mainDiv.setAttribute ("id", id);
|
||||
trc.util.dom.setClassName (mainDiv, "yuimenu");
|
||||
trc.util.dom.setClassName (headerDiv, "hd");
|
||||
trc.util.dom.setClassName (bodyDiv, "bd");
|
||||
trc.util.dom.setClassName (footerDiv, "ft");
|
||||
|
||||
mainDiv.appendChild (headerDiv);
|
||||
mainDiv.appendChild (bodyDiv);
|
||||
mainDiv.appendChild (footerDiv);
|
||||
bodyDiv.appendChild (listDiv);
|
||||
|
||||
return {
|
||||
main : mainDiv,
|
||||
body : bodyDiv,
|
||||
header : headerDiv,
|
||||
footer : footerDiv,
|
||||
list : listDiv
|
||||
};
|
||||
},
|
||||
|
||||
//
|
||||
// Adds a menu item to existing markup.
|
||||
//
|
||||
_menuItemMarkup : function (menu, /*Markup returned from _menuMarkup*/
|
||||
name, /* String, menu item name */
|
||||
href, /* String, menu item href */
|
||||
title /* String, title (tool tip)*/
|
||||
)
|
||||
{
|
||||
var listItem = document.createElement ("li");
|
||||
var link = document.createElement ("a");
|
||||
|
||||
trc.util.dom.setClassName (listItem, "yuimenuitem");
|
||||
trc.util.dom.setClassName (link, "yuimenuitemlabel");
|
||||
|
||||
link.setAttribute ("href", href);
|
||||
|
||||
if (title != null)
|
||||
{
|
||||
link.setAttribute ("title", title);
|
||||
}
|
||||
|
||||
link.appendChild (document.createTextNode(name));
|
||||
|
||||
listItem.appendChild (link);
|
||||
menu.list.appendChild(listItem);
|
||||
|
||||
return {
|
||||
item : listItem,
|
||||
anchor : link
|
||||
};
|
||||
}
|
||||
};
|
|
@ -0,0 +1,137 @@
|
|||
/**
|
||||
layoutManager.js
|
||||
|
||||
(C) 2009 Rackspace Hosting, All Rights Reserved
|
||||
|
||||
This file contains code that adjusts the layout of a schema
|
||||
document after a dom has been loaded. It does not modify the
|
||||
global scope.
|
||||
**/
|
||||
|
||||
(function()
|
||||
{
|
||||
//
|
||||
// Make sure dependecies are defined in the global scope, throw
|
||||
// an error if they are not.
|
||||
//
|
||||
if ((!window.trc) ||
|
||||
(!trc.util))
|
||||
{
|
||||
throw new Error("Require trc/util.js to be loaded.");
|
||||
}
|
||||
|
||||
//
|
||||
// This function should be called when the DOM is loaded so we
|
||||
// can get to work adjusting things.
|
||||
//
|
||||
function InitLayoutManager()
|
||||
{
|
||||
layoutManager._init();
|
||||
}
|
||||
trc.util.browser.addInitFunction (InitLayoutManager);
|
||||
|
||||
var layoutManager={
|
||||
//
|
||||
// Initialization function...
|
||||
//
|
||||
_init : function()
|
||||
{
|
||||
this._adjustMain();
|
||||
this._adjustSubElements();
|
||||
},
|
||||
|
||||
//
|
||||
// Applies appropriate styles to body and other main content
|
||||
// tags.
|
||||
//
|
||||
_adjustMain : function()
|
||||
{
|
||||
//
|
||||
// Change the class name for the correct YUI skin name.
|
||||
//
|
||||
var bodyTags = document.getElementsByTagName("body");
|
||||
if (bodyTags.length == 0)
|
||||
{
|
||||
throw new Error ("Couldn't find body element, bad DOM?");
|
||||
}
|
||||
else
|
||||
{
|
||||
trc.util.dom.setClassName(bodyTags[0], "yui-skin-sam");
|
||||
}
|
||||
|
||||
//
|
||||
// Setout the layout...
|
||||
//
|
||||
var docDiv = document.getElementById("doc");
|
||||
var mainDiv = document.getElementById("Main");
|
||||
|
||||
trc.util.dom.setClassName (docDiv, "yui-t1");
|
||||
docDiv.setAttribute ("id", "doc3");
|
||||
mainDiv.setAttribute ("id", "yui-main");
|
||||
|
||||
//
|
||||
// Old IE browser hacks...
|
||||
//
|
||||
switch (trc.util.browser.detectIEVersion())
|
||||
{
|
||||
//
|
||||
// IE 6 does not support fixed positioning. The
|
||||
// following is a little hack to get it to work.
|
||||
//
|
||||
//
|
||||
case 6:
|
||||
var controllerDiv = document.getElementById("Controller");
|
||||
controllerDiv.style.position="absolute";
|
||||
window.setInterval((function(){
|
||||
/* avoid leak by constantly querying for the
|
||||
* controller. */
|
||||
var ctrlDiv = document.getElementById("Controller");
|
||||
ctrlDiv.style.top = document.documentElement.scrollTop+10;
|
||||
}), 1000);
|
||||
break;
|
||||
|
||||
//
|
||||
// The controler doesn't work **at all** in IE 7
|
||||
// don't even show it.
|
||||
//
|
||||
case 7:
|
||||
var controllerDiv = document.getElementById("Controller");
|
||||
controllerDiv.style.display = "none";
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Adds appropriate classes for subElements...
|
||||
//
|
||||
_adjustSubElements : function()
|
||||
{
|
||||
var divs = document.getElementsByTagName("div");
|
||||
for (var i=0;i<divs.length;i++)
|
||||
{
|
||||
var currentClass = divs[i].getAttribute ("class");
|
||||
var newClassName = currentClass;
|
||||
switch (currentClass)
|
||||
{
|
||||
case "SubItem" :
|
||||
newClassName += " yui-gd";
|
||||
break;
|
||||
case "SubItemProps" :
|
||||
newClassName += " yui-gd first";
|
||||
break;
|
||||
case "SubName" :
|
||||
newClassName += " yui-u first";
|
||||
break;
|
||||
case "SubAttributes" :
|
||||
case "SubDocumentation" :
|
||||
newClassName += " yui-u";
|
||||
break;
|
||||
}
|
||||
if (currentClass != newClassName)
|
||||
{
|
||||
trc.util.dom.setClassName (divs[i], newClassName);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
|
@ -0,0 +1,342 @@
|
|||
/**
|
||||
schemaManager.js:
|
||||
|
||||
(C) 2009 Rackspace Hosting, All Rights Reserved
|
||||
|
||||
This file defines a single object in global scope:
|
||||
|
||||
trc.schema.sampleManager
|
||||
|
||||
The object is responsible for loading, formatting, and displaying
|
||||
samples in schema files. It expects trc.util to be defined which is
|
||||
provided in trc/util.js.
|
||||
|
||||
Code highlighting is provided by SHJS
|
||||
(http://shjs.sourceforge.net/). It should also be loaded before
|
||||
this code is initialized.
|
||||
|
||||
All methods/properties prepended with an underscore (_) are meant
|
||||
for internal use.
|
||||
**/
|
||||
|
||||
//
|
||||
// Initialization code...
|
||||
//
|
||||
(function()
|
||||
{
|
||||
//
|
||||
// Make sure dependecies are defined in the global scope, throw
|
||||
// an error if they are not.
|
||||
//
|
||||
if ((!window.trc) ||
|
||||
(!trc.util))
|
||||
{
|
||||
throw new Error("Require trc/util.js to be loaded.");
|
||||
}
|
||||
|
||||
//
|
||||
// Make sure syntax highlighter scripts are loaded, if not then
|
||||
// load them.
|
||||
//
|
||||
if (!window.sh_highlightDocument)
|
||||
{
|
||||
trc.util.dom.addStyle ("../style/shjs/sh_darkblue.css");
|
||||
|
||||
trc.util.dom.addScript ("../js/shjs/sh_main.js");
|
||||
trc.util.dom.addScript ("../js/shjs/sh_xml.js");
|
||||
trc.util.dom.addScript ("../js/shjs/sh_javascript.js");
|
||||
trc.util.dom.addScript ("../js/shjs/sh_java.js");
|
||||
}
|
||||
|
||||
function InitSchemaSampleManager()
|
||||
{
|
||||
trc.schema.sampleManager._init();
|
||||
}
|
||||
|
||||
trc.util.browser.addInitFunction(InitSchemaSampleManager);
|
||||
})();
|
||||
|
||||
//
|
||||
// Define trc.schema.sampleManager...
|
||||
//
|
||||
if (!trc.schema)
|
||||
{
|
||||
trc.schema = new Object();
|
||||
}
|
||||
trc.schema.sampleManager = {
|
||||
//
|
||||
// All sample data in an associative array:
|
||||
//
|
||||
// Select Element ID -> Array of sample ids.
|
||||
//
|
||||
samples : new Object(),
|
||||
|
||||
//
|
||||
// An array of code data..
|
||||
//
|
||||
// Code data is defined as an object with the following
|
||||
// properties:
|
||||
//
|
||||
// type: The mimetype of the code...href: The location of the code
|
||||
// or null if it's inline
|
||||
//
|
||||
// id: The id of the pre that contains the code.
|
||||
//
|
||||
// The initial object is the source code for the current document.
|
||||
//
|
||||
codes : new Array({
|
||||
id : "SrcContentCode",
|
||||
type : "application/xml",
|
||||
href : (function() {
|
||||
var ret = location.href;
|
||||
if (location.hash && (location.hash.length != 0))
|
||||
{
|
||||
ret = ret.replace (location.hash, "");
|
||||
}
|
||||
return ret;
|
||||
})()
|
||||
}),
|
||||
|
||||
//
|
||||
// Sets up the manager, begins the loading process...
|
||||
//
|
||||
_init : function() {
|
||||
//
|
||||
// Setup an array to hold data items to load, this is used by
|
||||
// the loadSample method.
|
||||
//
|
||||
this._toLoad = new Array();
|
||||
|
||||
for (var i=0;i<this.codes.length;i++)
|
||||
{
|
||||
if ((this.codes[i] != null) &&
|
||||
(this.codes[i].href != null))
|
||||
{
|
||||
this._toLoad.push (this.codes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Loads the code text
|
||||
//
|
||||
this._loadCode();
|
||||
},
|
||||
|
||||
//
|
||||
// Loads the next sample in the toLoad array.
|
||||
//
|
||||
_loadCode : function() {
|
||||
if (this._toLoad.length == 0)
|
||||
{
|
||||
//
|
||||
// All samples have been loaded, fire the loadComplete
|
||||
// method.
|
||||
//
|
||||
this._loadComplete();
|
||||
return;
|
||||
}
|
||||
|
||||
var codeData = this._toLoad.pop();
|
||||
var request = trc.util.net.getHTTPRequest();
|
||||
var manager = this;
|
||||
|
||||
request.onreadystatechange = function() {
|
||||
if (request.readyState == 4 /* Ready */) {
|
||||
if (request.status == 200 /* OKAY */) {
|
||||
manager._setCodeText (codeData, request.responseText);
|
||||
}
|
||||
else
|
||||
{
|
||||
manager._setCodeText (codeData, "Could not load sample ("+request.status+") "+request.responseText);
|
||||
}
|
||||
manager._loadCode();
|
||||
}
|
||||
};
|
||||
|
||||
request.open ("GET", codeData.href);
|
||||
request.send(null);
|
||||
},
|
||||
|
||||
//
|
||||
// Called after all samples are loaded into the DOM.
|
||||
//
|
||||
_loadComplete : function()
|
||||
{
|
||||
//
|
||||
// Normalize all code samples..
|
||||
//
|
||||
this._normalizeCodeText(1, 1, 5);
|
||||
|
||||
//
|
||||
// Perform syntax highlighting...
|
||||
//
|
||||
sh_highlightDocument();
|
||||
|
||||
//
|
||||
// All samples are initially hidden, show the selected
|
||||
// samples...
|
||||
//
|
||||
for (var optionID in this.samples)
|
||||
{
|
||||
this.showSample(optionID);
|
||||
}
|
||||
|
||||
//
|
||||
// We've adjusted the document, we need to setup the view so
|
||||
// that we're still pointing to the hash target.
|
||||
//
|
||||
if (window.location.hash &&
|
||||
(window.location.hash.length != 0))
|
||||
{
|
||||
window.location.href = window.location.hash;
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Sets code text replacing any text already existing there.
|
||||
//
|
||||
_setCodeText : function ( codeData /* Info of the code to set (code object) */,
|
||||
code /* Code text to set (string) */)
|
||||
{
|
||||
//
|
||||
// Preprocess the txt if nessesary...
|
||||
//
|
||||
var ieVersion = trc.util.browser.detectIEVersion();
|
||||
if ((ieVersion > -1) &&
|
||||
(ieVersion < 8))
|
||||
{
|
||||
code = trc.util.text.unix2dos (code);
|
||||
}
|
||||
|
||||
var pre = document.getElementById(codeData.id);
|
||||
var preNodes = pre.childNodes;
|
||||
//
|
||||
// Remove placeholder data...
|
||||
//
|
||||
while (preNodes.length != 0)
|
||||
{
|
||||
pre.removeChild (preNodes[0]);
|
||||
}
|
||||
|
||||
//
|
||||
// Set the correct class type...
|
||||
//
|
||||
switch (codeData.type)
|
||||
{
|
||||
/*
|
||||
Javascript mimetypes
|
||||
*/
|
||||
case 'application/json':
|
||||
case 'application/javascript':
|
||||
case 'application/x-javascript':
|
||||
case 'application/ecmascript':
|
||||
case 'text/ecmascript':
|
||||
case 'text/javascript':
|
||||
trc.util.dom.setClassName (pre, "sh_javascript");
|
||||
break;
|
||||
/*
|
||||
Not real mimetypes but this is what we'll use for Java.
|
||||
*/
|
||||
case 'application/java':
|
||||
case 'text/java':
|
||||
trc.util.dom.setClassName (pre, "sh_java");
|
||||
break;
|
||||
default:
|
||||
trc.util.dom.setClassName (pre, "sh_xml");
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Add new code...
|
||||
//
|
||||
pre.appendChild (document.createTextNode (code));
|
||||
},
|
||||
|
||||
//
|
||||
// Retrives source code text
|
||||
//
|
||||
_getCodeText : function (codeData /* Info for the code to get*/)
|
||||
{
|
||||
var pre = document.getElementById(codeData.id);
|
||||
pre.normalize();
|
||||
//
|
||||
// Should be a single text node after pre...
|
||||
//
|
||||
return pre.firstChild.nodeValue;
|
||||
},
|
||||
|
||||
|
||||
//
|
||||
// Normalizes text by ensuring that top, bottom, right indent
|
||||
// levels are equal for all samples.
|
||||
//
|
||||
_normalizeCodeText : function (top, /* integer, top indent in lines */
|
||||
bottom, /* integer, bottom indent in lines */
|
||||
right /* integer, right indent in spaces */
|
||||
)
|
||||
{
|
||||
for (var i=0;i<this.codes.length;i++)
|
||||
{
|
||||
if (this.codes[i] != null)
|
||||
{
|
||||
var code = this._getCodeText (this.codes[i]);
|
||||
code = trc.util.text.setIndent (code, top, bottom, right);
|
||||
this._setCodeText (this.codes[i], code);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// This event handler shows the appropriate sample given an ID
|
||||
// to the select element.
|
||||
//
|
||||
showSample : function (selectID) /* ID of the Select element */
|
||||
{
|
||||
//
|
||||
// Get the selected value
|
||||
//
|
||||
var selected = document.getElementById(selectID);
|
||||
var selectedValue = selected.options[selected.selectedIndex].value;
|
||||
var samples = this.samples[selectID];
|
||||
|
||||
//
|
||||
// Undisplay old samples, display selected ones.
|
||||
//
|
||||
for (var i=0;i<samples.length;i++)
|
||||
{
|
||||
if (samples[i] != null)
|
||||
{
|
||||
var sample = document.getElementById (samples[i]);
|
||||
if (samples[i] == selectedValue)
|
||||
{
|
||||
sample.style.display = "block";
|
||||
}
|
||||
else
|
||||
{
|
||||
sample.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Toggles the current source view. If the source is displayed it
|
||||
// undisplays it and vice versa.
|
||||
//
|
||||
toggleSrcView : function()
|
||||
{
|
||||
var content = document.getElementById ("Content");
|
||||
var src = document.getElementById ("SrcContent");
|
||||
|
||||
if (content.style.display != "none")
|
||||
{
|
||||
content.style.display = "none";
|
||||
src.style.display = "block";
|
||||
}
|
||||
else
|
||||
{
|
||||
content.style.display = "block";
|
||||
src.style.display = "none";
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,564 @@
|
|||
/**
|
||||
util.js:
|
||||
|
||||
(C) 2009 Rackspace Hosting, All Rights Reserved
|
||||
|
||||
This file defines a single object in global scope:
|
||||
|
||||
trc.util
|
||||
|
||||
The util object contains internal objects which contain useful
|
||||
utility properties and methods.
|
||||
|
||||
trc.util.browser: contains methods for browser detection.
|
||||
|
||||
trc.util.dom: contains methods for manipulating the DOM.
|
||||
|
||||
trc.util.text: contains methods and properties useful when working
|
||||
with plain text.
|
||||
|
||||
trc.util.net: contains methods for creating HTTP requests.
|
||||
|
||||
trc.util.yui : contains methods for working with the YUI toolkit.
|
||||
|
||||
All methods/properties prepended with an underscore (_) are meant
|
||||
for internal use.
|
||||
**/
|
||||
|
||||
//
|
||||
// Define TRC
|
||||
//
|
||||
if (!window.trc)
|
||||
{
|
||||
trc= new Object();
|
||||
}
|
||||
trc.util = new Object();
|
||||
trc.util.browser = {
|
||||
//
|
||||
// Returns the current version of IE, or -1 if it's not an IE
|
||||
// browser. This is one of the recomended ways of detecting IE
|
||||
// see:
|
||||
//
|
||||
// http://msdn.microsoft.com/en-us/library/ms537509%28VS.85%29.aspx
|
||||
//
|
||||
detectIEVersion : function() {
|
||||
var rv = -1; // Return value assumes failure.
|
||||
if (navigator.appName == 'Microsoft Internet Explorer')
|
||||
{
|
||||
var ua = navigator.userAgent;
|
||||
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
|
||||
if (re.exec(ua) != null)
|
||||
rv = parseFloat( RegExp.$1 );
|
||||
}
|
||||
return rv;
|
||||
},
|
||||
|
||||
//
|
||||
// A list of functions to execute on init.
|
||||
//
|
||||
_initFuns : new Array(),
|
||||
|
||||
//
|
||||
// Has the init function event been set?
|
||||
//
|
||||
_initFunSet: false,
|
||||
|
||||
//
|
||||
// Function called when the DOM has loaded. It launches all init
|
||||
// functions.
|
||||
//
|
||||
_onInit : function()
|
||||
{
|
||||
//
|
||||
// Sort by order...
|
||||
//
|
||||
this._initFuns.sort(function(a, b){ return a.order - b.order; });
|
||||
for (var i=0;i<this._initFuns.length;i++)
|
||||
{
|
||||
this._initFuns[i]();
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Adds a function that should be executed when the dom is
|
||||
// loaded.
|
||||
//
|
||||
addInitFunction : function(init, /*Function to call after dom
|
||||
* is loaded*/
|
||||
|
||||
order /* An optional it specifing
|
||||
* order. The bigger the int the
|
||||
* later it will run. Default is
|
||||
* 1.*/
|
||||
) {
|
||||
if (arguments.length < 2)
|
||||
{
|
||||
init.order = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
init.order = order;
|
||||
}
|
||||
this._initFuns.push (init);
|
||||
|
||||
if (!this._initFunSet)
|
||||
{
|
||||
var butil = this;
|
||||
function initFun()
|
||||
{
|
||||
return (function(){ butil._onInit(); });
|
||||
}
|
||||
|
||||
//
|
||||
// Try event listeners, attachEvent and if that fails use
|
||||
// window.onload...
|
||||
//
|
||||
if (window.addEventListener)
|
||||
{
|
||||
window.addEventListener("load", initFun(), false);
|
||||
} else if (window.attachEvent)
|
||||
{
|
||||
window.attachEvent ("onload", initFun());
|
||||
} else
|
||||
{
|
||||
window.onload = initFun();
|
||||
}
|
||||
|
||||
this._initFunSet = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
trc.util.dom = {
|
||||
//
|
||||
// Adds a new script tag to the current DOM.
|
||||
//
|
||||
addScript : function (src /* Script href */)
|
||||
{
|
||||
var scriptElement = document.createElement ("script");
|
||||
scriptElement.setAttribute ("type", "text/javascript");
|
||||
scriptElement.setAttribute ("src", src);
|
||||
|
||||
this.addToHead (scriptElement);
|
||||
},
|
||||
|
||||
//
|
||||
// Adds a new stylesheet to the current DOM.
|
||||
//
|
||||
addStyle : function (src /* Stylesheet href */)
|
||||
{
|
||||
var linkElement = document.createElement ("link");
|
||||
linkElement.setAttribute ("rel", "stylesheet");
|
||||
linkElement.setAttribute ("type", "text/css");
|
||||
linkElement.setAttribute ("href", src);
|
||||
|
||||
this.addToHead (linkElement);
|
||||
},
|
||||
|
||||
//
|
||||
// Adds a DOM node to the HTTP head element. The element is
|
||||
// always added as the last child an error is thrown if the
|
||||
// head element can't be found.
|
||||
//
|
||||
addToHead : function (node /* A DOM node */)
|
||||
{
|
||||
var headArray = document.getElementsByTagName("head");
|
||||
if (headArray.length == 0)
|
||||
{
|
||||
throw new Error("Couldn't find head element, bad DOM?");
|
||||
}
|
||||
else
|
||||
{
|
||||
headArray[0].appendChild (node);
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Dum utility function for setting the class name of an
|
||||
// element. Eventually we'll move completely to XHTML, but
|
||||
// this will never work in IE 6, so for now we need this
|
||||
// method for setting the class name.
|
||||
//
|
||||
setClassName : function (element, /* DOM Element*/
|
||||
name /* Class name to use */
|
||||
)
|
||||
{
|
||||
var ieVersion = trc.util.browser.detectIEVersion();
|
||||
|
||||
if ((ieVersion > -1) &&
|
||||
(ieVersion < 7))
|
||||
{
|
||||
element.className = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
element.setAttribute ("class",name);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
trc.util.text = {
|
||||
//
|
||||
// Useful RegExps
|
||||
//
|
||||
blank : new RegExp ("^\\s*$"), /* A blank string */
|
||||
indent : new RegExp ("^\\s+"), /* Line indent */
|
||||
lines : new RegExp ("$","m"), /* All lines */
|
||||
linechars : new RegExp ("(\n|\r)"), /* EOL line characters */
|
||||
tabs : new RegExp ("\t","g"), /* All tabs */
|
||||
|
||||
//
|
||||
// We need this because microsoft browsers before IE 7, connot
|
||||
// display pre-formatted text correctly win unix style line
|
||||
// endings.
|
||||
//
|
||||
unix2dos : function(txt /* String */) {
|
||||
//if already DOS...
|
||||
if (txt.search(/\r\n/) != -1)
|
||||
{
|
||||
return txt;
|
||||
}
|
||||
return txt.replace (/\n/g, "\r\n");
|
||||
},
|
||||
|
||||
//
|
||||
// Useful to normalize text.
|
||||
//
|
||||
dos2unix : function(txt /* String */) {
|
||||
//if already unix...
|
||||
if (txt.search(/\r\n/) == -1)
|
||||
{
|
||||
return txt;
|
||||
}
|
||||
|
||||
return txt.replace(/\r/g, "");
|
||||
},
|
||||
|
||||
//
|
||||
// Create a string with a character repeated x times.
|
||||
//
|
||||
repString : function (length, /* integer, size of the string to create */
|
||||
ch /* string, The character to set the string to */
|
||||
)
|
||||
{
|
||||
var ret = new String();
|
||||
for (var i=0;i<length;i++) {ret=ret.concat(ch);}
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
//
|
||||
// Replace tabs in a text with strings.
|
||||
//
|
||||
replaceTabs : function (txt, /* String to modify */
|
||||
length /* integer, tab length in spaces */
|
||||
)
|
||||
{
|
||||
var tabs = this.repString(length, " ");
|
||||
return txt.replace (this.tabs, tabs);
|
||||
},
|
||||
|
||||
//
|
||||
// Given multi-line text returns Adjust top and bottom indent
|
||||
// (in lines) and right indent (in spaces)
|
||||
//
|
||||
setIndent : function (txt, /* String */
|
||||
top, /* integer, top indent in lines */
|
||||
bottom, /* integer, bottom indent in lines */
|
||||
right /* integer, right indent in spaces */
|
||||
)
|
||||
{
|
||||
//
|
||||
// Can't indent an empty string..
|
||||
//
|
||||
if (txt.length == 0)
|
||||
{
|
||||
return txt;
|
||||
}
|
||||
|
||||
//
|
||||
// If not 0, bottom will be off by one...
|
||||
//
|
||||
if (bottom != 0)
|
||||
{
|
||||
bottom++;
|
||||
}
|
||||
|
||||
var head=this.repString (top, "\n");
|
||||
var tail=this.repString (bottom, "\n");
|
||||
var marg=this.repString (right, " ");
|
||||
var ntxt = this.dos2unix(txt);
|
||||
var ntxt = this.replaceTabs (ntxt, 8);
|
||||
var lines = ntxt.split (this.lines);
|
||||
var origIndent=Number.MAX_VALUE;
|
||||
var origIndentStr;
|
||||
|
||||
//
|
||||
// Look up indent.
|
||||
//
|
||||
for (var i=0;i<lines.length;i++)
|
||||
{
|
||||
//
|
||||
// Remove EOL characters...
|
||||
//
|
||||
lines[i] = lines[i].replace (this.linechars, "");
|
||||
|
||||
//
|
||||
// Ignore blank lines
|
||||
//
|
||||
if (lines[i].match(this.blank) != null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Detect the indent if any...
|
||||
//
|
||||
var result = lines[i].match(this.indent);
|
||||
if (result == null)
|
||||
{
|
||||
origIndent = 0;
|
||||
origIndentStr = "";
|
||||
}
|
||||
else if (result[0].length < origIndent)
|
||||
{
|
||||
origIndent = result[0].length;
|
||||
origIndentStr = result[0];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// This implys all line are blank...can't indent.
|
||||
//
|
||||
if (origIndent == Number.MAX_VALUE)
|
||||
{
|
||||
return txt;
|
||||
}
|
||||
|
||||
if (origIndent != 0)
|
||||
{
|
||||
var regExStr = "^";
|
||||
for (var i=0;i<origIndent;i++)
|
||||
{
|
||||
regExStr=regExStr.concat("\\s");
|
||||
}
|
||||
var indent = new RegExp(regExStr);
|
||||
for (var i=0;i<lines.length;i++)
|
||||
{
|
||||
lines[i] = lines[i].replace(indent,marg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i=0;i<lines.length;i++)
|
||||
{
|
||||
lines[i] = marg.concat (lines[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Remove top...
|
||||
//
|
||||
while (lines.length != 0)
|
||||
{
|
||||
if (lines[0].match(this.blank))
|
||||
{
|
||||
lines.shift();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Remove bottom...
|
||||
//
|
||||
while (lines.length != 0)
|
||||
{
|
||||
if (lines[lines.length-1].match(this.blank))
|
||||
{
|
||||
lines.pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var indented = lines.join("\n");
|
||||
indented=head.concat(indented, tail);
|
||||
|
||||
return indented;
|
||||
}
|
||||
};
|
||||
|
||||
trc.util.net = {
|
||||
//
|
||||
// A list of possible factories for creating an XMLHTTPRequest
|
||||
//
|
||||
_HTTPReqFactories :
|
||||
[
|
||||
function() { return new XMLHttpRequest(); },
|
||||
function() { return new ActiveXObject("Msxml2.XMLHTTP"); },
|
||||
function() { return new ActiveXObject("Microsoft.XMLHTTP"); }
|
||||
],
|
||||
|
||||
//
|
||||
// A cached XMLHTTPRequest factory that we know works in this
|
||||
// browser
|
||||
//
|
||||
_HTTPReqFactory : null,
|
||||
|
||||
//
|
||||
// Provides a way of getting an HTTPRequest object in a
|
||||
// platform independent manner
|
||||
//
|
||||
getHTTPRequest : function()
|
||||
{
|
||||
//
|
||||
// Use cache if available..
|
||||
//
|
||||
if (this._HTTPReqFactory != null) return this._HTTPReqFactory();
|
||||
|
||||
//
|
||||
// Search for a factory..
|
||||
//
|
||||
for (var i=0; i< this._HTTPReqFactories.length; i++)
|
||||
{
|
||||
try {
|
||||
var factory = this._HTTPReqFactories[i];
|
||||
var request = factory();
|
||||
if (request != null)
|
||||
{
|
||||
this._HTTPReqFactory = factory;
|
||||
return request;
|
||||
}
|
||||
} catch (e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Looks like we don't have support for XMLHttpRequest...
|
||||
//
|
||||
this._HTTPReqFactory = function() {throw new Error("XMLHttpRequest not supported");}
|
||||
this._HTTPReqFactory();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Init code for trc.util.yui...
|
||||
//
|
||||
(function()
|
||||
{
|
||||
//
|
||||
// Menu make sure we have the YUI loader as it's used by our
|
||||
// init function to load YUI components.
|
||||
//
|
||||
if (!window.YAHOO)
|
||||
{
|
||||
//
|
||||
// We are currently using YUI on YAHOO!'s servers we may
|
||||
// want to change this.
|
||||
//
|
||||
var YUI_BASE="http://yui.yahooapis.com/2.7.0/";
|
||||
|
||||
trc.util.dom.addScript (YUI_BASE+"build/yuiloader/yuiloader-min.js");
|
||||
}
|
||||
|
||||
function InitYUIUtil()
|
||||
{
|
||||
trc.util.yui._init();
|
||||
}
|
||||
trc.util.browser.addInitFunction (InitYUIUtil);
|
||||
})();
|
||||
|
||||
trc.util.yui = {
|
||||
//
|
||||
// A list of dependecies to be passed to the YUI loader. This is
|
||||
// essentially a hash set: dep->dep.
|
||||
//
|
||||
_deps : new Object(),
|
||||
|
||||
//
|
||||
// An array of callback functions, these should be called when all
|
||||
// dependecies are loaded.
|
||||
//
|
||||
_callbacks : new Array(),
|
||||
|
||||
//
|
||||
// The init function simply calls the YUI loader...
|
||||
//
|
||||
_init : function() {
|
||||
var yuiUtil = this;
|
||||
|
||||
//
|
||||
// It takes safari a while to load the YUI Loader if it hasn't
|
||||
// loaded yet keep trying at 1/4 second intervals
|
||||
//
|
||||
if (!window.YAHOO)
|
||||
{
|
||||
window.setTimeout (function() {
|
||||
yuiUtil._init();
|
||||
}, 250);
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Collect requirements...
|
||||
//
|
||||
var required = new Array();
|
||||
for (var req in this._deps)
|
||||
{
|
||||
required.push (req);
|
||||
}
|
||||
|
||||
//
|
||||
// Load YUI dependecies...
|
||||
//
|
||||
var loader = new YAHOO.util.YUILoader({
|
||||
require: required,
|
||||
loadOptional: true,
|
||||
filter: "RAW",
|
||||
onSuccess: function() {
|
||||
yuiUtil._depsLoaded();
|
||||
},
|
||||
timeout: 10000,
|
||||
combine: true
|
||||
});
|
||||
loader.insert();
|
||||
},
|
||||
|
||||
//
|
||||
// Called after all dependecies have been loaded
|
||||
//
|
||||
_depsLoaded : function() {
|
||||
//
|
||||
// Dependecies are loaded let everyone know.
|
||||
//
|
||||
for (var i=0;i<this._callbacks.length;i++)
|
||||
{
|
||||
this._callbacks[i]();
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// Request that one or more YUI dependecies are loaded.
|
||||
//
|
||||
loadYUIDeps : function (deps, /*An array of dep strings */
|
||||
callback /*A function to call when deps are loaded*/
|
||||
)
|
||||
{
|
||||
for (var i=0;i<deps.length;i++)
|
||||
{
|
||||
this._deps[deps[i]] = deps[i];
|
||||
}
|
||||
if (callback != null)
|
||||
{
|
||||
this._callbacks.push (callback);
|
||||
}
|
||||
}
|
||||
};
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"addIp" : {
|
||||
"configureServer" : true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<addIp xmlns="http://docs.openstack.org/compute/api/v1.1" configureServer="true"/>
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"ip" : {
|
||||
"addr" : "67.23.10.132"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ip xmlns="http://docs.openstack.org/compute/api/v1.1" addr="67.23.10.132"/>
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"addresses": {
|
||||
"public" : [
|
||||
{
|
||||
"version": 4,
|
||||
"addr": "67.23.10.132"
|
||||
},
|
||||
{
|
||||
"version": 6,
|
||||
"addr": "::babe:67.23.10.132"
|
||||
},
|
||||
{
|
||||
"version": 4,
|
||||
"addr": "67.23.10.131"
|
||||
},
|
||||
{
|
||||
"version": 6,
|
||||
"addr": "::babe:4317:0A83"
|
||||
}
|
||||
],
|
||||
"private" : [
|
||||
{
|
||||
"version": 4,
|
||||
"addr": "10.176.42.16"
|
||||
},
|
||||
{
|
||||
"version": 6,
|
||||
"addr": "::babe:10.176.42.16"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<addresses xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<network id="public">
|
||||
<ip version="4" addr="67.23.10.132"/>
|
||||
<ip version="6" addr="::babe:67.23.10.132"/>
|
||||
<ip version="4" addr="67.23.10.131"/>
|
||||
<ip version="6" addr="::babe:4317:0A83"/>
|
||||
</network>
|
||||
<network id="private">
|
||||
<ip version="4" addr="10.176.42.16"/>
|
||||
<ip version="6" addr="::babe:10.176.42.16"/>
|
||||
</network>
|
||||
</addresses>
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"backupSchedule" : {
|
||||
"enabled" : true,
|
||||
"weekly" : "THURSDAY",
|
||||
"daily" : "H_0400_0600"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<backupSchedule xmlns="http://docs.openstack.org/compute/api/v1.1" enabled="true" weekly="THURSDAY" daily="H_0400_0600"/>
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"backupOrResizeInProgress" : {
|
||||
"code" : 409,
|
||||
"message" : "Backup Or Resize In Progress",
|
||||
"details" : "Error Details..."
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<backupOrResizeInProgress xmlns="http://docs.openstack.org/compute/api/v1.1" code="409">
|
||||
<message>Backup Or Resize In Progress</message>
|
||||
<details>Error Details...</details>
|
||||
</backupOrResizeInProgress>
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"badMediaType" : {
|
||||
"code" : 415,
|
||||
"message" : "Bad Media Type",
|
||||
"details" : "Error Details..."
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<badMediaType xmlns="http://docs.openstack.org/compute/api/v1.1" code="415">
|
||||
<message>Bad Media Type</message>
|
||||
<details>Error Details...</details>
|
||||
</badMediaType>
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
{
|
||||
"badMethod" : {
|
||||
"code" : 405,
|
||||
"message" : "Bad Method",
|
||||
"details" : "Error Details..."
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<badMethod xmlns="http://docs.openstack.org/compute/api/v1.1" code="405">
|
||||
<message>Bad Method</message>
|
||||
<details>Error Details...</details>
|
||||
</badMethod>
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"badRequest" : {
|
||||
"code" : 400,
|
||||
"message" : "Bad Request",
|
||||
"details" : "Error Details..."
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<badRequest xmlns="http://docs.openstack.org/compute/api/v1.1" code="400">
|
||||
<message>Bad Request</message>
|
||||
<details>Error Details...</details>
|
||||
</badRequest>
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"buildInProgress" : {
|
||||
"code" : 409,
|
||||
"message" : "In Progress",
|
||||
"details" : "Error Details..."
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<buildInProgress xmlns="http://docs.openstack.org/compute/api/v1.1" code="409">
|
||||
<message>In Progress</message>
|
||||
<details>Error Details...</details>
|
||||
</buildInProgress>
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"changePassword" : {
|
||||
"adminPass" : "ss1293837$%^"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<changePassword
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
adminPass="ss1293837$%^"/>
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"choices": [
|
||||
{
|
||||
"id": "v1.0",
|
||||
"status": "DEPRECATED",
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.0/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"
|
||||
}
|
||||
],
|
||||
"media-types": [
|
||||
{
|
||||
"base": "application/xml",
|
||||
"type": "application/vnd.openstack.compute+xml;version=1.0"
|
||||
},
|
||||
{
|
||||
"base": "application/json",
|
||||
"type": "application/vnd.openstack.compute+json;version=1.0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "v1.1",
|
||||
"status": "CURRENT",
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"
|
||||
}
|
||||
],
|
||||
"media-types": [
|
||||
{
|
||||
"base": "application/xml",
|
||||
"type": "application/vnd.openstack.compute+xml;version=1.0"
|
||||
},
|
||||
{
|
||||
"base": "application/json",
|
||||
"type": "application/vnd.openstack.compute+json;version=1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<choices xmlns="http://docs.openstack.org/common/api/v1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<version id="v1.0" status="DEPRECATED">
|
||||
<media-types>
|
||||
<media-type base="application/xml"
|
||||
type="application/vnd.openstack.compute+xml;version=1.0"/>
|
||||
<media-type base="application/json"
|
||||
type="application/vnd.openstack.compute+json;version=1.0"/>
|
||||
</media-types>
|
||||
|
||||
<atom:link rel="self"
|
||||
href="http://servers.api.openstack.org/v1.0/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"/>
|
||||
</version>
|
||||
|
||||
<version id="v1.1" status="CURRENT">
|
||||
<media-types>
|
||||
<media-type base="application/xml"
|
||||
type="application/vnd.openstack.compute+xml;version=1.1"/>
|
||||
<media-type base="application/json"
|
||||
type="application/vnd.openstack.compute+json;version=1.1"/>
|
||||
</media-types>
|
||||
|
||||
<atom:link rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"/>
|
||||
</version>
|
||||
</choices>
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"confirmResize" : null
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<confirmResize
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"/>
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"createImage" : {
|
||||
"name" : "new-image",
|
||||
"metadata": {
|
||||
"ImageType": "Gold",
|
||||
"ImageVersion": "2.0"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<createImage
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
name="new-image">
|
||||
<metadata>
|
||||
<meta key="ImageType">Gold</meta>
|
||||
<meta key="ImageVersion">2.0</meta>
|
||||
</metadata>
|
||||
</createImage>
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
{
|
||||
"RS-CBS:attach-volume" {
|
||||
"href" : "https://cbs.api.rackspacecloud.com/12934/volumes/19"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<attach-volume
|
||||
xmlns="http://docs.rackspacecloud.com/servers/api/ext/cbs/v1.0"
|
||||
href="https://cbs.api.rackspacecloud.com/12934/volumes/19"/>
|
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
"server": {
|
||||
"id": "52415800-8b69-11e0-9b19-734f000004d2",
|
||||
"name": "sample-server",
|
||||
"imageRef": "https://servers.api.rackspacecloud.com/v1.1/32278/images/52415800-8b69-11e0-9b19-734f5736d2a2",
|
||||
"flavorRef": "https://servers.api.rackspacecloud.com/v1.1/32278/flavors/52415800-8b69-11e0-9b19-734f1195ff37",
|
||||
"updated": "2010-10-10T12:00:00Z",
|
||||
"created": "2010-08-10T12:00:00Z",
|
||||
"hostId": "e4d909c290d0fb1ca068ffaddf22cbd0",
|
||||
"aide:affinityId": "1fdfe1e2-03f0-102f-b7ae-005056bb5f9e",
|
||||
"status": "BUILD",
|
||||
"progress": 60,
|
||||
"addresses": [
|
||||
{
|
||||
"id": "public",
|
||||
"ip": [
|
||||
{
|
||||
"version": 4,
|
||||
"addr": "67.23.10.132"
|
||||
},
|
||||
{
|
||||
"version": 6,
|
||||
"addr": "::babe:67.23.10.132"
|
||||
},
|
||||
{
|
||||
"version": 4,
|
||||
"addr": "67.23.10.131"
|
||||
},
|
||||
{
|
||||
"version": 6,
|
||||
"addr": "::babe:4317:0A83"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "private",
|
||||
"ip": [
|
||||
{
|
||||
"version": 4,
|
||||
"addr": "10.176.42.16"
|
||||
},
|
||||
{
|
||||
"version": 6,
|
||||
"addr": "::babe:10.176.42.16"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"Server Label": "Web Head 1",
|
||||
"Image Version": "2.1"
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"type": "application/vnd.openstack.compute-v1.1+xml",
|
||||
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"type": "application/vnd.openstack.compute-v1.1+json",
|
||||
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:aide="http://docs.rackspacecloud.com/servers/api/ext/aide/v1.0"
|
||||
id="52415800-8b69-11e0-9b19-734f000004d2" name="sample-server"
|
||||
flavorRef="https://servers.api.rackspacecloud.com/v1.1/32278/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
status="BUILD"
|
||||
updated="2010-10-10T12:00:00Z"
|
||||
created="2010-08-10T12:00:00Z"
|
||||
progress="60" hostId="e4d909c290d0fb1ca068ffaddf22cbd0"
|
||||
aide:affinityId="1fdfe1e2-03f0-102f-b7ae-005056bb5f9e"
|
||||
imageRef="https://servers.api.rackspacecloud.com/v1.1/32278/images/52415800-8b69-11e0-9b19-734f5736d2a2">
|
||||
<metadata>
|
||||
<meta key="Server Label">Web Head 1</meta>
|
||||
<meta key="Image Version">2.1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="public">
|
||||
<ip version="4" addr="67.23.10.132"/>
|
||||
<ip version="6" addr="::babe:67.23.10.132"/>
|
||||
<ip version="4" addr="67.23.10.131"/>
|
||||
<ip version="6" addr="::babe:4317:0A83"/>
|
||||
</network>
|
||||
<network id="private">
|
||||
<ip version="4" addr="10.176.42.16"/>
|
||||
<ip version="6" addr="::babe:10.176.42.16"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
type="application/vnd.openstack.compute-v1.1+xml"
|
||||
href="http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
type="application/vnd.openstack.compute-v1.1+json"
|
||||
href="http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f000004d2"/>
|
||||
</server>
|
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
"servers": [
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f6af67565",
|
||||
"tenant_id": "1234",
|
||||
"user_id": "5678",
|
||||
"name": "sample-server",
|
||||
"updated": "2010-10-10T12:00:00Z",
|
||||
"created": "2010-08-10T12:00:00Z",
|
||||
"hostId": "e4d909c290d0fb1ca068ffaddf22cbd0",
|
||||
"status": "BUILD",
|
||||
"progress": 60,
|
||||
"accessIPv4" : "67.23.10.132",
|
||||
"accessIPv6" : "::babe:67.23.10.132",
|
||||
"image" : {
|
||||
"id": "52415800-8b69-11e0-9b19-734f6f006e54",
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
}
|
||||
]
|
||||
},
|
||||
"flavor" : {
|
||||
"id": "52415800-8b69-11e0-9b19-734f216543fd",
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
|
||||
}
|
||||
]
|
||||
},
|
||||
"addresses": {
|
||||
"public" : [
|
||||
{
|
||||
"version": 4,
|
||||
"addr": "67.23.10.132"
|
||||
},
|
||||
{
|
||||
"version": 6,
|
||||
"addr": "::babe:67.23.10.132"
|
||||
},
|
||||
{
|
||||
"version": 4,
|
||||
"addr": "67.23.10.131"
|
||||
},
|
||||
{
|
||||
"version": 6,
|
||||
"addr": "::babe:4317:0A83"
|
||||
}
|
||||
],
|
||||
"private" : [
|
||||
{
|
||||
"version": 4,
|
||||
"addr": "10.176.42.16"
|
||||
},
|
||||
{
|
||||
"version": 6,
|
||||
"addr": "::babe:10.176.42.16"
|
||||
}
|
||||
]
|
||||
},
|
||||
"metadata": {
|
||||
"Server Label": "Web Head 1",
|
||||
"Image Version": "2.1"
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"
|
||||
}
|
||||
],
|
||||
"RS-CBS:volumes": [
|
||||
{
|
||||
"name": "OS",
|
||||
"href": "https://cbs.api.rackspacecloud.com/12934/volumes/19"
|
||||
},
|
||||
{
|
||||
"name": "Work",
|
||||
"href": "https://cbs.api.rackspacecloud.com/12934/volumes/23"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<servers xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<server id="52415800-8b69-11e0-9b19-734f6af67565"
|
||||
tenant_id="1234" user_id="5678"
|
||||
name="sample-server" status="BUILD"
|
||||
progress="60" hostId="e4d909c290d0fb1ca068ffaddf22cbd0"
|
||||
updated="2010-10-10T12:00:00Z"
|
||||
created="2010-08-10T12:00:00Z"
|
||||
accessIPv4="67.23.10.132"
|
||||
accessIPv6="::babe:67.23.10.132">
|
||||
<image id="52415800-8b69-11e0-9b19-734f6f006e54">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
</image>
|
||||
<flavor id="52415800-8b69-11e0-9b19-734f216543fd">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
</flavor>
|
||||
<metadata>
|
||||
<meta key="Server Label">Web Head 1</meta>
|
||||
<meta key="Image Version">2.1</meta>
|
||||
</metadata>
|
||||
<addresses>
|
||||
<network id="public">
|
||||
<ip version="4" addr="67.23.10.132"/>
|
||||
<ip version="6" addr="::babe:67.23.10.132"/>
|
||||
<ip version="4" addr="67.23.10.131"/>
|
||||
<ip version="6" addr="::babe:4317:0A83"/>
|
||||
</network>
|
||||
<network id="private">
|
||||
<ip version="4" addr="10.176.42.16"/>
|
||||
<ip version="6" addr="::babe:10.176.42.16"/>
|
||||
</network>
|
||||
</addresses>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"/>
|
||||
<volumes
|
||||
xmlns="http://docs.rackspacecloud.com/servers/api/ext/cbs/v1.0">
|
||||
<volume name="OS"
|
||||
href="https://cbs.api.rackspacecloud.com/12934/volumes/19"/>
|
||||
<volume name="Work"
|
||||
href="https://cbs.api.rackspacecloud.com/12934/volumes/23"/>
|
||||
</volumes>
|
||||
</server>
|
||||
</servers>
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"extension" : {
|
||||
"name" : "Public Image Extension",
|
||||
"namespace" : "http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0",
|
||||
"alias" : "RS-PIE",
|
||||
"updated" : "2011-01-22T13:25:27-06:00",
|
||||
"description" : "Adds the capability to share an image with other users.",
|
||||
"links" : [
|
||||
{
|
||||
"rel" : "describedby",
|
||||
"type" : "application/pdf",
|
||||
"href" : "http://docs.rackspacecloud.com/servers/api/ext/cs-pie-20111111.pdf"
|
||||
},
|
||||
{
|
||||
"rel" : "describedby",
|
||||
"type" : "application/vnd.sun.wadl+xml",
|
||||
"href" : "http://docs.rackspacecloud.com/servers/api/ext/cs-pie.wadl"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<extension
|
||||
xmlns="http://docs.openstack.org/common/api/v1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
name="Public Image Extension"
|
||||
namespace="http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0"
|
||||
alias="RS-PIE"
|
||||
updated="2011-01-22T13:25:27-06:00">
|
||||
|
||||
<description>
|
||||
Adds the capability to share an image with other users.
|
||||
</description>
|
||||
|
||||
<atom:link
|
||||
rel="describedby"
|
||||
type="application/pdf"
|
||||
href="http://docs.rackspacecloud.com/servers/api/ext/cs-pie-20111111.pdf"/>
|
||||
|
||||
<atom:link
|
||||
rel="describedby"
|
||||
type="application/vnd.sun.wadl+xml"
|
||||
href="http://docs.rackspacecloud.com/servers/api/ext/cs-pie.wadl"/>
|
||||
</extension>
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"extension" : {
|
||||
"name" : "Cloud Block Storage",
|
||||
"namespace" : "http://docs.rackspacecloud.com/servers/api/ext/cbs/v1.0",
|
||||
"alias" : "RS-CBS",
|
||||
"description" : "Allows mounting cloud block storage volumes.",
|
||||
"links" : [
|
||||
{
|
||||
"rel" : "describedby",
|
||||
"type" : "application/pdf",
|
||||
"href" : "http://docs.rackspacecloud.com/servers/api/ext/cs-cbs-20111201.pdf"
|
||||
},
|
||||
{
|
||||
"rel" : "describedby",
|
||||
"type" : "application/vnd.sun.wadl+xml",
|
||||
"href" : "http://docs.rackspacecloud.com/servers/api/ext/cs-cbs.wadl"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension xmlns="http://docs.openstack.org/common/api/v1.0" xmlns:atom="http://www.w3.org/2005/Atom" name="Cloud Block Storage" namespace="http://docs.rackspacecloud.com/servers/api/ext/cbs/v1.0" alias="RS-CBS">
|
||||
<description>
|
||||
Allows mounting cloud block storage volumes.
|
||||
</description>
|
||||
<atom:link rel="describedby" type="application/pdf" href="http://docs.rackspacecloud.com/servers/api/ext/cs-cbs-20111201.pdf"/>
|
||||
<atom:link rel="describedby" type="application/vnd.sun.wadl+xml" href="http://docs.rackspacecloud.com/servers/api/ext/cs-cbs.wadl"/>
|
||||
</extension>
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"extension" : {
|
||||
"name" : "Public Image Extension",
|
||||
"namespace" : "http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0",
|
||||
"alias" : "RS-PIE",
|
||||
"updated" : "2011-01-22T13:25:27-06:00",
|
||||
"description" : "Adds the capability to share an image with other users."
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension xmlns="http://docs.openstack.org/common/api/v1.0" xmlns:atom="http://www.w3.org/2005/Atom" name="Public Image Extension" namespace="http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0" alias="RS-PIE" updated="2011-01-22T13:25:27-06:00">
|
||||
<description>
|
||||
Adds the capability to share an image with other users.
|
||||
</description>
|
||||
</extension>
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"extension" : {
|
||||
"name" : "Public Image Extension",
|
||||
"namespace" : "http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0",
|
||||
"alias" : "RS-PIE",
|
||||
"description" : "Adds the capability to share an image with other users."
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension xmlns="http://docs.openstack.org/common/api/v1.0" xmlns:atom="http://www.w3.org/2005/Atom" name="Public Image Extension" namespace="http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0" alias="RS-PIE">
|
||||
<description>
|
||||
Adds the capability to share an image with other users.
|
||||
</description>
|
||||
</extension>
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"extensions": [
|
||||
{
|
||||
"name": "Public Image Extension",
|
||||
"namespace": "http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0",
|
||||
"alias": "RAX-PIE",
|
||||
"updated": "2011-01-22T13:25:27-06:00",
|
||||
"description": "Adds the capability to share an image with other users.",
|
||||
"links": [
|
||||
{
|
||||
"rel": "describedby",
|
||||
"type": "application/pdf",
|
||||
"href": "http://docs.rackspacecloud.com/servers/api/ext/cs-pie-20111111.pdf"
|
||||
},
|
||||
{
|
||||
"rel": "describedby",
|
||||
"type": "application/vnd.sun.wadl+xml",
|
||||
"href": "http://docs.rackspacecloud.com/servers/api/ext/cs-pie.wadl"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Cloud Block Storage",
|
||||
"namespace": "http://docs.rackspacecloud.com/servers/api/ext/cbs/v1.0",
|
||||
"alias": "RAX-CBS",
|
||||
"updated": "2011-01-12T11:22:33-06:00",
|
||||
"description": "Allows mounting cloud block storage volumes.",
|
||||
"links": [
|
||||
{
|
||||
"rel": "describedby",
|
||||
"type": "application/pdf",
|
||||
"href": "http://docs.rackspacecloud.com/servers/api/ext/cs-cbs-20111201.pdf"
|
||||
},
|
||||
{
|
||||
"rel": "describedby",
|
||||
"type": "application/vnd.sun.wadl+xml",
|
||||
"href": "http://docs.rackspacecloud.com/servers/api/ext/cs-cbs.wadl"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<extensions xmlns="http://docs.openstack.org/common/api/v1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
|
||||
<extension
|
||||
name="Public Image Extension"
|
||||
namespace="http://docs.rackspacecloud.com/servers/api/ext/pie/v1.0"
|
||||
alias="RAX-PIE"
|
||||
updated="2011-01-22T13:25:27-06:00">
|
||||
|
||||
<description>
|
||||
Adds the capability to share an
|
||||
image with other users.
|
||||
</description>
|
||||
|
||||
<atom:link rel="describedby"
|
||||
type="application/pdf"
|
||||
href="http://docs.rackspacecloud.com/servers/api/ext/cs-pie-20111111.pdf"/>
|
||||
<atom:link rel="describedby"
|
||||
type="application/vnd.sun.wadl+xml"
|
||||
href="http://docs.rackspacecloud.com/servers/api/ext/cs-pie.wadl"/>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
name="Cloud Block Storage"
|
||||
namespace="http://docs.rackspacecloud.com/servers/api/ext/cbs/v1.0"
|
||||
alias="RAX-CBS"
|
||||
updated="2011-01-12T11:22:33-06:00"
|
||||
>
|
||||
<description>
|
||||
Allows mounting cloud block
|
||||
storage volumes.
|
||||
</description>
|
||||
|
||||
<atom:link rel="describedby"
|
||||
type="application/pdf"
|
||||
href="http://docs.rackspacecloud.com/servers/api/ext/cs-cbs-20111201.pdf"/>
|
||||
<atom:link rel="describedby"
|
||||
type="application/vnd.sun.wadl+xml"
|
||||
href="http://docs.rackspacecloud.com/servers/api/ext/cs-cbs.wadl"/>
|
||||
</extension>
|
||||
</extensions>
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"computeFault" : {
|
||||
"code" : 500,
|
||||
"message" : "Fault!",
|
||||
"details" : "Error Details..."
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<computeFault
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
code="500">
|
||||
<message>Fault!</message>
|
||||
<details>Error Details...</details>
|
||||
</computeFault>
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"flavor" : {
|
||||
"id" : "52415800-8b69-11e0-9b19-734f1195ff37",
|
||||
"name" : "256 MB Server",
|
||||
"ram" : 256,
|
||||
"disk" : 10,
|
||||
"vcpus" : 1,
|
||||
"links": [
|
||||
{
|
||||
"rel" : "self",
|
||||
"href" : "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
},
|
||||
{
|
||||
"rel" : "bookmark",
|
||||
"href" : "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flavor
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
id="52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
name="256 MB Server" ram="256" disk="10" vcpus="1">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"/>
|
||||
</flavor>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flavors xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xsi:type="FlavorsWithOnlyIDsNamesLinks"
|
||||
>
|
||||
<flavor id="52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
name="256 MB Server">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"/>
|
||||
</flavor>
|
||||
<flavor id="52415800-8b69-11e0-9b19-734f216543fd"
|
||||
name="512 MB Server">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
</flavor>
|
||||
<atom:link
|
||||
rel="next"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors?limit=2&marker=52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
</flavors>
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"flavors": [
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f1195ff37",
|
||||
"name": "256 MB Server",
|
||||
"ram": 256,
|
||||
"disk": 10,
|
||||
"vcpus": 1,
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f216543fd",
|
||||
"name": "512 MB Server",
|
||||
"ram": 512,
|
||||
"disk": 20,
|
||||
"vcpus": 2,
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd",
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"flavors_links": [
|
||||
{
|
||||
"rel": "next",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/flavors?limit=2&marker=52415800-8b69-11e0-9b19-734f216543fd"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flavors xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<flavor id="52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
name="256 MB Server" ram="256" disk="10" vcpus="1">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"/>
|
||||
</flavor>
|
||||
<flavor id="52415800-8b69-11e0-9b19-734f216543fd"
|
||||
name="512 MB Server" ram="512" disk="20" vcpus="2">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
</flavor>
|
||||
<atom:link
|
||||
rel="next"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors?limit=2&marker=52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
</flavors>
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"flavors": [
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f1195ff37",
|
||||
"name": "256 MB Server",
|
||||
"ram": 256,
|
||||
"disk": 10,
|
||||
"vcpus": 1,
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f216543fd",
|
||||
"name": "512 MB Server",
|
||||
"ram": 512,
|
||||
"disk": 20,
|
||||
"vcpus": 2,
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flavors xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<flavor id="52415800-8b69-11e0-9b19-734f1195ff37"
|
||||
name="256 MB Server" ram="256" disk="10" vcpus="1">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f1195ff37"/>
|
||||
</flavor>
|
||||
<flavor id="52415800-8b69-11e0-9b19-734f216543fd"
|
||||
name="512 MB Server" ram="512" disk="20" vcpus="2">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
</flavor>
|
||||
</flavors>
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"forbidden" : {
|
||||
"code" : 403,
|
||||
"message" : "You are not allowed to perform the operation.",
|
||||
"details" : "Error Details..."
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<forbidden xmlns="http://docs.openstack.org/compute/api/v1.1" code="403">
|
||||
<message>You are not allowed to perform the operation.</message>
|
||||
<details>Error Details...</details>
|
||||
</forbidden>
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"image" : {
|
||||
"id" : "52415800-8b69-11e0-9b19-734f5736d2a2",
|
||||
"name" : "My Server Backup",
|
||||
"created" : "2010-08-10T12:00:00Z",
|
||||
"status" : "SAVING",
|
||||
"progress" : 89,
|
||||
"server" : {
|
||||
"id": "52415800-8b69-11e0-9b19-734f335aa7b3"
|
||||
},
|
||||
"fault" : {
|
||||
"code" : 500,
|
||||
"message" : "An internal error occured",
|
||||
"details" : "Error details"
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"rel" : "self",
|
||||
"href" : "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
},
|
||||
{
|
||||
"rel" : "bookmark",
|
||||
"href" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<image
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
id="52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
name="My Server Backup"
|
||||
created="2010-08-10T12:00:00Z"
|
||||
status="ERROR" progress="89">
|
||||
<server id="52415800-8b69-11e0-9b19-734f335aa7b3" />
|
||||
<fault code="500">
|
||||
<message>An internal error occured</message>
|
||||
<details>Error details</details>
|
||||
</fault>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
</image>
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"image": {
|
||||
"id": "52415800-8b69-11e0-9b19-734f6f006e54",
|
||||
"name": "CentOS 5.2",
|
||||
"metadata": {
|
||||
"ImageVersion": "1.5",
|
||||
"ImageType": "Gold"
|
||||
},
|
||||
"metadata_links": [
|
||||
{
|
||||
"rel": "next",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54/meta?marker=ImageType"
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<image
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
id="52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
name="CentOS 5.2">
|
||||
<metadata>
|
||||
<meta key="ImageVersion">1.5</meta>
|
||||
<meta key="ImageType">Gold</meta>
|
||||
<atom:link
|
||||
rel="next"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54/meta?marker=ImageType"/>
|
||||
</metadata>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
</image>
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"image" : {
|
||||
"id" : "52415800-8b69-11e0-9b19-734f5736d2a2",
|
||||
"name" : "My Server Backup",
|
||||
"links": [
|
||||
{
|
||||
"rel" : "self",
|
||||
"href" : "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
},
|
||||
{
|
||||
"rel" : "bookmark",
|
||||
"href" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
},
|
||||
{
|
||||
"rel" : "alternate",
|
||||
"type" : "application/vnd.openstack.image",
|
||||
"href" : "http://glance.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<image
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
id="52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
name="My Server Backup">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
<atom:link
|
||||
rel="alternate" type="application/vnd.openstack.image"
|
||||
href="http://glance.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
</image>
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"image" : {
|
||||
"id" : "52415800-8b69-11e0-9b19-734f5736d2a2",
|
||||
"name" : "My Server Backup",
|
||||
"updated" : "2010-10-10T12:00:00Z",
|
||||
"created" : "2010-08-10T12:00:00Z",
|
||||
"tenant_id" : "12345",
|
||||
"user_id" : "joe",
|
||||
"status" : "SAVING",
|
||||
"progress" : 80,
|
||||
"minDisk" : 5,
|
||||
"minRam" : 256,
|
||||
"server" : {
|
||||
"id": "52415800-8b69-11e0-9b19-734f335aa7b3",
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f335aa7b3"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f335aa7b3"
|
||||
}
|
||||
]
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"rel" : "self",
|
||||
"href" : "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
},
|
||||
{
|
||||
"rel" : "bookmark",
|
||||
"href" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<image
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
id="52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
name="My Server Backup"
|
||||
updated="2010-10-10T12:00:00Z"
|
||||
created="2010-08-10T12:00:00Z"
|
||||
tenant_id="12345"
|
||||
user_id="joe"
|
||||
status="SAVING" progress="80"
|
||||
minDisk="5" minRam="256">
|
||||
<server id="52415800-8b69-11e0-9b19-734f335aa7b3">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f335aa7b3"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f335aa7b3"/>
|
||||
</server>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
</image>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<images xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xsi:type="ImagesWithOnlyIDsNamesLinks">
|
||||
<image id="52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
name="CentOS 5.2">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
</image>
|
||||
<image
|
||||
id="52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
name="My Server Backup">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
</image>
|
||||
<atom:link
|
||||
rel="next"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images?limit=1&marker=52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
</images>
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f6f006e54",
|
||||
"name": "CentOS 5.2",
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"images_links" : [
|
||||
{
|
||||
"rel": "next",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/images?limit=1&marker=52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<images xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<image id="52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
name="CentOS 5.2">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
</image>
|
||||
<atom:link
|
||||
rel="next"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images?limit=1&marker=52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
</images>
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"id" : "52415800-8b69-11e0-9b19-734f5736d2a2",
|
||||
"name" : "My Server Backup",
|
||||
"links": [
|
||||
{
|
||||
"rel" : "self",
|
||||
"href" : "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"images_links": [
|
||||
{
|
||||
"rel" : "next",
|
||||
"href" : "http://servers.api.openstack.org/v1.1/1234/images?limit=1&marker=52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<images xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<image id="52415800-8b69-11e0-9b19-734f5736d2a2" name="My Server Backup">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
</image>
|
||||
<atom:link rel="next"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images?limit=1&marker=52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
</images>
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f6ff7c475",
|
||||
"name": "Backup 2",
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6ff7c475"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<images xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<image id="52415800-8b69-11e0-9b19-734f6ff7c475"
|
||||
name="Backup 2">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6ff7c475"/>
|
||||
</image>
|
||||
</images>
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f6f006e54",
|
||||
"name": "CentOS 5.2",
|
||||
"updated": "2010-10-10T12:00:00Z",
|
||||
"created": "2010-08-10T12:00:00Z",
|
||||
"tenant_id" : "12345",
|
||||
"user_id" : "joe",
|
||||
"status": "ACTIVE",
|
||||
"metadata": {
|
||||
"ImageType": "Gold",
|
||||
"ImageVersion": "1.5"
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : "52415800-8b69-11e0-9b19-734f5736d2a2",
|
||||
"name" : "My Server Backup",
|
||||
"updated" : "2010-10-10T12:00:00Z",
|
||||
"created" : "2010-08-10T12:00:00Z",
|
||||
"tenant_id" : "12345",
|
||||
"user_id" : "joe",
|
||||
"status" : "SAVING",
|
||||
"progress" : 80,
|
||||
"minDisk" : 5,
|
||||
"minRam" : 256,
|
||||
"server" : {
|
||||
"id": "52415800-8b69-11e0-9b19-734f335aa7b3",
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f335aa7b3"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f335aa7b3"
|
||||
}
|
||||
]
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"rel" : "self",
|
||||
"href" : "http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
},
|
||||
{
|
||||
"rel" : "bookmark",
|
||||
"href" : "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
}
|
||||
]}]}
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<images xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<image id="52415800-8b69-11e0-9b19-734f6f006e54"
|
||||
name="CentOS 5.2"
|
||||
updated="2010-10-10T12:00:00Z"
|
||||
created="2010-08-10T12:00:00Z"
|
||||
tenant_id="12345"
|
||||
user_id="joe"
|
||||
status="ACTIVE">
|
||||
<metadata>
|
||||
<meta key="ImageType">Gold</meta>
|
||||
<meta key="ImageVersion">1.5</meta>
|
||||
</metadata>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"/>
|
||||
</image>
|
||||
<image
|
||||
id="52415800-8b69-11e0-9b19-734f5736d2a2"
|
||||
name="My Server Backup"
|
||||
updated="2010-10-10T12:00:00Z"
|
||||
created="2010-08-10T12:00:00Z"
|
||||
tenant_id="12345"
|
||||
user_id="joe"
|
||||
status="SAVING" progress="80"
|
||||
minDisk="5" minRam="256">
|
||||
<server id="52415800-8b69-11e0-9b19-734f335aa7b3">
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/servers/52415800-8b69-11e0-9b19-734f335aa7b3"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f335aa7b3"/>
|
||||
</server>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f5736d2a2"/>
|
||||
</image>
|
||||
</images>
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"sharedIpGroup" : {
|
||||
"id" : "52415800-8b69-11e0-9b19-734f68ab4a9f",
|
||||
"name" : "Shared IP Group 1",
|
||||
"servers" : ["52415800-8b69-11e0-9b19-734f0272444a"],
|
||||
"links": [
|
||||
{
|
||||
"rel" : "self",
|
||||
"href" : "http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"
|
||||
},
|
||||
{
|
||||
"rel" : "bookmark",
|
||||
"href" : "http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sharedIpGroup
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
id="52415800-8b69-11e0-9b19-734f68ab4a9f"
|
||||
name="Shared IP Group 1">
|
||||
<servers>
|
||||
<server id="52415800-8b69-11e0-9b19-734f0272444a"/>
|
||||
</servers>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"/>
|
||||
</sharedIpGroup>
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"sharedIpGroup" : {
|
||||
"name" : "Shared IP Group 1",
|
||||
"server" : "52415800-8b69-11e0-9b19-734f0272444a"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sharedIpGroup
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
name="Shared IP Group 1">
|
||||
<server id="52415800-8b69-11e0-9b19-734f0272444a"/>
|
||||
</sharedIpGroup>
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"sharedIpGroups": [
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f68ab4a9f",
|
||||
"name": "Shared IP Group 1",
|
||||
"servers": [
|
||||
"52415800-8b69-11e0-9b19-734f0272444a",
|
||||
"52415800-8b69-11e0-9b19-734f3b0d4465"
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f0e75433e",
|
||||
"name": "Shared IP Group 2",
|
||||
"servers": [
|
||||
"52415800-8b69-11e0-9b19-734f10c97171",
|
||||
"52415800-8b69-11e0-9b19-734f4306ea92",
|
||||
"52415800-8b69-11e0-9b19-734f216543fd"
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f0e75433e"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f0e75433e"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"sharedIpGroups_": {
|
||||
"links": [
|
||||
{
|
||||
"rel": "next",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/shared_ip_groups?limit=2&marker=52415800-8b69-11e0-9b19-734f0e75433e"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sharedIpGroups
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<sharedIpGroup
|
||||
id="52415800-8b69-11e0-9b19-734f68ab4a9f"
|
||||
name="Shared IP Group 1">
|
||||
<servers>
|
||||
<server id="52415800-8b69-11e0-9b19-734f0272444a"/>
|
||||
<server id="52415800-8b69-11e0-9b19-734f3b0d4465"/>
|
||||
</servers>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"/>
|
||||
</sharedIpGroup>
|
||||
<sharedIpGroup
|
||||
id="52415800-8b69-11e0-9b19-734f0e75433e"
|
||||
name="Shared IP Group 2">
|
||||
<servers>
|
||||
<server id="52415800-8b69-11e0-9b19-734f10c97171"/>
|
||||
<server id="52415800-8b69-11e0-9b19-734f4306ea92"/>
|
||||
<server id="52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
</servers>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f0e75433e"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f0e75433e"/>
|
||||
</sharedIpGroup>
|
||||
<atom:link
|
||||
rel="next"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/shared_ip_groups?limit=2&marker=52415800-8b69-11e0-9b19-734f0e75433e"/>
|
||||
</sharedIpGroups>
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"sharedIpGroups": [
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f68ab4a9f",
|
||||
"name": "Shared IP Group 1",
|
||||
"servers": [
|
||||
"52415800-8b69-11e0-9b19-734f0272444a",
|
||||
"52415800-8b69-11e0-9b19-734f3b0d4465"
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "52415800-8b69-11e0-9b19-734f0e75433e",
|
||||
"name": "Shared IP Group 2",
|
||||
"servers": [
|
||||
"52415800-8b69-11e0-9b19-734f10c97171",
|
||||
"52415800-8b69-11e0-9b19-734f4306ea92",
|
||||
"52415800-8b69-11e0-9b19-734f216543fd"
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"rel": "self",
|
||||
"href": "http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f0e75433e"
|
||||
},
|
||||
{
|
||||
"rel": "bookmark",
|
||||
"href": "http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f0e75433e"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sharedIpGroups
|
||||
xmlns="http://docs.openstack.org/compute/api/v1.1"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<sharedIpGroup
|
||||
id="52415800-8b69-11e0-9b19-734f68ab4a9f"
|
||||
name="Shared IP Group 1">
|
||||
<servers>
|
||||
<server id="52415800-8b69-11e0-9b19-734f0272444a"/>
|
||||
<server id="52415800-8b69-11e0-9b19-734f3b0d4465"/>
|
||||
</servers>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f68ab4a9f"/>
|
||||
</sharedIpGroup>
|
||||
<sharedIpGroup
|
||||
id="52415800-8b69-11e0-9b19-734f0e75433e"
|
||||
name="Shared IP Group 2">
|
||||
<servers>
|
||||
<server id="52415800-8b69-11e0-9b19-734f10c97171"/>
|
||||
<server id="52415800-8b69-11e0-9b19-734f4306ea92"/>
|
||||
<server id="52415800-8b69-11e0-9b19-734f216543fd"/>
|
||||
</servers>
|
||||
<atom:link
|
||||
rel="self"
|
||||
href="http://servers.api.openstack.org/v1.1/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f0e75433e"/>
|
||||
<atom:link
|
||||
rel="bookmark"
|
||||
href="http://servers.api.openstack.org/1234/shared_ip_groups/52415800-8b69-11e0-9b19-734f0e75433e"/>
|
||||
</sharedIpGroup>
|
||||
</sharedIpGroups>
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"ipv6AddressRange":
|
||||
{
|
||||
"value":"2001:4800:7800:0500:DA39:A3EE:FF00:0000/96"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<aide:ipv6AddressRange xmlns:aide="http://docs.rackspacecloud.com/servers/api/ext/aide/v1.0"
|
||||
value="2001:4800:7800:0500:DA39:A3EE:FF00:0000/96"/>
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"limits": {
|
||||
"rate": [
|
||||
{
|
||||
"uri": "*",
|
||||
"regex": ".*",
|
||||
"limit": [
|
||||
{
|
||||
"value": 10,
|
||||
"verb": "POST",
|
||||
"remaining": 2,
|
||||
"unit": "MINUTE",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
},
|
||||
{
|
||||
"value": 10,
|
||||
"verb": "PUT",
|
||||
"remaining": 2,
|
||||
"unit": "MINUTE",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
},
|
||||
{
|
||||
"value": 100,
|
||||
"verb": "DELETE",
|
||||
"remaining": 100,
|
||||
"unit": "MINUTE",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"uri": "*changes-since*",
|
||||
"regex": "changes-since",
|
||||
"limit": [
|
||||
{
|
||||
"value": 3,
|
||||
"verb": "GET",
|
||||
"remaining": 3,
|
||||
"unit": "MINUTE",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"uri": "*/servers",
|
||||
"regex": "^/servers",
|
||||
"limit": [
|
||||
{
|
||||
"verb": "POST",
|
||||
"value": 25,
|
||||
"remaining": 24,
|
||||
"unit": "DAY",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"absolute": {
|
||||
"maxTotalRAMSize": 51200,
|
||||
"maxServerMeta": 5,
|
||||
"maxImageMeta": 5,
|
||||
"maxPersonality": 5,
|
||||
"maxPersonalitySize": 10240
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<limits xmlns="http://docs.openstack.org/common/api/v1.0">
|
||||
<rates>
|
||||
<rate uri="*" regex=".*">
|
||||
<limit value="10" verb="POST" remaining="2"
|
||||
unit="MINUTE"
|
||||
next-available="2011-12-15T22:42:45Z"/>
|
||||
<limit value="10" verb="PUT" remaining="2"
|
||||
unit="MINUTE"
|
||||
next-available="2011-12-15T22:42:45Z"/>
|
||||
<limit value="100" verb="DELETE" remaining="100"
|
||||
unit="MINUTE"
|
||||
next-available="2011-12-15T22:42:45Z"/>
|
||||
</rate>
|
||||
<rate uri="*changes-since*" regex="changes-since">
|
||||
<limit value="3" verb="GET" remaining="3"
|
||||
unit="MINUTE"
|
||||
next-available="2011-12-15T22:42:45Z"/>
|
||||
</rate>
|
||||
<rate uri="*/servers" regex="^/servers">
|
||||
<limit verb="POST" value="25" remaining="24"
|
||||
unit="DAY"
|
||||
next-available="2011-12-15T22:42:45Z"/>
|
||||
</rate>
|
||||
</rates>
|
||||
<absolute>
|
||||
<limit name="maxTotalRAMSize" value="51200"/>
|
||||
<limit name="maxServerMeta" value="5"/>
|
||||
<limit name="maxImageMeta" value="5"/>
|
||||
<limit name="maxPersonality" value="5"/>
|
||||
<limit name="maxPersonalitySize" value="10240"/>
|
||||
</absolute>
|
||||
</limits>
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"limits": {
|
||||
"rate": [
|
||||
{
|
||||
"uri": "*",
|
||||
"regex": ".*",
|
||||
"limit": [
|
||||
{
|
||||
"value": 10,
|
||||
"verb": "POST",
|
||||
"remaining": 2,
|
||||
"unit": "MINUTE",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
},
|
||||
{
|
||||
"value": 10,
|
||||
"verb": "PUT",
|
||||
"remaining": 2,
|
||||
"unit": "MINUTE",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
},
|
||||
{
|
||||
"value": 3,
|
||||
"verb": "GET",
|
||||
"remaining": 3,
|
||||
"unit": "MINUTE",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
},
|
||||
{
|
||||
"value": 100,
|
||||
"verb": "DELETE",
|
||||
"remaining": 100,
|
||||
"unit": "MINUTE",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"uri": "*/servers",
|
||||
"regex": "^/servers",
|
||||
"limit": [
|
||||
{
|
||||
"verb": "POST",
|
||||
"value": 25,
|
||||
"remaining": 24,
|
||||
"unit": "DAY",
|
||||
"next-available": "2011-12-15T22:42:45Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue