Skip to content

Commit

Permalink
client sync
Browse files Browse the repository at this point in the history
  • Loading branch information
robotdan committed Jun 24, 2024
1 parent a3bace2 commit 2e401fe
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
54 changes: 54 additions & 0 deletions pkg/fusionauth/Client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6371,6 +6371,60 @@ func (c *FusionAuthClient) RetrieveSystemConfigurationWithContext(ctx context.Co
return &resp, err
}

// RetrieveSystemHealth
// Retrieves the FusionAuth system health. This API will return 200 if the system is healthy, and 500 if the system is un-healthy.
func (c *FusionAuthClient) RetrieveSystemHealth() (*BaseHTTPResponse, error) {
return c.RetrieveSystemHealthWithContext(context.TODO())
}

// RetrieveSystemHealthWithContext
// Retrieves the FusionAuth system health. This API will return 200 if the system is healthy, and 500 if the system is un-healthy.
func (c *FusionAuthClient) RetrieveSystemHealthWithContext(ctx context.Context) (*BaseHTTPResponse, error) {
var resp BaseHTTPResponse

err := c.StartAnonymous(&resp, nil).
WithUri("/api/health").
WithMethod(http.MethodGet).
Do(ctx)
return &resp, err
}

// RetrieveSystemStatus
// Retrieves the FusionAuth system status. This request is anonymous and does not require an API key. When an API key is not provided the response will contain a single value in the JSON response indicating the current health check.
func (c *FusionAuthClient) RetrieveSystemStatus() (*StatusResponse, error) {
return c.RetrieveSystemStatusWithContext(context.TODO())
}

// RetrieveSystemStatusWithContext
// Retrieves the FusionAuth system status. This request is anonymous and does not require an API key. When an API key is not provided the response will contain a single value in the JSON response indicating the current health check.
func (c *FusionAuthClient) RetrieveSystemStatusWithContext(ctx context.Context) (*StatusResponse, error) {
var resp StatusResponse

err := c.StartAnonymous(&resp, nil).
WithUri("/api/status").
WithMethod(http.MethodGet).
Do(ctx)
return &resp, err
}

// RetrieveSystemStatusUsingAPIKey
// Retrieves the FusionAuth system status using an API key. Using an API key will cause the response to include the product version, health checks and various runtime metrics.
func (c *FusionAuthClient) RetrieveSystemStatusUsingAPIKey() (*StatusResponse, error) {
return c.RetrieveSystemStatusUsingAPIKeyWithContext(context.TODO())
}

// RetrieveSystemStatusUsingAPIKeyWithContext
// Retrieves the FusionAuth system status using an API key. Using an API key will cause the response to include the product version, health checks and various runtime metrics.
func (c *FusionAuthClient) RetrieveSystemStatusUsingAPIKeyWithContext(ctx context.Context) (*StatusResponse, error) {
var resp StatusResponse

err := c.Start(&resp, nil).
WithUri("/api/status").
WithMethod(http.MethodGet).
Do(ctx)
return &resp, err
}

// RetrieveTenant
// Retrieves the tenant for the given Id.
//
Expand Down
14 changes: 14 additions & 0 deletions pkg/fusionauth/Domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -4000,6 +4000,20 @@ type UIConfiguration struct {
MenuFontColor string `json:"menuFontColor,omitempty"`
}

/**
* The public Status API response
*
* @author Daniel DeGroff
*/
type StatusResponse struct {
BaseHTTPResponse
LinkedHashMap
}

func (b *StatusResponse) SetStatus(status int) {
b.StatusCode = status
}

type RegistrationType string

func (e RegistrationType) String() string {
Expand Down

0 comments on commit 2e401fe

Please sign in to comment.