TrafficApi
All URIs are relative to https://api.ionos.com/billing
TrafficFindByPeriod
var result Traffic = TrafficFindByPeriod(ctx, contract, period)
.Ip(ip)
.Output(output)
.Execute()Example
package main
import (
"context"
"fmt"
"os"
billing "github.com/ionos-cloud/sdk-go-bundle/products/billing"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
contract := int32(56) // int32 | Contract number
period := "2020-01" // string | Period of interest in format YYYY-MM
ip := true // bool | Provide report grouped by IPs (optional)
output := "output_example" // string | The output format (object, array, CSV or all of them) (optional) (default to "all")
configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := billing.NewAPIClient(configuration)
resource, resp, err := apiClient.TrafficApi.TrafficFindByPeriod(context.Background(), contract, period).Ip(ip).Output(output).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TrafficApi.TrafficFindByPeriod``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `TrafficFindByPeriod`: Traffic
fmt.Fprintf(os.Stdout, "Response from `TrafficApi.TrafficFindByPeriod`: %v\n", resource)
}Path Parameters
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
contract
int32
Contract number
period
string
Period of interest in format YYYY-MM
Other Parameters
Other parameters are passed through a pointer to an apiTrafficFindByPeriodRequest struct via the builder pattern
ip
bool
Provide report grouped by IPs
output
string
The output format (object, array, CSV or all of them)
[default to "all"]
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
TrafficGet
Example
Path Parameters
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
contract
int32
Contract number
Other Parameters
Other parameters are passed through a pointer to an apiTrafficGetRequest struct via the builder pattern
ip
bool
Provide report grouped by IPs
output
string
The output format (object, array, CSV or all of them)
[default to "all"]
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
Last updated
Was this helpful?