All URIs are relative to https://api.segmentapis.com
Method | HTTP request | Description |
---|---|---|
GetDailyPerSourceMTUUsage | Get /usage/mtu/sources/daily | Get Daily Per Source MTU Usage |
GetDailyWorkspaceMTUUsage | Get /usage/mtu/daily | Get Daily Workspace MTU Usage |
GetDailyPerSourceMTUUsage200Response GetDailyPerSourceMTUUsage(ctx).Period(period).Pagination(pagination).Execute()
Get Daily Per Source MTU Usage
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
period := "2021-02-01" // string | The start of the usage month, in the ISO-8601 format. This parameter exists in v1.
pagination := *api.NewPaginationInput(10) // PaginationInput | Pagination input for per Source MTU counts. This parameter exists in v1. (optional)
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.MonthlyTrackedUsersAPI.GetDailyPerSourceMTUUsage(ctx).Period(period).Pagination(pagination).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MonthlyTrackedUsersAPI.GetDailyPerSourceMTUUsage``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `GetDailyPerSourceMTUUsage`: GetDailyPerSourceMTUUsage200Response
fmt.Fprintf(os.Stdout, "Response from `MonthlyTrackedUsersAPI.GetDailyPerSourceMTUUsage`: %v\n", resp.GetData())
}
Other parameters are passed through a pointer to a apiGetDailyPerSourceMTUUsageRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
period | string | The start of the usage month, in the ISO-8601 format. This parameter exists in v1. | |
pagination | PaginationInput | Pagination input for per Source MTU counts. This parameter exists in v1. |
GetDailyPerSourceMTUUsage200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDailyWorkspaceMTUUsage200Response GetDailyWorkspaceMTUUsage(ctx).Period(period).Pagination(pagination).Execute()
Get Daily Workspace MTU Usage
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
period := "2021-02-01" // string | The start of the usage month, in the ISO-8601 format. This parameter exists in v1.
pagination := *api.NewPaginationInput(10) // PaginationInput | Pagination input for Workspace MTU counts. This parameter exists in v1. (optional)
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.MonthlyTrackedUsersAPI.GetDailyWorkspaceMTUUsage(ctx).Period(period).Pagination(pagination).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MonthlyTrackedUsersAPI.GetDailyWorkspaceMTUUsage``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `GetDailyWorkspaceMTUUsage`: GetDailyWorkspaceMTUUsage200Response
fmt.Fprintf(os.Stdout, "Response from `MonthlyTrackedUsersAPI.GetDailyWorkspaceMTUUsage`: %v\n", resp.GetData())
}
Other parameters are passed through a pointer to a apiGetDailyWorkspaceMTUUsageRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
period | string | The start of the usage month, in the ISO-8601 format. This parameter exists in v1. | |
pagination | PaginationInput | Pagination input for Workspace MTU counts. This parameter exists in v1. |
GetDailyWorkspaceMTUUsage200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]