# JobsApi

All URIs are relative to *https://www.gitlab.com/api/v4*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**getSingleJob**](#getsinglejob) | **GET** /projects/{id}/jobs/{job_id} | Get a single job by ID|
|[**listProjectJobs**](#listprojectjobs) | **GET** /projects/{id}/jobs | List jobs for a project|
|[**triggerManualJob**](#triggermanualjob) | **POST** /projects/{id}/jobs/{job_id}/play | Run a manual job|

# **getSingleJob**
> APIEntitiesJob getSingleJob()


### Example

```typescript
import {
    JobsApi,
    Configuration,
    DeleteApiV4ProjectsIdRepositoryMergedBranchesIdParameter
} from 'berg';

const configuration = new Configuration();
const apiInstance = new JobsApi(configuration);

let id: DeleteApiV4ProjectsIdRepositoryMergedBranchesIdParameter; //The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths). (default to undefined)
let jobId: number; //The ID of the job (default to undefined)

const { status, data } = await apiInstance.getSingleJob(
    id,
    jobId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | **DeleteApiV4ProjectsIdRepositoryMergedBranchesIdParameter** | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths). | defaults to undefined|
| **jobId** | [**number**] | The ID of the job | defaults to undefined|


### Return type

**APIEntitiesJob**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | A single job object |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **listProjectJobs**
> Array<APIEntitiesJob> listProjectJobs()


### Example

```typescript
import {
    JobsApi,
    Configuration,
    DeleteApiV4ProjectsIdRepositoryMergedBranchesIdParameter
} from 'berg';

const configuration = new Configuration();
const apiInstance = new JobsApi(configuration);

let id: DeleteApiV4ProjectsIdRepositoryMergedBranchesIdParameter; //The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths). (default to undefined)
let scope: Array<string>; //Return all jobs with the specified statuses (optional) (default to undefined)

const { status, data } = await apiInstance.listProjectJobs(
    id,
    scope
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | **DeleteApiV4ProjectsIdRepositoryMergedBranchesIdParameter** | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths). | defaults to undefined|
| **scope** | **Array&lt;string&gt;** | Return all jobs with the specified statuses | (optional) defaults to undefined|


### Return type

**Array<APIEntitiesJob>**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | An array of jobs |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **triggerManualJob**
> triggerManualJob()


### Example

```typescript
import {
    JobsApi,
    Configuration,
    DeleteApiV4ProjectsIdRepositoryMergedBranchesIdParameter
} from 'berg';

const configuration = new Configuration();
const apiInstance = new JobsApi(configuration);

let id: DeleteApiV4ProjectsIdRepositoryMergedBranchesIdParameter; //The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths). (default to undefined)
let jobId: number; //The ID of the manual job to run (default to undefined)
let jobVariablesAttributes: Array<string>; //An array containing the custom variables available to the job (optional) (default to undefined)

const { status, data } = await apiInstance.triggerManualJob(
    id,
    jobId,
    jobVariablesAttributes
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | **DeleteApiV4ProjectsIdRepositoryMergedBranchesIdParameter** | The ID or [URL-encoded path of the project](https://docs.gitlab.com/api/rest/#namespaced-paths). | defaults to undefined|
| **jobId** | [**number**] | The ID of the manual job to run | defaults to undefined|
| **jobVariablesAttributes** | **Array&lt;string&gt;** | An array containing the custom variables available to the job | (optional) defaults to undefined|


### Return type

void (empty response body)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Job started successfully |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

