Documentation ¶
Overview ¶
Example ¶
package main import ( "log" "github.com/e-XpertSolutions/f5-rest-client/f5" "github.com/e-XpertSolutions/f5-rest-client/f5/apm" ) func main() { // setup F5 BigIP client f5Client, err := f5.NewBasicClient("https://url-to-bigip", "user", "password") if err != nil { log.Fatal(err) } // Start new transaction. tx, err := f5Client.Begin() if err != nil { log.Fatal(err) } apmClient := apm.New(tx) oauthAppConfig := &apm.OAuthClientAppConfig{ Name: "my_oauth_app_client", AppName: "my_oauth_app_client", AuthType: "secret", GrantPassword: "enabled", Scopes: "scope1", } oauthAppConfig, err = apmClient.OAuthClientApp().Create(*oauthAppConfig) if err != nil { log.Fatal(err) } err = apmClient.OAuthProfile().AppendAppClient("my_oauth_profile", oauthAppConfig.Name) if err != nil { log.Fatal(err) } err = apmClient.AccessProfile().ApplyPolicy("my_access_policy") if err != nil { log.Fatal(err) } if err = tx.Commit(); err != nil { log.Fatal(err) } }
Output:
Index ¶
- Constants
- type APM
- type AccessProfileConfig
- type AccessProfileConfigList
- type AccessProfileResource
- func (r *AccessProfileResource) ApplyPolicy(id string) error
- func (r *AccessProfileResource) Create(item AccessProfileConfig) error
- func (r *AccessProfileResource) Delete(id string) error
- func (r *AccessProfileResource) Edit(id string, item AccessProfileConfig) error
- func (r *AccessProfileResource) Get(id string) (*AccessProfileConfig, error)
- func (r *AccessProfileResource) ListAll() (*AccessProfileConfigList, error)
- type OAuthClientAppConfig
- type OAuthClientAppConfigList
- type OAuthClientAppResource
- func (r *OAuthClientAppResource) Create(item OAuthClientAppConfig) (*OAuthClientAppConfig, error)
- func (r *OAuthClientAppResource) Delete(id string) error
- func (r *OAuthClientAppResource) Edit(id string, item OAuthClientAppConfig) error
- func (r *OAuthClientAppResource) Get(id string) (*OAuthClientAppConfig, error)
- func (r *OAuthClientAppResource) ListAll() (*OAuthClientAppConfigList, error)
- type OAuthProfileConfig
- type OAuthProfileConfigList
- type OAuthProfileResource
- func (r *OAuthProfileResource) AppendAppClient(id string, idClientApp string) error
- func (r *OAuthProfileResource) Create(item OAuthProfileConfig) error
- func (r *OAuthProfileResource) Delete(id string) error
- func (r *OAuthProfileResource) Edit(id string, item OAuthProfileConfig) error
- func (r *OAuthProfileResource) Get(id string) (*OAuthProfileConfig, error)
- func (r *OAuthProfileResource) ListAll() (*OAuthProfileConfigList, error)
Examples ¶
Constants ¶
const AccessProfileEndpoint = "/profile/access"
AccessProfileEndpoint represents the REST resource for managing AccessProfile.
const BasePath = "mgmt/tm/apm"
const OAuthClientAppEndpoint = "/oauth/oauth-client-app"
OAuthClientAppEndpoint represents the REST resource for managing OAuthClientApp.
const OAuthProfileEndpoint = "/profile/oauth"
OAuthProfileEndpoint represents the REST resource for managing OAuthProfile.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APM ¶
type APM struct {
// contains filtered or unexported fields
}
func (APM) AccessProfile ¶
func (apm APM) AccessProfile() *AccessProfileResource
AccessProfile returns a configured AccessProfileResource.
func (APM) OAuthClientApp ¶
func (apm APM) OAuthClientApp() *OAuthClientAppResource
OAuthClientApp returns a configured OAuthClientAppResource.
func (APM) OAuthProfile ¶
func (apm APM) OAuthProfile() *OAuthProfileResource
OAuthProfile returns a configured OAuthProfileResource.
type AccessProfileConfig ¶
type AccessProfileConfig struct { AcceptLanguages []string `json:"acceptLanguages,omitempty"` AccessPolicy string `json:"accessPolicy,omitempty"` AccessPolicyReference struct { Link string `json:"link,omitempty"` } `json:"accessPolicyReference,omitempty"` AccessPolicyTimeout int `json:"accessPolicyTimeout,omitempty"` CustomizationGroup string `json:"customizationGroup,omitempty"` CustomizationGroupReference struct { Link string `json:"link,omitempty"` } `json:"customizationGroupReference,omitempty"` DefaultLanguage string `json:"defaultLanguage,omitempty"` DefaultsFrom string `json:"defaultsFrom,omitempty"` DefaultsFromReference struct { Link string `json:"link,omitempty"` } `json:"defaultsFromReference,omitempty"` DomainGroupsReference struct { IsSubcollection bool `json:"isSubcollection,omitempty"` Link string `json:"link,omitempty"` } `json:"domainGroupsReference,omitempty"` DomainMode string `json:"domainMode,omitempty"` EpsGroup string `json:"epsGroup,omitempty"` EpsGroupReference struct { Link string `json:"link,omitempty"` } `json:"epsGroupReference,omitempty"` ErrormapGroup string `json:"errormapGroup,omitempty"` ErrormapGroupReference struct { Link string `json:"link,omitempty"` } `json:"errormapGroupReference,omitempty"` FrameworkInstallationGroup string `json:"frameworkInstallationGroup,omitempty"` FrameworkInstallationGroupReference struct { Link string `json:"link,omitempty"` } `json:"frameworkInstallationGroupReference,omitempty"` FullPath string `json:"fullPath,omitempty"` GeneralUIGroup string `json:"generalUiGroup,omitempty"` GeneralUIGroupReference struct { Link string `json:"link,omitempty"` } `json:"generalUiGroupReference,omitempty"` Generation int `json:"generation,omitempty"` GenerationAction string `json:"generationAction,omitempty"` HttponlyCookie string `json:"httponlyCookie,omitempty"` InactivityTimeout int `json:"inactivityTimeout,omitempty"` Kind string `json:"kind,omitempty"` LogSettings []string `json:"logSettings,omitempty"` LogSettingsReference []struct { Link string `json:"link,omitempty"` } `json:"logSettingsReference,omitempty"` LogoutURITimeout int `json:"logoutUriTimeout,omitempty"` MaxConcurrentSessions int `json:"maxConcurrentSessions,omitempty"` MaxConcurrentUsers int `json:"maxConcurrentUsers,omitempty"` MaxFailureDelay int `json:"maxFailureDelay,omitempty"` MaxInProgressSessions int `json:"maxInProgressSessions,omitempty"` MaxSessionTimeout int `json:"maxSessionTimeout,omitempty"` MinFailureDelay int `json:"minFailureDelay,omitempty"` ModifiedSinceLastPolicySync string `json:"modifiedSinceLastPolicySync,omitempty"` Name string `json:"name,omitempty"` Partition string `json:"partition,omitempty"` PersistentCookie string `json:"persistentCookie,omitempty"` RestrictToSingleClientIP string `json:"restrictToSingleClientIp,omitempty"` Scope string `json:"scope,omitempty"` SecureCookie string `json:"secureCookie,omitempty"` SelfLink string `json:"selfLink,omitempty"` TmGeneration int `json:"tmGeneration,omitempty"` Type string `json:"type,omitempty"` UseHTTP503OnError string `json:"useHttp_503OnError,omitempty"` UserIdentityMethod string `json:"userIdentityMethod,omitempty"` }
AccessProfileConfig holds the configuration of a single AccessProfile.
type AccessProfileConfigList ¶
type AccessProfileConfigList struct { Items []AccessProfileConfig `json:"items,omitempty"` Kind string `json:"kind,omitempty"` SelfLink string `json:"selflink,omitempty"` }
AccessProfileConfigList holds a list of AccessProfile configuration.
type AccessProfileResource ¶
type AccessProfileResource struct {
// contains filtered or unexported fields
}
AccessProfileResource provides an API to manage AccessProfile configurations.
func (*AccessProfileResource) ApplyPolicy ¶
func (r *AccessProfileResource) ApplyPolicy(id string) error
ApplyPolicy applies APM policy identified by its id.
func (*AccessProfileResource) Create ¶
func (r *AccessProfileResource) Create(item AccessProfileConfig) error
Create a new AccessProfile configuration.
func (*AccessProfileResource) Delete ¶
func (r *AccessProfileResource) Delete(id string) error
Delete a single AccessProfile configuration identified by id.
func (*AccessProfileResource) Edit ¶
func (r *AccessProfileResource) Edit(id string, item AccessProfileConfig) error
Edit a AccessProfile configuration identified by id.
func (*AccessProfileResource) Get ¶
func (r *AccessProfileResource) Get(id string) (*AccessProfileConfig, error)
Get a single AccessProfile configuration identified by id.
func (*AccessProfileResource) ListAll ¶
func (r *AccessProfileResource) ListAll() (*AccessProfileConfigList, error)
ListAll lists all the AccessProfile configurations.
type OAuthClientAppConfig ¶
type OAuthClientAppConfig struct { AccessTokenLifetime int `json:"accessTokenLifetime,omitempty"` AppName string `json:"appName,omitempty"` AuthCodeLifetime int `json:"authCodeLifetime,omitempty"` AuthType string `json:"authType,omitempty"` ClientID string `json:"clientId,omitempty"` ClientSecret string `json:"clientSecret,omitempty"` CustomizationGroup string `json:"customizationGroup,omitempty"` CustomizationGroupReference struct { Link string `json:"link,omitempty"` } `json:"customizationGroupReference,omitempty"` FullPath string `json:"fullPath,omitempty"` GenerateRefreshToken string `json:"generateRefreshToken,omitempty"` Generation int `json:"generation,omitempty"` GrantCode string `json:"grantCode,omitempty"` GrantPassword string `json:"grantPassword,omitempty"` GrantToken string `json:"grantToken,omitempty"` Kind string `json:"kind,omitempty"` Name string `json:"name,omitempty"` Partition string `json:"partition,omitempty"` RefreshTokenLifetime int `json:"refreshTokenLifetime,omitempty"` RefreshTokenUsageLimit int `json:"refreshTokenUsageLimit,omitempty"` ReuseAccessToken string `json:"reuseAccessToken,omitempty"` ReuseRefreshToken string `json:"reuseRefreshToken,omitempty"` Scopes string `json:"scopes,omitempty"` ScopesReference struct { IsSubcollection bool `json:"isSubcollection,omitempty"` Link string `json:"link,omitempty"` } `json:"scopesReference,omitempty"` SelfLink string `json:"selfLink,omitempty"` UseProfileTokenMgmtSettings string `json:"useProfileTokenMgmtSettings,omitempty"` }
OAuthClientAppConfig holds the configuration of a single OAuthClientApp.
type OAuthClientAppConfigList ¶
type OAuthClientAppConfigList struct { Items []OAuthClientAppConfig `json:"items,omitempty"` Kind string `json:"kind,omitempty"` SelfLink string `json:"selflink,omitempty"` }
OAuthClientAppConfigList holds a list of OAuthClientApp configuration.
type OAuthClientAppResource ¶
type OAuthClientAppResource struct {
// contains filtered or unexported fields
}
OAuthClientAppResource provides an API to manage OAuthClientApp configurations.
func (*OAuthClientAppResource) Create ¶
func (r *OAuthClientAppResource) Create(item OAuthClientAppConfig) (*OAuthClientAppConfig, error)
Create a new OAuthClientApp configuration.
func (*OAuthClientAppResource) Delete ¶
func (r *OAuthClientAppResource) Delete(id string) error
Delete a single OAuthClientApp configuration identified by id.
func (*OAuthClientAppResource) Edit ¶
func (r *OAuthClientAppResource) Edit(id string, item OAuthClientAppConfig) error
Edit a OAuthClientApp configuration identified by id.
func (*OAuthClientAppResource) Get ¶
func (r *OAuthClientAppResource) Get(id string) (*OAuthClientAppConfig, error)
Get a single OAuthClientApp configuration identified by id.
func (*OAuthClientAppResource) ListAll ¶
func (r *OAuthClientAppResource) ListAll() (*OAuthClientAppConfigList, error)
ListAll lists all the OAuthClientApp configurations.
type OAuthProfileConfig ¶
type OAuthProfileConfig struct { AccessTokenLifetime int `json:"accessTokenLifetime,omitempty"` AuthCodeLifetime int `json:"authCodeLifetime,omitempty"` AuthURL string `json:"authUrl,omitempty"` ClientAppsReference struct { IsSubcollection bool `json:"isSubcollection,omitempty"` Link string `json:"link,omitempty"` } `json:"clientAppsReference,omitempty"` DbInstance string `json:"dbInstance,omitempty"` DbInstanceReference struct { Link string `json:"link,omitempty"` } `json:"dbInstanceReference,omitempty"` FullPath string `json:"fullPath,omitempty"` GenerateJwtRefreshToken string `json:"generateJwtRefreshToken,omitempty"` GenerateRefreshToken string `json:"generateRefreshToken,omitempty"` Generation int `json:"generation,omitempty"` IgnoreExpiredCert string `json:"ignoreExpiredCert,omitempty"` Kind string `json:"kind,omitempty"` Name string `json:"name,omitempty"` OpaqueToken string `json:"opaqueToken,omitempty"` Partition string `json:"partition,omitempty"` PerUserTokenLimit int `json:"perUserTokenLimit,omitempty"` RefreshTokenLifetime int `json:"refreshTokenLifetime,omitempty"` RefreshTokenUsageLimit int `json:"refreshTokenUsageLimit,omitempty"` ResourceServersReference struct { IsSubcollection bool `json:"isSubcollection,omitempty"` Link string `json:"link,omitempty"` } `json:"resourceServersReference,omitempty"` ReuseAccessToken string `json:"reuseAccessToken,omitempty"` ReuseRefreshToken string `json:"reuseRefreshToken,omitempty"` RotationKeysReference struct { IsSubcollection bool `json:"isSubcollection,omitempty"` Link string `json:"link,omitempty"` } `json:"rotationKeysReference,omitempty"` SelfLink string `json:"selfLink,omitempty"` Subject string `json:"subject,omitempty"` TokenIntrospectionURL string `json:"tokenIntrospectionUrl,omitempty"` TokenIssuanceURL string `json:"tokenIssuanceUrl,omitempty"` TokenRevocationURL string `json:"tokenRevocationUrl,omitempty"` }
OAuthProfileConfig holds the configuration of a single OAuthProfile.
type OAuthProfileConfigList ¶
type OAuthProfileConfigList struct { Items []OAuthProfileConfig `json:"items,omitempty"` Kind string `json:"kind,omitempty"` SelfLink string `json:"selflink,omitempty"` }
OAuthProfileConfigList holds a list of OAuthProfile configuration.
type OAuthProfileResource ¶
type OAuthProfileResource struct {
// contains filtered or unexported fields
}
OAuthProfileResource provides an API to manage OAuthProfile configurations.
func (*OAuthProfileResource) AppendAppClient ¶
func (r *OAuthProfileResource) AppendAppClient(id string, idClientApp string) error
AppendAppClient appends Client Application to an existing OAuth profile.
func (*OAuthProfileResource) Create ¶
func (r *OAuthProfileResource) Create(item OAuthProfileConfig) error
Create a new OAuthProfile configuration.
func (*OAuthProfileResource) Delete ¶
func (r *OAuthProfileResource) Delete(id string) error
Delete a single OAuthProfile configuration identified by id.
func (*OAuthProfileResource) Edit ¶
func (r *OAuthProfileResource) Edit(id string, item OAuthProfileConfig) error
Edit a OAuthProfile configuration identified by id.
func (*OAuthProfileResource) Get ¶
func (r *OAuthProfileResource) Get(id string) (*OAuthProfileConfig, error)
Get a single OAuthProfile configuration identified by id.
func (*OAuthProfileResource) ListAll ¶
func (r *OAuthProfileResource) ListAll() (*OAuthProfileConfigList, error)
ListAll lists all the OAuthProfile configurations.