Documentation
¶
Index ¶
- type App
- type AppLifecycle
- type AppMetadata
- type AppRelations
- type Client
- func (c *Client) GetApp(ctx context.Context, appGUID string) (*App, error)
- func (c *Client) ListApps(ctx context.Context) ([]App, []Space, []Organization, error)
- func (c *Client) RestartApp(ctx context.Context, appGUID string) error
- func (c *Client) StopApp(ctx context.Context, appGUID string) (*App, error)
- type IncludedResources
- type Link
- type ListAppsResponse
- type ListAppsResponseWithIncludes
- type Organization
- type RootResponse
- type Space
- type TokenResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
GUID string `json:"guid"`
Name string `json:"name"`
State string `json:"state"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Lifecycle AppLifecycle `json:"lifecycle"`
Relationships AppRelations `json:"relationships"`
Metadata AppMetadata `json:"metadata"`
Links map[string]Link `json:"links"`
}
App represents a Cloud Foundry application.
type AppLifecycle ¶
type AppLifecycle struct {
Type string `json:"type"`
Data json.RawMessage `json:"data"`
}
type AppMetadata ¶
type AppRelations ¶
type AppRelations struct {
Space struct {
Data struct {
GUID string `json:"guid"`
} `json:"data"`
} `json:"space"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient() *Client
NewClient creates a new CF API client from the global config.
func (*Client) ListApps ¶
ListApps fetches all applications from the CF API, following pagination. It tries to include space and org data via the include parameter. If the API doesn't support includes (e.g., Korifi), it falls back to fetching apps only and resolves spaces/orgs separately.
func (*Client) RestartApp ¶
RestartApp restarts an application by its GUID.
type IncludedResources ¶
type IncludedResources struct {
Spaces []Space `json:"spaces,omitempty"`
Organizations []Organization `json:"organizations,omitempty"`
}
IncludedResources holds optionally included related resources.
type ListAppsResponse ¶
type ListAppsResponse struct {
Pagination struct {
TotalResults int `json:"total_results"`
TotalPages int `json:"total_pages"`
Next *Link `json:"next"`
} `json:"pagination"`
Resources []App `json:"resources"`
}
ListAppsResponse represents the paginated response from GET /v3/apps.
type ListAppsResponseWithIncludes ¶
type ListAppsResponseWithIncludes struct {
ListAppsResponse
Included IncludedResources `json:"included"`
}
type Organization ¶
type RootResponse ¶
type RootResponse struct {
Links struct {
Uaa struct {
Href string `json:"href"`
} `json:"uaa"`
Login struct {
Href string `json:"href"`
} `json:"login"`
} `json:"links"`
}
RootResponse represents the CF API root response used to discover the UAA endpoint.
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
}
TokenResponse represents the OAuth2 token response from UAA.