Created
March 29, 2018 14:56
-
-
Save AlanCoding/1c09abc851fe3b1ba238f57b3d087b57 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Instances", | |
"description": "# List Instances:\n\nMake a GET request to this resource to retrieve the list of\ninstances.\n\nThe resulting data structure contains:\n\n {\n \"count\": 99,\n \"next\": null,\n \"previous\": null,\n \"results\": [\n ...\n ]\n }\n\nThe `count` field indicates the total number of instances\nfound for the given query. The `next` and `previous` fields provides links to\nadditional results if there are more than will fit on a single page. The\n`results` list contains zero or more instance records. \n\n## Results\n\nEach instance data structure includes the following fields:\n\n* `id`: Database ID for this instance. (integer)\n* `type`: Data type for this instance. (choice)\n* `url`: URL for this instance. (string)\n* `related`: Data structure with URLs of related resources. (object)\n* `uuid`: (string)\n* `hostname`: (string)\n* `created`: Timestamp when this instance was created. (datetime)\n* `modified`: Timestamp when this instance was last modified. (datetime)\n* `capacity_adjustment`: (decimal)\n* `version`: (string)\n* `capacity`: (integer)\n* `consumed_capacity`: (field)\n* `percent_capacity_remaining`: (field)\n* `jobs_running`: Count of jobs in the running or waiting state that are targeted for this instance (integer)\n* `cpu`: (integer)\n* `memory`: (integer)\n* `cpu_capacity`: (integer)\n* `mem_capacity`: (integer)\n* `enabled`: (boolean)\n\n\n\n## Sorting\n\nTo specify that instances are returned in a particular\norder, use the `order_by` query string parameter on the GET request.\n\n ?order_by=name\n\nPrefix the field name with a dash `-` to sort in reverse:\n\n ?order_by=-name\n\nMultiple sorting fields may be specified by separating the field names with a\ncomma `,`:\n\n ?order_by=name,some_other_field\n\n## Pagination\n\nUse the `page_size` query string parameter to change the number of results\nreturned for each request. Use the `page` query string parameter to retrieve\na particular page of results.\n\n ?page_size=100&page=2\n\nThe `previous` and `next` links returned with the results will set these query\nstring parameters automatically.\n\n## Searching\n\nUse the `search` query string parameter to perform a case-insensitive search\nwithin all designated text fields of a model.\n\n ?search=findme\n\n_Added in AWX 1.4_\n\n(_Added in Ansible Tower 3.1.0_) Search across related fields:\n\n ?related__search=findme\n\nNote: If you want to provide more than one search terms, please use multiple\nsearch fields with the same key, like `?related__search=foo&related__search=bar`,\nAll search terms with the same key will be ORed together.\n\n## Filtering\n\nAny additional query string parameters may be used to filter the list of\nresults returned to those matching a given value. Only fields and relations\nthat exist in the database may be used for filtering. Any special characters\nin the specified value should be url-encoded. For example:\n\n ?field=value%20xyz\n\nFields may also span relations, only for fields and relationships defined in\nthe database:\n\n ?other__field=value\n\nTo exclude results matching certain criteria, prefix the field parameter with\n`not__`:\n\n ?not__field=value\n\n(_Added in AWX 1.4_) By default, all query string filters are AND'ed together, so\nonly the results matching *all* filters will be returned. To combine results\nmatching *any* one of multiple criteria, prefix each query string parameter\nwith `or__`:\n\n ?or__field=value&or__field=othervalue\n ?or__not__field=value&or__field=othervalue\n\n(_Added in Ansible Tower 1.4.5_) The default AND filtering applies all filters\nsimultaneously to each related object being filtered across database\nrelationships. The chain filter instead applies filters separately for each\nrelated object. To use, prefix the query string parameter with `chain__`:\n\n ?chain__related__field=value&chain__related__field2=othervalue\n ?chain__not__related__field=value&chain__related__field2=othervalue\n\nIf the first query above were written as\n`?related__field=value&related__field2=othervalue`, it would return only the\nprimary objects where the *same* related object satisfied both conditions. As\nwritten using the chain filter, it would return the intersection of primary\nobjects matching each condition.\n\nField lookups may also be used for more advanced queries, by appending the\nlookup to the field name:\n\n ?field__lookup=value\n\nThe following field lookups are supported:\n\n* `exact`: Exact match (default lookup if not specified).\n* `iexact`: Case-insensitive version of `exact`.\n* `contains`: Field contains value.\n* `icontains`: Case-insensitive version of `contains`.\n* `startswith`: Field starts with value.\n* `istartswith`: Case-insensitive version of `startswith`.\n* `endswith`: Field ends with value.\n* `iendswith`: Case-insensitive version of `endswith`.\n* `regex`: Field matches the given regular expression.\n* `iregex`: Case-insensitive version of `regex`.\n* `gt`: Greater than comparison.\n* `gte`: Greater than or equal to comparison.\n* `lt`: Less than comparison.\n* `lte`: Less than or equal to comparison.\n* `isnull`: Check whether the given field or related object is null; expects a\n boolean value.\n* `in`: Check whether the given field's value is present in the list provided;\n expects a list of items.\n\nBoolean values may be specified as `True` or `1` for true, `False` or `0` for\nfalse (both case-insensitive).\n\nNull values may be specified as `None` or `Null` (both case-insensitive),\nthough it is preferred to use the `isnull` lookup to explicitly check for null\nvalues.\n\nLists (for the `in` lookup) may be specified as a comma-separated list of\nvalues.\n\n(_Added in Ansible Tower 3.1.0_) Filtering based on the requesting user's\nlevel of access by query string parameter.\n\n* `role_level`: Level of role to filter on, such as `admin_role`", | |
"renders": [ | |
"application/json", | |
"text/html" | |
], | |
"parses": [ | |
"application/json" | |
], | |
"actions": { | |
"GET": { | |
"id": { | |
"type": "integer", | |
"label": "ID", | |
"help_text": "Database ID for this instance." | |
}, | |
"type": { | |
"type": "choice", | |
"label": "Type", | |
"help_text": "Data type for this instance.", | |
"choices": [ | |
[ | |
"instance", | |
"Instance" | |
] | |
] | |
}, | |
"url": { | |
"type": "string", | |
"label": "Url", | |
"help_text": "URL for this instance." | |
}, | |
"related": { | |
"type": "object", | |
"label": "Related", | |
"help_text": "Data structure with URLs of related resources." | |
}, | |
"uuid": { | |
"type": "string", | |
"label": "Uuid" | |
}, | |
"hostname": { | |
"type": "string", | |
"label": "Hostname" | |
}, | |
"created": { | |
"type": "datetime", | |
"label": "Created", | |
"help_text": "Timestamp when this instance was created." | |
}, | |
"modified": { | |
"type": "datetime", | |
"label": "Modified", | |
"help_text": "Timestamp when this instance was last modified." | |
}, | |
"capacity_adjustment": { | |
"type": "decimal", | |
"label": "Capacity adjustment" | |
}, | |
"version": { | |
"type": "string", | |
"label": "Version" | |
}, | |
"capacity": { | |
"type": "integer", | |
"label": "Capacity", | |
"min_value": 0 | |
}, | |
"consumed_capacity": { | |
"type": "field", | |
"label": "Consumed capacity", | |
"filterable": false | |
}, | |
"percent_capacity_remaining": { | |
"type": "field", | |
"label": "Percent capacity remaining", | |
"filterable": false | |
}, | |
"jobs_running": { | |
"type": "integer", | |
"label": "Jobs running", | |
"help_text": "Count of jobs in the running or waiting state that are targeted for this instance", | |
"filterable": false | |
}, | |
"cpu": { | |
"type": "integer", | |
"label": "Cpu" | |
}, | |
"memory": { | |
"type": "integer", | |
"label": "Memory" | |
}, | |
"cpu_capacity": { | |
"type": "integer", | |
"label": "Cpu capacity" | |
}, | |
"mem_capacity": { | |
"type": "integer", | |
"label": "Mem capacity" | |
}, | |
"enabled": { | |
"type": "boolean", | |
"label": "Enabled" | |
} | |
} | |
}, | |
"types": [ | |
"instance" | |
], | |
"related_search_fields": [ | |
"rampart_groups__search" | |
], | |
"max_page_size": 200 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment