All URIs are relative to https://api.lab5e.com
Method | HTTP request | Description |
---|---|---|
CreateCollection | Post /span/collections | Create collection |
DeleteCollection | Delete /span/collections/{collectionId} | Delete collection |
ListCollectionData | Get /span/collections/{collectionId}/data | Retrieve data from devices |
ListCollections | Get /span/collections | List collections |
RetrieveCollection | Get /span/collections/{collectionId} | Retrieve collection |
RetrieveCollectionStats | Get /span/collections/{collectionId}/stats | Retrieve collection statistics |
UpdateCollection | Patch /span/collections/{collectionId} | Update collection |
Collection CreateCollection(ctx).Body(body).Execute()
Create collection
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lab5e/go-spanapi"
)
func main() {
body := *openapiclient.NewCreateCollectionRequest() // CreateCollectionRequest | Request object when creating a collection. The collect ID is assigned by the service.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CollectionsApi.CreateCollection(context.Background()).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CollectionsApi.CreateCollection``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateCollection`: Collection
fmt.Fprintf(os.Stdout, "Response from `CollectionsApi.CreateCollection`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateCollectionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
body | CreateCollectionRequest | Request object when creating a collection. The collect ID is assigned by the service. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Collection DeleteCollection(ctx, collectionId).Execute()
Delete collection
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lab5e/go-spanapi"
)
func main() {
collectionId := "collectionId_example" // string | The ID of the collection you want to delete
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CollectionsApi.DeleteCollection(context.Background(), collectionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CollectionsApi.DeleteCollection``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteCollection`: Collection
fmt.Fprintf(os.Stdout, "Response from `CollectionsApi.DeleteCollection`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
collectionId | string | The ID of the collection you want to delete |
Other parameters are passed through a pointer to a apiDeleteCollectionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListDataResponse ListCollectionData(ctx, collectionId).Limit(limit).Start(start).End(end).Offset(offset).Execute()
Retrieve data from devices
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lab5e/go-spanapi"
)
func main() {
collectionId := "collectionId_example" // string | The collection ID requested. This is included in the request path.
limit := int32(56) // int32 | Limit the number of payloads to return. The default is 512. (optional)
start := "start_example" // string | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. (optional)
end := "end_example" // string | End of time range. The default is the current time stamp. Value is in milliseconds since epoch. (optional)
offset := "offset_example" // string | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CollectionsApi.ListCollectionData(context.Background(), collectionId).Limit(limit).Start(start).End(end).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CollectionsApi.ListCollectionData``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListCollectionData`: ListDataResponse
fmt.Fprintf(os.Stdout, "Response from `CollectionsApi.ListCollectionData`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
collectionId | string | The collection ID requested. This is included in the request path. |
Other parameters are passed through a pointer to a apiListCollectionDataRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
limit | int32 | Limit the number of payloads to return. The default is 512. | start | string | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. | end | string | End of time range. The default is the current time stamp. Value is in milliseconds since epoch. | offset | string | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListCollectionResponse ListCollections(ctx).Execute()
List collections
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lab5e/go-spanapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CollectionsApi.ListCollections(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CollectionsApi.ListCollections``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListCollections`: ListCollectionResponse
fmt.Fprintf(os.Stdout, "Response from `CollectionsApi.ListCollections`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListCollectionsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Collection RetrieveCollection(ctx, collectionId).Upstream(upstream).Downstream(downstream).Execute()
Retrieve collection
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lab5e/go-spanapi"
)
func main() {
collectionId := "collectionId_example" // string | The collection ID of the collection you are requesting
upstream := true // bool | (optional)
downstream := true // bool | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CollectionsApi.RetrieveCollection(context.Background(), collectionId).Upstream(upstream).Downstream(downstream).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CollectionsApi.RetrieveCollection``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RetrieveCollection`: Collection
fmt.Fprintf(os.Stdout, "Response from `CollectionsApi.RetrieveCollection`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
collectionId | string | The collection ID of the collection you are requesting |
Other parameters are passed through a pointer to a apiRetrieveCollectionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
upstream | bool | | downstream | bool | |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CollectionStats RetrieveCollectionStats(ctx, collectionId).Execute()
Retrieve collection statistics
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lab5e/go-spanapi"
)
func main() {
collectionId := "collectionId_example" // string | The collection ID of the collection you are requesting
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CollectionsApi.RetrieveCollectionStats(context.Background(), collectionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CollectionsApi.RetrieveCollectionStats``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RetrieveCollectionStats`: CollectionStats
fmt.Fprintf(os.Stdout, "Response from `CollectionsApi.RetrieveCollectionStats`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
collectionId | string | The collection ID of the collection you are requesting |
Other parameters are passed through a pointer to a apiRetrieveCollectionStatsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Collection UpdateCollection(ctx, collectionId).Body(body).Execute()
Update collection
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/lab5e/go-spanapi"
)
func main() {
collectionId := "collectionId_example" // string | The ID of the collection. This is assigned by the backend.
body := *openapiclient.NewUpdateCollectionBody() // UpdateCollectionBody |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CollectionsApi.UpdateCollection(context.Background(), collectionId).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CollectionsApi.UpdateCollection``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateCollection`: Collection
fmt.Fprintf(os.Stdout, "Response from `CollectionsApi.UpdateCollection`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
collectionId | string | The ID of the collection. This is assigned by the backend. |
Other parameters are passed through a pointer to a apiUpdateCollectionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
body | UpdateCollectionBody | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]