<commit_before><!--- This section is copied from: https://raw.github.com/gitlabhq/gitlabhq/master/doc/api/README.md -->

# AIR API

All API requests require authentication (if not stated different). You need to pass a `private_token` parameter by url or header.

If no, or an invalid, `private_token` is provided then an error message will be returned with status code 401:

```json
{
  "message": "401 Unauthorized"
}
```

API requests should be prefixed with `api` and the API version. Current API version is equals to `v1`

Example of a valid API request:

```
GET http://example.com/api/v1/appliance_sets?private_token=<PASSWORD>
```

## Status codes

The API is designed to return different status codes according to context and action. In this way if a request results in an error the caller is able to get insight into what went wrong, e.g. status code `422 Unprocessable Entity` is returned if a required attribute is missing from the request. The following list gives an overview of how the API functions generally behave.

API request types:

* `GET` requests access one or more resources and return the result as JSON. Objects array with root equals into resource name (e.g. `appliance_types` for listing all appliance types and `appliance_type` for getting single appliance type) is returned
* `POST` requests return `201 Created` if the resource is successfully created and return the newly created resource as JSON
* `POST` and `PUT` request bodies format needs to the same format as for getting single resource response
* `GET`, `PUT` and `DELETE` return `200 Ok` if the resource is accessed, modified or deleted successfully, the (modified) result is returned as JSON

The following list shows the possible return codes for API requests.

Return values:

* `200 Ok` - The `GET`, `PUT` or `DELETE` request was successful, the resource(s) itself is returned as JSON
* `201 Created` - The `POST` request was successful and the resource is returned as JSON
* `400 Bad Request` - The request cannot be fulfilled due to bad syntax.
* `401 Unauthorized` - The user is not authenticated, a valid user token is necessary, see above
* `403 Forbidden` - The request is not allowed, e.g. the user is not allowed to delete an appliance type
* `404 Not Found` - A resource could not be accessed, e.g. an ID for a resource could not be found
* `405 Method Not Allowed` - The request is not supported
* `409 Conflict` - A conflicting resource already exists, e.g. creating a appliance type with a name that already exists
* `422 Unprocessable Entity` - A required attribute of the API request is missing or in wrong format, e.g. the name of an appliance type is not given
* `500 Server Error` - While handling the request something went wrong on the server side

## Contents

+ [Appliance Types](appliance_types)
+ [Appliance Sets](appliance_sets)
+ [Security Proxies](security_proxies)
+ [Security Policies](security_policies)<commit_msg>missing links to sections added, links href corrected<commit_after><!--- This section is copied from: https://raw.github.com/gitlabhq/gitlabhq/master/doc/api/README.md -->

# AIR API

All API requests require authentication (if not stated different). You need to pass a `private_token` parameter by url or header.

If no, or an invalid, `private_token` is provided then an error message will be returned with status code 401:

```json
{
  "message": "401 Unauthorized"
}
```

API requests should be prefixed with `api` and the API version. Current API version is equals to `v1`

Example of a valid API request:

```
GET http://example.com/api/v1/appliance_sets?private_token=<PASSWORD>
```

## Status codes

The API is designed to return different status codes according to context and action. In this way if a request results in an error the caller is able to get insight into what went wrong, e.g. status code `422 Unprocessable Entity` is returned if a required attribute is missing from the request. The following list gives an overview of how the API functions generally behave.

API request types:

* `GET` requests access one or more resources and return the result as JSON. Objects array with root equals into resource name (e.g. `appliance_types` for listing all appliance types and `appliance_type` for getting single appliance type) is returned
* `POST` requests return `201 Created` if the resource is successfully created and return the newly created resource as JSON
* `POST` and `PUT` request bodies format needs to the same format as for getting single resource response
* `GET`, `PUT` and `DELETE` return `200 Ok` if the resource is accessed, modified or deleted successfully, the (modified) result is returned as JSON

The following list shows the possible return codes for API requests.

Return values:

* `200 Ok` - The `GET`, `PUT` or `DELETE` request was successful, the resource(s) itself is returned as JSON
* `201 Created` - The `POST` request was successful and the resource is returned as JSON
* `400 Bad Request` - The request cannot be fulfilled due to bad syntax.
* `401 Unauthorized` - The user is not authenticated, a valid user token is necessary, see above
* `403 Forbidden` - The request is not allowed, e.g. the user is not allowed to delete an appliance type
* `404 Not Found` - A resource could not be accessed, e.g. an ID for a resource could not be found
* `405 Method Not Allowed` - The request is not supported
* `409 Conflict` - A conflicting resource already exists, e.g. creating a appliance type with a name that already exists
* `422 Unprocessable Entity` - A required attribute of the API request is missing or in wrong format, e.g. the name of an appliance type is not given
* `500 Server Error` - While handling the request something went wrong on the server side

## Contents

+ [Appliance Types](api/appliance_types)
+ [Appliance Sets](api/appliance_sets)
+ [Appliancs](api/appliances)
+ [User Keys](api/user_keys)
+ [Security Proxies](api/security_proxies)
+ [Security Policies](api/security_policies)
{'fraction_non_alphanumeric': 0.07291840480560655, 'fraction_numerical': 0.015684965793425664, 'mean_word_length': 4.5041322314049586, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3345850', 'n_tokens_mistral': 1652, 'n_tokens_neox': 1545, 'n_words': 867}