Skip to content

Latest commit

 

History

History
361 lines (232 loc) · 10.2 KB

JobsAPI.md

File metadata and controls

361 lines (232 loc) · 10.2 KB

\JobsAPI

All URIs are relative to https://api.qovery.com

Method HTTP request Description
CloneJob Post /job/{jobId}/clone Clone job
CreateJob Post /environment/{environmentId}/job Create a job
GetDefaultJobAdvancedSettings Get /defaultJobAdvancedSettings List default job advanced settings
GetEnvironmentJobStatus Get /environment/{environmentId}/job/status List all environment job statuses
ListJobs Get /environment/{environmentId}/job List jobs

CloneJob

JobResponse CloneJob(ctx, jobId).CloneServiceRequest(cloneServiceRequest).Execute()

Clone job

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/qovery/qovery-client-go"
)

func main() {
	jobId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Job ID
	cloneServiceRequest := *openapiclient.NewCloneServiceRequest("Name_example", "EnvironmentId_example") // CloneServiceRequest |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.JobsAPI.CloneJob(context.Background(), jobId).CloneServiceRequest(cloneServiceRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `JobsAPI.CloneJob``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CloneJob`: JobResponse
	fmt.Fprintf(os.Stdout, "Response from `JobsAPI.CloneJob`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
jobId string Job ID

Other Parameters

Other parameters are passed through a pointer to a apiCloneJobRequest struct via the builder pattern

Name Type Description Notes

cloneServiceRequest | CloneServiceRequest | |

Return type

JobResponse

Authorization

ApiKeyAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateJob

JobResponse CreateJob(ctx, environmentId).JobRequest(jobRequest).Execute()

Create a job

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/qovery/qovery-client-go"
)

func main() {
	environmentId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Environment ID
	jobRequest := *openapiclient.NewJobRequest("Name_example", *openapiclient.NewHealthcheck()) // JobRequest |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.JobsAPI.CreateJob(context.Background(), environmentId).JobRequest(jobRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `JobsAPI.CreateJob``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateJob`: JobResponse
	fmt.Fprintf(os.Stdout, "Response from `JobsAPI.CreateJob`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
environmentId string Environment ID

Other Parameters

Other parameters are passed through a pointer to a apiCreateJobRequest struct via the builder pattern

Name Type Description Notes

jobRequest | JobRequest | |

Return type

JobResponse

Authorization

ApiKeyAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetDefaultJobAdvancedSettings

JobAdvancedSettings GetDefaultJobAdvancedSettings(ctx).EnvironmentId(environmentId).Execute()

List default job advanced settings

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/qovery/qovery-client-go"
)

func main() {
	environmentId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | When set, returns the defaults of the cluster running this environment, which can differ between clusters (for example build resources). (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.JobsAPI.GetDefaultJobAdvancedSettings(context.Background()).EnvironmentId(environmentId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `JobsAPI.GetDefaultJobAdvancedSettings``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetDefaultJobAdvancedSettings`: JobAdvancedSettings
	fmt.Fprintf(os.Stdout, "Response from `JobsAPI.GetDefaultJobAdvancedSettings`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetDefaultJobAdvancedSettingsRequest struct via the builder pattern

Name Type Description Notes
environmentId string When set, returns the defaults of the cluster running this environment, which can differ between clusters (for example build resources).

Return type

JobAdvancedSettings

Authorization

ApiKeyAuth, bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEnvironmentJobStatus

ReferenceObjectStatusResponseList GetEnvironmentJobStatus(ctx, environmentId).Execute()

List all environment job statuses

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/qovery/qovery-client-go"
)

func main() {
	environmentId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Environment ID

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.JobsAPI.GetEnvironmentJobStatus(context.Background(), environmentId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `JobsAPI.GetEnvironmentJobStatus``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetEnvironmentJobStatus`: ReferenceObjectStatusResponseList
	fmt.Fprintf(os.Stdout, "Response from `JobsAPI.GetEnvironmentJobStatus`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
environmentId string Environment ID

Other Parameters

Other parameters are passed through a pointer to a apiGetEnvironmentJobStatusRequest struct via the builder pattern

Name Type Description Notes

Return type

ReferenceObjectStatusResponseList

Authorization

ApiKeyAuth, bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListJobs

JobResponseList ListJobs(ctx, environmentId).ToUpdate(toUpdate).Execute()

List jobs

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/qovery/qovery-client-go"
)

func main() {
	environmentId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Environment ID
	toUpdate := true // bool | return (or not) results that must be updated (optional) (default to false)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.JobsAPI.ListJobs(context.Background(), environmentId).ToUpdate(toUpdate).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `JobsAPI.ListJobs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListJobs`: JobResponseList
	fmt.Fprintf(os.Stdout, "Response from `JobsAPI.ListJobs`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
environmentId string Environment ID

Other Parameters

Other parameters are passed through a pointer to a apiListJobsRequest struct via the builder pattern

Name Type Description Notes

toUpdate | bool | return (or not) results that must be updated | [default to false]

Return type

JobResponseList

Authorization

ApiKeyAuth, bearerAuth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]