Skip to content

Latest commit

 

History

History
308 lines (197 loc) · 6.76 KB

File metadata and controls

308 lines (197 loc) · 6.76 KB

\DefaultAPI

All URIs are relative to http://localhost:3000/api

Method HTTP request Description
EventsGet Get /events Get Events related to Semaphore and projects you are part of
EventsLastGet Get /events/last Get last 200 Events related to Semaphore and projects you are part of
InfoGet Get /info Fetches information about semaphore
PingGet Get /ping PING test
WsGet Get /ws Websocket handler

EventsGet

[]Event EventsGet(ctx).Execute()

Get Events related to Semaphore and projects you are part of

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]Event

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain; charset=utf-8

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

EventsLastGet

[]Event EventsLastGet(ctx).Execute()

Get last 200 Events related to Semaphore and projects you are part of

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]Event

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain; charset=utf-8

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

InfoGet

InfoType InfoGet(ctx).Execute()

Fetches information about semaphore

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

InfoType

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain; charset=utf-8

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

PingGet

string PingGet(ctx).Execute()

PING test

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

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]

WsGet

WsGet(ctx).Execute()

Websocket handler

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.DefaultAPI.WsGet(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.WsGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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