Skip to content

Latest commit

 

History

History
428 lines (271 loc) · 12.9 KB

ConnectionManagementApi.md

File metadata and controls

428 lines (271 loc) · 12.9 KB

\ConnectionManagementApi

All URIs are relative to https://api.au.sumologic.com/api

Method HTTP request Description
CreateConnection Post /v1/connections Create a new connection.
DeleteConnection Delete /v1/connections/{id} Delete a connection.
GetConnection Get /v1/connections/{id} Get a connection.
ListConnections Get /v1/connections Get a list of connections.
TestConnection Post /v1/connections/test Test a new connection url.
UpdateConnection Put /v1/connections/{id} Update a connection.

CreateConnection

Connection CreateConnection(ctx).ConnectionDefinition(connectionDefinition).Execute()

Create a new connection.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    connectionDefinition := *openapiclient.NewConnectionDefinition("Type_example", "Name_example") // ConnectionDefinition | Information about the new connection.

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

Path Parameters

Other Parameters

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

Name Type Description Notes
connectionDefinition ConnectionDefinition Information about the new connection.

Return type

Connection

Authorization

basicAuth

HTTP request headers

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

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

DeleteConnection

DeleteConnection(ctx, id).Type_(type_).Execute()

Delete a connection.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | Identifier of the connection to delete.
    type_ := "type__example" // string | Type of connection to delete. Valid values are `WebhookConnection`, `ServiceNowConnection`.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ConnectionManagementApi.DeleteConnection(context.Background(), id).Type_(type_).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ConnectionManagementApi.DeleteConnection``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Identifier of the connection to delete.

Other Parameters

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

Name Type Description Notes

type_ | string | Type of connection to delete. Valid values are `WebhookConnection`, `ServiceNowConnection`. |

Return type

(empty response body)

Authorization

basicAuth

HTTP request headers

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

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

GetConnection

Connection GetConnection(ctx, id).Type_(type_).Execute()

Get a connection.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | Identifier of connection to return.
    type_ := "type__example" // string | Type of connection to return. Valid values are `WebhookConnection`, `ServiceNowConnection`. (default to "WebhookConnection")

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ConnectionManagementApi.GetConnection(context.Background(), id).Type_(type_).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ConnectionManagementApi.GetConnection``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetConnection`: Connection
    fmt.Fprintf(os.Stdout, "Response from `ConnectionManagementApi.GetConnection`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Identifier of connection to return.

Other Parameters

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

Name Type Description Notes

type_ | string | Type of connection to return. Valid values are `WebhookConnection`, `ServiceNowConnection`. | [default to "WebhookConnection"]

Return type

Connection

Authorization

basicAuth

HTTP request headers

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

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

ListConnections

ListConnectionsResponse ListConnections(ctx).Limit(limit).Token(token).Execute()

Get a list of connections.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    limit := int32(56) // int32 | Limit the number of connections returned in the response. The number of connections returned may be less than the `limit`. (optional) (default to 100)
    token := "token_example" // string | Continuation token to get the next page of results. A page object with the next continuation token is returned in the response body. Subsequent GET requests should specify the continuation token to get the next page of results. `token` is set to null when no more pages are left. (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ConnectionManagementApi.ListConnections(context.Background()).Limit(limit).Token(token).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ConnectionManagementApi.ListConnections``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListConnections`: ListConnectionsResponse
    fmt.Fprintf(os.Stdout, "Response from `ConnectionManagementApi.ListConnections`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
limit int32 Limit the number of connections returned in the response. The number of connections returned may be less than the `limit`. [default to 100]
token string Continuation token to get the next page of results. A page object with the next continuation token is returned in the response body. Subsequent GET requests should specify the continuation token to get the next page of results. `token` is set to null when no more pages are left.

Return type

ListConnectionsResponse

Authorization

basicAuth

HTTP request headers

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

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

TestConnection

TestConnectionResponse TestConnection(ctx).ConnectionDefinition(connectionDefinition).Execute()

Test a new connection url.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    connectionDefinition := *openapiclient.NewConnectionDefinition("Type_example", "Name_example") // ConnectionDefinition | Information about the new connection.

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

Path Parameters

Other Parameters

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

Name Type Description Notes
connectionDefinition ConnectionDefinition Information about the new connection.

Return type

TestConnectionResponse

Authorization

basicAuth

HTTP request headers

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

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

UpdateConnection

Connection UpdateConnection(ctx, id).ConnectionDefinition(connectionDefinition).Execute()

Update a connection.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | Identifier of the connection to update.
    connectionDefinition := *openapiclient.NewConnectionDefinition("Type_example", "Name_example") // ConnectionDefinition | Information to update about the connection.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ConnectionManagementApi.UpdateConnection(context.Background(), id).ConnectionDefinition(connectionDefinition).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ConnectionManagementApi.UpdateConnection``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateConnection`: Connection
    fmt.Fprintf(os.Stdout, "Response from `ConnectionManagementApi.UpdateConnection`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Identifier of the connection to update.

Other Parameters

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

Name Type Description Notes

connectionDefinition | ConnectionDefinition | Information to update about the connection. |

Return type

Connection

Authorization

basicAuth

HTTP request headers

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

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