Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Guides > RightScale API 1.5 > Examples > Repositories > Show Repository

Show Repository

Shows a single repository that has been added to an account.

icon_curl_v1.png    

Table of Contents

Curl

Prerequisite:  Example assumes you have previously authenticated, and your valid session cookie is in 'mycookie'.

Example Call

After performing a List Repositories, you can get the repository ID and view the information of an individual repository. This can be beneficial when checking if a fetch has successfully completed after a repository has been created.

#!/bin/sh -e
curl -i -H X_API_VERSION:1.5 -b mycookie -X GET https://my.rightscale.com/api/repositories.xml

Sample Output

The output below displays a repository that has not yet performed a fetch after its creation. Note the blank fetch_status.

Note: The XML output does not have headers (to save space).

<?xml version="1.0" encoding="UTF-8"?>
<repository>
  <links>
    <link rel="self" href="/api/repositories/239957001"/>
  </links>
  <updated_at>2013/09/05 21:31:30 +0000</updated_at>
  <source_type>git</source_type>
  <read_only>false</read_only>
  <credentials>
    <ssh_key>text:</ssh_key>
  </credentials>
  <asset_paths>
    <cookbooks></cookbooks>
  </asset_paths>
  <source>https://github.com/rightscale/rightscale_cookbooks.git</source>
  <created_at>2013/09/05 21:31:30 +0000</created_at>
  <name>GitRepositoryAPIExample</name>
  <fetch_status></fetch_status>
  <id>239957001</id>
  <actions>
    <action rel="cookbook_import_preview"/>
    <action rel="cookbook_import"/>
    <action rel="refetch"/>
    <action rel="resolve"/>
  </actions>
</repository>


The output below displays a repository that has successfully performed a fetch moments after the repository was added. Note the information in fetch_status.

Note: The XML output does not have headers (to save space).

<?xml version="1.0" encoding="UTF-8"?>
<repository>
  <links>
    <link rel="self" href="/api/repositories/239957001"/>
  </links>
  <updated_at>2013/09/05 21:33:07 +0000</updated_at>
  <source_type>git</source_type>
  <read_only>false</read_only>
  <credentials>
    <ssh_key>text:</ssh_key>
  </credentials>
  <asset_paths>
    <cookbooks></cookbooks>
  </asset_paths>
  <source>https://github.com/rightscale/rightscale_cookbooks.git</source>
  <created_at>2013/09/05 21:31:30 +0000</created_at>
  <name>GitRepositoryAPIExample</name>
  <fetch_status>
    <output>
Cookbooks refresh for GitRepositoryAPIExample completed successfully.

Saved results
</output>
    <succeeded_at>2013/09/05 21:33:07 +0000</succeeded_at>
    <succeeded_commit>9b6855d69fb0847e925c4747129c552c8c7971d8</succeeded_commit>
  </fetch_status>
  <id>239957001</id>
  <actions>
    <action rel="cookbook_import_preview"/>
    <action rel="cookbook_import"/>
    <action rel="refetch"/>
    <action rel="resolve"/>
  </actions>
</repository>
You must to post a comment.
Last modified
12:16, 6 Sep 2013

Tags

This page has no custom tags.

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.