Skip to content

Latest commit

 

History

History
720 lines (473 loc) · 19.7 KB

ServicesApi.md

File metadata and controls

720 lines (473 loc) · 19.7 KB

\ServicesApi

All URIs are relative to https://app.koyeb.com

Method HTTP request Description
CreateService Post /v1/services Create Service
DeleteService Delete /v1/services/{id} Delete Service
GetService Get /v1/services/{id} Get Service
ListServiceEvents Get /v1/service_events List Service events
ListServices Get /v1/services List Services
PauseService Post /v1/services/{id}/pause Pause Service
ReDeploy Post /v1/services/{id}/redeploy ReDeploy Service
ResumeService Post /v1/services/{id}/resume Resume Service
UpdateService Put /v1/services/{id} Update Service
UpdateService2 Patch /v1/services/{id} Update Service

CreateService

CreateServiceReply CreateService(ctx).Service(service).DryRun(dryRun).Execute()

Create Service

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    service := *openapiclient.NewCreateService() // CreateService | 
    dryRun := true // bool | If set only run validation (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ServicesApi.CreateService(context.Background()).Service(service).DryRun(dryRun).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ServicesApi.CreateService``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateService`: CreateServiceReply
    fmt.Fprintf(os.Stdout, "Response from `ServicesApi.CreateService`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
service CreateService
dryRun bool If set only run validation

Return type

CreateServiceReply

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

DeleteService

map[string]interface{} DeleteService(ctx, id).Execute()

Delete Service

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The id of the entity to delete

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ServicesApi.DeleteService(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ServicesApi.DeleteService``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeleteService`: map[string]interface{}
    fmt.Fprintf(os.Stdout, "Response from `ServicesApi.DeleteService`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The id of the entity to delete

Other Parameters

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

Name Type Description Notes

Return type

map[string]interface{}

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

GetService

GetServiceReply GetService(ctx, id).Execute()

Get Service

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The id of the Service

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The id of the Service

Other Parameters

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

Name Type Description Notes

Return type

GetServiceReply

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

ListServiceEvents

ListServiceEventsReply ListServiceEvents(ctx).ServiceId(serviceId).Types(types).Limit(limit).Offset(offset).Order(order).Execute()

List Service events

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    serviceId := "serviceId_example" // string | (Optional) Filter on service id (optional)
    types := []string{"Inner_example"} // []string | (Optional) Filter on service event types (optional)
    limit := "limit_example" // string | (Optional) The number of items to return (optional)
    offset := "offset_example" // string | (Optional) The offset in the list of item to return (optional)
    order := "order_example" // string | (Optional) Sorts the list in the ascending or the descending order (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ServicesApi.ListServiceEvents(context.Background()).ServiceId(serviceId).Types(types).Limit(limit).Offset(offset).Order(order).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ServicesApi.ListServiceEvents``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListServiceEvents`: ListServiceEventsReply
    fmt.Fprintf(os.Stdout, "Response from `ServicesApi.ListServiceEvents`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
serviceId string (Optional) Filter on service id
types []string (Optional) Filter on service event types
limit string (Optional) The number of items to return
offset string (Optional) The offset in the list of item to return
order string (Optional) Sorts the list in the ascending or the descending order

Return type

ListServiceEventsReply

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

ListServices

ListServicesReply ListServices(ctx).AppId(appId).Limit(limit).Offset(offset).Name(name).Types(types).Execute()

List Services

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    appId := "appId_example" // string | (Optional) The id of the app (optional)
    limit := "limit_example" // string | (Optional) The number of items to return (optional)
    offset := "offset_example" // string | (Optional) The offset in the list of item to return (optional)
    name := "name_example" // string | (Optional) A filter for name (optional)
    types := []string{"Types_example"} // []string | (Optional) Filter on service types (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ServicesApi.ListServices(context.Background()).AppId(appId).Limit(limit).Offset(offset).Name(name).Types(types).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ServicesApi.ListServices``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListServices`: ListServicesReply
    fmt.Fprintf(os.Stdout, "Response from `ServicesApi.ListServices`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
appId string (Optional) The id of the app
limit string (Optional) The number of items to return
offset string (Optional) The offset in the list of item to return
name string (Optional) A filter for name
types []string (Optional) Filter on service types

Return type

ListServicesReply

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

PauseService

map[string]interface{} PauseService(ctx, id).Execute()

Pause Service

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The id of the service to pause.

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ServicesApi.PauseService(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ServicesApi.PauseService``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PauseService`: map[string]interface{}
    fmt.Fprintf(os.Stdout, "Response from `ServicesApi.PauseService`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The id of the service to pause.

Other Parameters

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

Name Type Description Notes

Return type

map[string]interface{}

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

ReDeploy

RedeployReply ReDeploy(ctx, id).Info(info).Execute()

ReDeploy Service

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | 
    info := *openapiclient.NewRedeployRequestInfo() // RedeployRequestInfo | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

info | RedeployRequestInfo | |

Return type

RedeployReply

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

ResumeService

map[string]interface{} ResumeService(ctx, id).Execute()

Resume Service

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The id of the service to pause.

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ServicesApi.ResumeService(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ServicesApi.ResumeService``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ResumeService`: map[string]interface{}
    fmt.Fprintf(os.Stdout, "Response from `ServicesApi.ResumeService`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The id of the service to pause.

Other Parameters

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

Name Type Description Notes

Return type

map[string]interface{}

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

UpdateService

UpdateServiceReply UpdateService(ctx, id).Service(service).DryRun(dryRun).Execute()

Update Service

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The id of the entity to update
    service := *openapiclient.NewUpdateService() // UpdateService | 
    dryRun := true // bool | If set, run validation and check that the service exists (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ServicesApi.UpdateService(context.Background(), id).Service(service).DryRun(dryRun).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ServicesApi.UpdateService``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateService`: UpdateServiceReply
    fmt.Fprintf(os.Stdout, "Response from `ServicesApi.UpdateService`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The id of the entity to update

Other Parameters

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

Name Type Description Notes

service | UpdateService | | dryRun | bool | If set, run validation and check that the service exists |

Return type

UpdateServiceReply

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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

UpdateService2

UpdateServiceReply UpdateService2(ctx, id).Service(service).DryRun(dryRun).Execute()

Update Service

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The id of the entity to update
    service := *openapiclient.NewUpdateService() // UpdateService | 
    dryRun := true // bool | If set, run validation and check that the service exists (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ServicesApi.UpdateService2(context.Background(), id).Service(service).DryRun(dryRun).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ServicesApi.UpdateService2``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateService2`: UpdateServiceReply
    fmt.Fprintf(os.Stdout, "Response from `ServicesApi.UpdateService2`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The id of the entity to update

Other Parameters

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

Name Type Description Notes

service | UpdateService | | dryRun | bool | If set, run validation and check that the service exists |

Return type

UpdateServiceReply

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

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