Documentation ¶
Overview ¶
Package api provides access to the platform API, in all forms supported by the config context (aka access profile)
Package api provides access to the platform API, in all forms supported by the config context (aka access profile)
Index ¶
- Constants
- func HTTPGet(path string, out any, options *Options) error
- func HTTPPost(path string, body []byte, out any, options *Options) error
- func JSONDelete(path string, out any, options *Options) error
- func JSONGet(path string, out any, options *Options) error
- func JSONGetCollection(path string, out any, options *Options) error
- func JSONPatch(path string, body any, out any, options *Options) error
- func JSONPost(path string, body any, out any, options *Options) error
- func JSONPut(path string, body any, out any, options *Options) error
- func JSONRequest(method string, path string, body any, out any, options *Options) error
- func Login() error
- type Options
Constants ¶
const RESOLVER_HOST = "observe-tenant-lookup-api"
Variables ¶
This section is empty.
Functions ¶
func HTTPGet ¶
HTTPGet performs a GET request with HTTP command and response - Accept and Content-Type headers are provided by the caller
func HTTPPost ¶
HTTPPost performs a POST request with HTTP command and response - Accept and Content-Type headers are provided by the caller
func JSONDelete ¶
JSONGet performs a GET request and parses the response as JSON
func JSONGetCollection ¶
JSONGetCollection performs a GET request and parses the response as JSON, handling pagination per https://www.rfc-editor.org/rfc/rfc5988, https://developer.cisco.com/api-guidelines/#rest-style/API.REST.STYLE.25 and https://developer.cisco.com/api-guidelines/#rest-style/API.REST.STYLE.24
func JSONRequest ¶
JSONPatch performs a http request and parses the response as JSON, allowing the http method to be specified
func Login ¶
func Login() error
Login performs a login into the platform API and saves the provided access token. Login respects different access profile types (when supported) to provide the correct login mechanism for each. Currently, only service principal is supported; in the future we expect to support no-auth (for development environments) and SSO/OAuth login using the same user credentials as the browser login.