Skip to content

Latest commit

 

History

History
619 lines (403 loc) · 16.7 KB

File metadata and controls

619 lines (403 loc) · 16.7 KB

\SessionManagementAPI

All URIs are relative to http://localhost

Method HTTP request Description
ApiLogin Post /api/v1/api_login Authenticate user using email and password
ApiToken Put /api/v1/customers/{cUUID}/api_token Regenerate and fetch API token
AppVersion Get /api/v1/app_version appVersion
CustomerCount Get /api/v1/customer_count customerCount
GetAdminNotifications Get /api/v1/customers/{cUUID}/admin_notifications Current list of notifications for admin
GetFilteredLogs Get /api/v1/logs getFilteredLogs
GetLogs Get /api/v1/logs/{maxLines} getLogs
GetSessionInfo Get /api/v1/session_info Get current user and customer uuid. This will not generate or return the API token, use /api_token API for that.
RegisterCustomer Post /api/v1/register Register a customer

ApiLogin

SessionInfo ApiLogin(ctx).CustomerLoginFormData(customerLoginFormData).Request(request).Execute()

Authenticate user using email and password

Example

package main

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

func main() {
	customerLoginFormData := *openapiclient.NewCustomerLoginFormData("Email_example", "Password_example") // CustomerLoginFormData | 
	request := TODO // interface{} |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
customerLoginFormData CustomerLoginFormData
request interface{}

Return type

SessionInfo

Authorization

No authorization required

HTTP request headers

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

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

ApiToken

SessionInfo ApiToken(ctx, cUUID).ApiTokenVersion(apiTokenVersion).Request(request).Execute()

Regenerate and fetch API token

Example

package main

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

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

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SessionManagementAPI.ApiToken(context.Background(), cUUID).ApiTokenVersion(apiTokenVersion).Request(request).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SessionManagementAPI.ApiToken``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ApiToken`: SessionInfo
	fmt.Fprintf(os.Stdout, "Response from `SessionManagementAPI.ApiToken`: %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 apiApiTokenRequest struct via the builder pattern

Name Type Description Notes

apiTokenVersion | int64 | | [default to -1] request | interface{} | |

Return type

SessionInfo

Authorization

No authorization required

HTTP request headers

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

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

AppVersion

map[string]string AppVersion(ctx).Execute()

appVersion

Example

package main

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

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

map[string]string

Authorization

No authorization required

HTTP request headers

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

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

CustomerCount

CustomerCountResp CustomerCount(ctx).Execute()

customerCount

Example

package main

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

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

CustomerCountResp

Authorization

No authorization required

HTTP request headers

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

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

GetAdminNotifications

CurrentAdminNotificationMessages GetAdminNotifications(ctx, cUUID).Execute()

Current list of notifications for admin

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

Name Type Description Notes

Return type

CurrentAdminNotificationMessages

Authorization

No authorization required

HTTP request headers

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

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

GetFilteredLogs

string GetFilteredLogs(ctx).MaxLines(maxLines).UniverseName(universeName).QueryRegex(queryRegex).StartDate(startDate).EndDate(endDate).Execute()

getFilteredLogs

Example

package main

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

func main() {
	maxLines := int32(56) // int32 |  (optional) (default to 10000)
	universeName := "universeName_example" // string |  (optional) (default to "null")
	queryRegex := "queryRegex_example" // string |  (optional) (default to "null")
	startDate := "startDate_example" // string |  (optional) (default to "null")
	endDate := "endDate_example" // string |  (optional) (default to "null")

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SessionManagementAPI.GetFilteredLogs(context.Background()).MaxLines(maxLines).UniverseName(universeName).QueryRegex(queryRegex).StartDate(startDate).EndDate(endDate).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SessionManagementAPI.GetFilteredLogs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetFilteredLogs`: string
	fmt.Fprintf(os.Stdout, "Response from `SessionManagementAPI.GetFilteredLogs`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
maxLines int32 [default to 10000]
universeName string [default to "null"]
queryRegex string [default to "null"]
startDate string [default to "null"]
endDate string [default to "null"]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

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

GetLogs

LogData GetLogs(ctx, maxLines).Execute()

getLogs

Example

package main

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

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

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

LogData

Authorization

No authorization required

HTTP request headers

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

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

GetSessionInfo

SessionInfo GetSessionInfo(ctx).Request(request).Execute()

Get current user and customer uuid. This will not generate or return the API token, use /api_token API for that.

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.SessionManagementAPI.GetSessionInfo(context.Background()).Request(request).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SessionManagementAPI.GetSessionInfo``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetSessionInfo`: SessionInfo
	fmt.Fprintf(os.Stdout, "Response from `SessionManagementAPI.GetSessionInfo`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
request interface{}

Return type

SessionInfo

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]

RegisterCustomer

SessionInfo RegisterCustomer(ctx).CustomerRegisterFormData(customerRegisterFormData).GenerateApiToken(generateApiToken).Request(request).Execute()

Register a customer

Example

package main

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

func main() {
	customerRegisterFormData := *openapiclient.NewCustomerRegisterFormData("Code_example", "Email_example", "Name_example", "Password_example") // CustomerRegisterFormData | 
	generateApiToken := true // bool |  (optional) (default to false)
	request := TODO // interface{} |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
customerRegisterFormData CustomerRegisterFormData
generateApiToken bool [default to false]
request interface{}

Return type

SessionInfo

Authorization

No authorization required

HTTP request headers

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

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