client

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string, ccv3Client *ccv3.Client, accessToken string, apiUrl string, transport http.Transport) *Client

func (Client) BindRunningSecGroupToSpace

func (c Client) BindRunningSecGroupToSpace(secGroupGUID, spaceGUID string, endpoint string) error

func (Client) BindSecurityGroup

func (c Client) BindSecurityGroup(secGroupGUID, spaceGUID string, endpoint string) error

func (Client) BindStagingSecGroupToSpace

func (c Client) BindStagingSecGroupToSpace(secGroupGUID, spaceGUID string, endpoint string) error

func (Client) CurrentUserIsAdmin

func (c Client) CurrentUserIsAdmin() (bool, error)

func (Client) EntitleSecurityGroup

func (c Client) EntitleSecurityGroup(secGroupGUID, orgGUID string) error

func (*Client) GetAccessToken

func (c *Client) GetAccessToken() *string

func (Client) GetApiUrl

func (c Client) GetApiUrl() string

func (Client) GetEndpoint

func (c Client) GetEndpoint() string

func (Client) GetInfo

func (c Client) GetInfo() (model.Info, error)

func (Client) GetOrgByGuid

func (c Client) GetOrgByGuid(guid string) (Organization, error)

func (Client) GetSecGroupByGuid

func (c Client) GetSecGroupByGuid(guid string) (SecurityGroup, error)

func (Client) GetSecGroupByName

func (c Client) GetSecGroupByName(name string) (SecurityGroup, error)

func (Client) GetSpaceByGuid

func (c Client) GetSpaceByGuid(guid string) (Space, error)

func (Client) GetTransport

func (c Client) GetTransport() http.Transport

func (Client) ListOrgManagers

func (c Client) ListOrgManagers(orgGuid string) (User, error)

func (Client) ListSecGroupEntitlements

func (c Client) ListSecGroupEntitlements() ([]model.EntitlementSecGroup, error)

func (Client) ListSecGroups

func (c Client) ListSecGroups(query ...ccv3.Query) (SecurityGroups, error)

func (Client) ListSpaceResources

func (c Client) ListSpaceResources(secGroup SecurityGroup) (SecurityGroup, error)

func (Client) ListUserManagedOrgs

func (c Client) ListUserManagedOrgs(userGuid string) (UserRoles, error)

func (Client) OrgGUIDFromSpaceGUID

func (c Client) OrgGUIDFromSpaceGUID(spaceGuid string) (string, error)

func (Client) RevokeSecurityGroup

func (c Client) RevokeSecurityGroup(secGroupGUID, orgGUID string) error

func (*Client) SetAccessToken

func (c *Client) SetAccessToken(accessToken string)

func (Client) UnBindRunningSecGroupToSpace

func (c Client) UnBindRunningSecGroupToSpace(secGroupGUID, spaceGUID string, endpoint string) error

func (Client) UnBindSecurityGroup

func (c Client) UnBindSecurityGroup(secGroupGUID, spaceGUID string, endpoint string) error

func (Client) UnBindStagingSecGroupToSpace

func (c Client) UnBindStagingSecGroupToSpace(secGroupGUID, spaceGUID string, endpoint string) error

type CloudFoundryError

type CloudFoundryError struct {
	Code        int    `json:"code"`
	ErrorCode   string `json:"error_code"`
	Description string `json:"description"`
}

func (CloudFoundryError) Error

func (cfErr CloudFoundryError) Error() string

type CloudFoundryErrorV3

type CloudFoundryErrorV3 struct {
	Code   int    `json:"code"`
	Title  string `json:"title"`
	Detail string `json:"detail"`
}

func NewCloudFoundryErrorFromV3Errors

func NewCloudFoundryErrorFromV3Errors(cfErrorsV3 CloudFoundryErrorsV3) CloudFoundryErrorV3

CF APIs v3 can return multiple errors, we take the first one and convert it into a V2 model

func (CloudFoundryErrorV3) Error

func (cfErrV3 CloudFoundryErrorV3) Error() string

type CloudFoundryErrorsV3

type CloudFoundryErrorsV3 struct {
	Errors []CloudFoundryErrorV3 `json:"errors"`
}

type CloudFoundryHTTPError

type CloudFoundryHTTPError struct {
	StatusCode int
	Status     string
	Body       string
}

func (CloudFoundryHTTPError) Error

func (e CloudFoundryHTTPError) Error() string

type Data

type Data struct {
	GUID      string `jsonry:"guid,omitempty"`
	SpaceName string `json:"spacename,omitempty"`
	OrgGUID   string `json:"orgguid,omitempty"`
	OrgName   string `json:"orgname,omitempty"`
}

type Organization

type Organization struct {
	GUID      string `json:"guid,omitempty"`
	Name      string `json:"name"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
	QuotaGUID string `json:"-"`
}

type Rule

type Rule struct {
	Protocol    string `json:"protocol"`
	Destination string `json:"destination"`
	Ports       string `json:"ports,omitempty"`
}

type SecurityGroup

type SecurityGroup struct {
	Name             string `jsonry:"name,omitempty"`
	GUID             string `jsonry:"guid,omitempty"`
	CreatedAt        string `json:"created_at"`
	UpdatedAt        string `json:"updated_at"`
	Rules            []Rule `jsonry:"rules,omitempty"`
	Globally_Enabled struct {
		Running bool `json:"running"`
		Staging bool `json:"staging"`
	}
	Relationships struct {
		Running_spaces struct {
			Data []Data
		}

		Staging_spaces struct {
			Data []Data
		}
	}
}

type SecurityGroups

type SecurityGroups struct {
	Resources []SecurityGroup `jsonry:"resources,omitempty"`
}

type Space

type Space struct {
	GUID          string                  `json:"guid,omitempty"`
	Name          string                  `json:"name"`
	CreatedAt     string                  `json:"created_at"`
	UpdatedAt     string                  `json:"updated_at"`
	Relationships resources.Relationships `json:"relationships,omitempty"`
}

type Spaces

type Spaces struct {
	Resources []Space `json:"resources"`
}

type User

type User struct {
	Resources []struct {
		GUID          string `jsonry:"guid,omitempty"`
		CreatedAt     string `json:"created_at"`
		UpdatedAt     string `json:"updated_at"`
		Type          string `jsonry:"type,omitempty"`
		Relationships struct {
			User struct {
				Data struct {
					GUID string `json:"guid"`
				}
			}
		}
	}
}

type UserRoles

type UserRoles struct {
	Resources []struct {
		GUID          string `jsonry:"guid,omitempty"`
		CreatedAt     string `json:"created_at"`
		UpdatedAt     string `json:"updated_at"`
		Type          string `jsonry:"type,omitempty"`
		Relationships struct {
			User struct {
				Data struct {
					GUID string `json:"guid"`
				}
			}
			Space struct {
				Data struct {
					GUID string `json:"guid"`
				}
			}
			Organization struct {
				Data struct {
					GUID string `json:"guid"`
				}
			}
		}
	}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL