Skip to content

Latest commit

 

History

History
424 lines (276 loc) · 11.4 KB

CertificatesAPI.md

File metadata and controls

424 lines (276 loc) · 11.4 KB

\CertificatesAPI

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

Method HTTP request Description
CreateCertificate Post /accounts/{account_id}/certificates create certificate
DeleteCertificate Delete /certificates/{id} delete certificate
GetCertificate Get /certificates/{id} show certificate
ListCertificatesForAccount Get /accounts/{account_id}/certificates list certificates
PatchCertificate Patch /certificates/{id} update certificate
UpdateCertificate Put /certificates/{id} update certificate

CreateCertificate

Certificate CreateCertificate(ctx, accountId).CreateCertificateRequest(createCertificateRequest).Execute()

create certificate

Example

package main

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

func main() {
	accountId := int32(56) // int32 | account_id
	createCertificateRequest := *openapiclient.NewCreateCertificateRequest("CertificateBody_example", "PrivateKey_example") // CreateCertificateRequest |  (optional)

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

createCertificateRequest | CreateCertificateRequest | |

Return type

Certificate

Authorization

token

HTTP request headers

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

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

DeleteCertificate

DeleteCertificate(ctx, id).Execute()

delete certificate

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)
	r, err := apiClient.CertificatesAPI.DeleteCertificate(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CertificatesAPI.DeleteCertificate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

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 apiDeleteCertificateRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

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]

GetCertificate

Certificate GetCertificate(ctx, id).Execute()

show certificate

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.CertificatesAPI.GetCertificate(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CertificatesAPI.GetCertificate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetCertificate`: Certificate
	fmt.Fprintf(os.Stdout, "Response from `CertificatesAPI.GetCertificate`: %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 apiGetCertificateRequest struct via the builder pattern

Name Type Description Notes

Return type

Certificate

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]

ListCertificatesForAccount

ListCertificatesForAccount200Response ListCertificatesForAccount(ctx, accountId).Page(page).Execute()

list certificates

Example

package main

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

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

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

page | int32 | current page of results for pagination |

Return type

ListCertificatesForAccount200Response

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]

PatchCertificate

PatchCertificate(ctx, id).UpdateCertificateRequest(updateCertificateRequest).Execute()

update certificate

Example

package main

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

func main() {
	id := int32(56) // int32 | id
	updateCertificateRequest := *openapiclient.NewUpdateCertificateRequest() // UpdateCertificateRequest |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.CertificatesAPI.PatchCertificate(context.Background(), id).UpdateCertificateRequest(updateCertificateRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CertificatesAPI.PatchCertificate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

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 apiPatchCertificateRequest struct via the builder pattern

Name Type Description Notes

updateCertificateRequest | UpdateCertificateRequest | |

Return type

(empty response body)

Authorization

token

HTTP request headers

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

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

UpdateCertificate

UpdateCertificate(ctx, id).UpdateCertificateRequest(updateCertificateRequest).Execute()

update certificate

Example

package main

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

func main() {
	id := int32(56) // int32 | id
	updateCertificateRequest := *openapiclient.NewUpdateCertificateRequest() // UpdateCertificateRequest |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.CertificatesAPI.UpdateCertificate(context.Background(), id).UpdateCertificateRequest(updateCertificateRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CertificatesAPI.UpdateCertificate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

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 apiUpdateCertificateRequest struct via the builder pattern

Name Type Description Notes

updateCertificateRequest | UpdateCertificateRequest | |

Return type

(empty response body)

Authorization

token

HTTP request headers

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

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