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
- Variables
- 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
- type Problem
Constants ¶
const MAX_COMPLETION_RESULTS = 500
const RESOLVER_HOST = "observe-tenant-lookup-api"
Variables ¶
var FlagCurlifyRequests bool
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 ¶
JSONDelete performs a DELETE 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 ¶
JSONRequest performs an HTTP request and parses the response as JSON, allowing the http method to be specified
Types ¶
type Problem ¶ added in v0.25.0
type Problem struct { Type string `json:"type"` Title string `json:"title"` Detail string `json:"detail"` Status int `json:"status"` Extensions map[string]any }
Problem type is a json object returned for content-type application/problem+json according to the RFC-7807