Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

REST package references


A package reference represents a link to the content (file, directory, archive and so on) that you use for the deployment process.To deploy a package, you must create at least one reference in the package. You cannot deploy a package without a reference.

POST /v1/package_references

Creates a new package reference.

Required attributes

  • name — String name of the package reference
  • server_id — String ID of the associated server
  • package_id — String ID of the parent package
  • url — String of the URL to the reference

    Note

    You must indicate all four mandatory fields to create a reference.

Filters

  • property — Special property setting accessor that takes key value pairs and attaches them to the reference

    Note

    The property value must already exist and must be assigned to the reference.

  • properties_with_values — Hash of key value pairs such as:

     { 'server_url' => 'localhost', 'user_name' => 'admin' }

Common attributes

  • format — Ensure to include an accept header or add .xml or .json to the last path element
  • token — Your API Token for authentication

Errors caused

  • ERROR 403 Forbidden — Occurs when the token is invalid.
  • ERROR 422 Unprocessable entity — Occurs when validation fails; objects and errors are returned.

Examples

To test this method, insert this URL or your valid API key and application host into a browser or HTTP client like wget or curl. For example:

curl -i -H "accept: text/xml"  -H "Content-type: text/xml" -X POST -d "<reference><name>Reference</name><server_id>2</server_id><package_id>123</package_id><url>/path/to/file</url></reference>" http://[rails_host]/v1/references?token=[...your token ...]
curl -i -H "accept: application/json" -H "Content-type: application/json" -X POST -d '{ "reference": { "name" : "Reference", "server_id" : "123", "package_id" : "1234", "url" : "/path/to/file" }}' http://[rails_host]/v1/references/?token=[api_token]

PUT /v1/package_references/[id]

Updates an existing package reference with values from a posted document.

Required attributes

  • name — String name of the package reference
  • server_id — String ID of the associated server
  • package_id — String ID of the parent package
  • url — String of the URL to the reference

    Note

    You must indicate all four mandatory fields to create a reference

Filters

  • property — Special property setting accessor that takes key value pairs and attaches them to the reference

    Note

    The property value must already exist and must be assigned to the reference.

  • properties_with_values — Hash of key value pairs such as:

     { 'server_url' => 'localhost', 'user_name' => 'admin' }

Common attributes

  • format — Ensure to include an accept header or add .xml or .json to the last path element
  • token — Your API Token for authentication

Errors caused

  • ERROR 403 Forbidden — Occurs when the token is invalid.
  • ERROR 422 Unprocessable entity — Occurs when validation fails; objects and errors are returned.

Examples

To test this method, insert this URL or your valid API key and application host into a browser or HTTP client like wget or curl. For example:

curl -i -H "accept: text/xml"  -H "Content-type: text/xml" -X PUT -d "<reference><name>Reference</name><server_id>2</server_id><package_id>123</package_id><url>/path/to/file</url></reference>" http://[rails_host]/v1/references/[reference_id]?token=[...your token ...]
curl -i -H "accept: application/json" -H "Content-type: application/json" -X PUT -d '{ "reference": { "name" : "Reference", "server_id" : "123", "package_id" : "1234", "url" : "/path/to/file" }}' http://[rails_host]/v1/references/[reference_id]?token=[api_token]

DELETE /v1/package_references/[id]

Deletes a package reference by deactivating it.

Common attributes

  • id — Numerical unique ID for the record
  • format — Ensure to include an accept header or add .xml or .json to the last path element
  • token — Your API Token for authentication

Errors caused

  • ERROR 403 Forbidden — Occurs when the token is invalid.
  • ERROR 404 Not found — Occurs when no records are found.

Examples

To test this method, insert this URL or your valid API key and application host into a browser or HTTP client like wget or curl. For example:

curl -i -H "accept: text/xml" -X DELETE http://[rails_host]/v1/references/[reference_id]?token=[api_token]
curl -i -H "accept: application/json" -X DELETE http://[rails_host]/v1/references/[reference_id]?token=[api_token]

 

Related topic

REST packages

REST package instances

 

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*