Skip to content

Latest commit

 

History

History
430 lines (281 loc) · 11.7 KB

File metadata and controls

430 lines (281 loc) · 11.7 KB

\CustomerManagementAPI

All URIs are relative to http://localhost

Method HTTP request Description
CustomerDetail Get /api/v1/customers/{cUUID} Get a customer's details
DeleteCustomer Delete /api/v1/customers/{cUUID} Delete a customer
GetHostInfo Get /api/v1/customers/{cUUID}/host_info Get a customer's host info
ListOfCustomers Get /api/v1/customers List customers
Metrics Post /api/v1/customers/{cUUID}/metrics Add metrics to a customer
UpdateCustomer Put /api/v1/customers/{cUUID} Update a customer

CustomerDetail

CustomerDetailsData CustomerDetail(ctx, cUUID).Execute()

Get a customer's details

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/yugabyte/platform-go-client/v1"
)

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

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

CustomerDetailsData

Authorization

apiKeyAuth

HTTP request headers

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

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

DeleteCustomer

YBPSuccess DeleteCustomer(ctx, cUUID).Request(request).Execute()

Delete a customer

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/yugabyte/platform-go-client/v1"
)

func main() {
	cUUID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
	request := TODO // interface{} |  (optional)

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

request | interface{} | |

Return type

YBPSuccess

Authorization

apiKeyAuth

HTTP request headers

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

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

GetHostInfo

map[string]map[string]interface{} GetHostInfo(ctx, cUUID).Execute()

Get a customer's host info

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/yugabyte/platform-go-client/v1"
)

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

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

map[string]map[string]interface{}

Authorization

apiKeyAuth

HTTP request headers

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

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

ListOfCustomers

[]Customer ListOfCustomers(ctx).Request(request).Execute()

List customers

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/yugabyte/platform-go-client/v1"
)

func main() {
	request := TODO // interface{} |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
request interface{}

Return type

[]Customer

Authorization

apiKeyAuth

HTTP request headers

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

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

Metrics

map[string]map[string]interface{} Metrics(ctx, cUUID).Metrics(metrics).Request(request).Execute()

Add metrics to a customer

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/yugabyte/platform-go-client/v1"
)

func main() {
	cUUID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
	metrics := *openapiclient.NewMetricQueryParams(false, int64(123), "XclusterConfigUuid_example") // MetricQueryParams | Metrics to be added
	request := TODO // interface{} |  (optional)

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

metrics | MetricQueryParams | Metrics to be added | request | interface{} | |

Return type

map[string]map[string]interface{}

Authorization

apiKeyAuth

HTTP request headers

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

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

UpdateCustomer

Customer UpdateCustomer(ctx, cUUID).Customer(customer).Request(request).Execute()

Update a customer

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/yugabyte/platform-go-client/v1"
)

func main() {
	cUUID := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
	customer := *openapiclient.NewCustomerAlertData(*openapiclient.NewAlertingData(), "CallhomeLevel_example", *openapiclient.NewSmtpData()) // CustomerAlertData | Customer data to be updated
	request := TODO // interface{} |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.CustomerManagementAPI.UpdateCustomer(context.Background(), cUUID).Customer(customer).Request(request).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CustomerManagementAPI.UpdateCustomer``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateCustomer`: Customer
	fmt.Fprintf(os.Stdout, "Response from `CustomerManagementAPI.UpdateCustomer`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

customer | CustomerAlertData | Customer data to be updated | request | interface{} | |

Return type

Customer

Authorization

apiKeyAuth

HTTP request headers

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

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