Skip to content

Latest commit

 

History

History
284 lines (185 loc) · 7.37 KB

SourcesAPI.md

File metadata and controls

284 lines (185 loc) · 7.37 KB

\SourcesAPI

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

Method HTTP request Description
GetSource Get /sources/{id} show source
ListAppsForSource Get /sources/{source_id}/apps list apps
ListDeploymentsForSource Get /sources/{source_id}/deployments list deployments
ListSources Get /sources list sources

GetSource

Source GetSource(ctx, id).Execute()

show source

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)

func main() {
	id := int32(56) // int32 | id

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

Source

Authorization

token

HTTP request headers

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

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

ListAppsForSource

ListAppsForSource200Response ListAppsForSource(ctx, sourceId).Page(page).Execute()

list apps

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)

func main() {
	sourceId := int32(56) // int32 | source_id
	page := int32(56) // int32 | current page of results for pagination (optional)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
sourceId int32 source_id

Other Parameters

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

Name Type Description Notes

page | int32 | current page of results for pagination |

Return type

ListAppsForSource200Response

Authorization

token

HTTP request headers

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

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

ListDeploymentsForSource

ListDeploymentsForSource200Response ListDeploymentsForSource(ctx, sourceId).Page(page).Execute()

list deployments

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)

func main() {
	sourceId := int32(56) // int32 | source_id
	page := int32(56) // int32 | current page of results for pagination (optional)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
sourceId int32 source_id

Other Parameters

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

Name Type Description Notes

page | int32 | current page of results for pagination |

Return type

ListDeploymentsForSource200Response

Authorization

token

HTTP request headers

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

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

ListSources

ListSources200Response ListSources(ctx).Page(page).Execute()

list sources

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)

func main() {
	page := int32(56) // int32 | current page of results for pagination (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
page int32 current page of results for pagination

Return type

ListSources200Response

Authorization

token

HTTP request headers

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

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