apis

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIGetInfo is the endpoint to get info about an API
	APIGetInfo = "/api/apis/%s"
	// APIGetInfoIncludeDefault is the endpoint to get info about an API and its default version
	APIGetInfoIncludeDefault = "/api/apis/%s?includeDefaultVersion=true"
	// APIGetInfoIncludeDefaultAndSettings retrieves info about the API, its default version, and settings
	APIGetInfoIncludeDefaultAndSettings = "/api/apis/%s?IncludeDefaultVersion=true&IncludeSettings=true"
	// APIGetVersionInfo is the endpoint pattern for getting information about a version, defaulting endpoint enclusion
	APIGetVersionInfo = "/api/apis/versions/%s?IncludeEndpoints=true"
	// APIVersionImplementations is the endpoint for getting implementation info
	APIVersionImplementations = "/api/apis/versions/implementations"
	// APISettings is the endpoint to retrieve only the API's settings, ref. http://docs.akana.com/cm/api/apis/m_apis_getAPISettings.htm
	APISettings = "/api/apis/%s/settings"
)
View Source
const (
	CMLandingIndex         = "/content/home/landing/index.htm"
	CMInternationalization = "/i18n"
	CMCustomLess           = "/less/custom.less"
	CMFavicon              = "/style/images/favicon.ico"
	// CMCustomLessURI should be a template, subsitute in Configuration.Theme
	CMCustomLessURI      = "/resources/theme/default/less?unpack=false"
	CMListAPIsURI        = "/api/apis"
	CMListAppsURI        = "/api/search?sortBy=com.soa.sort.order.alphabetical&count=20&start=0&q=type:app"
	CMListPoliciesURI    = "/api/policies"
	CMListUsersURI       = "/api/search?sort=asc&sortBy=com.soa.sort.order.title_sort&Federation=false&count=20&start=0&q=type:user"
	CMListAPIVersionsURI = "/api/apis/versions"
)
View Source
const (
	// GetAPIVersionsFormat golang fmt format string for http://docs.akana.com/cm/api/apis/m_apis_getAPIVersions.htm
	GetAPIVersionsFormat = "/api/apis/{APIID}/versions"
	// GetAPIVersions2Format is a 2nd golang fmt format string for http://docs.akana.com/cm/api/apis/m_apis_getAPIVersions.htm
	GetAPIVersions2Format = "/api/apis/versions/{APIVersionID}"
)
View Source
const (
	// CMAddAPIURI is the CM endpoint for creating an API
	CMAddAPIURI = "/api/apis"
)
View Source
const (
	// CMExportUsageLogsFormat is a string format for the endpoint http://docs.akana.com/cm/api/apis/m_apis_exportUsageLogs.htm
	CMExportUsageLogsFormat = "/api/apis/versions/%s/txlogs/export"
)
View Source
const (
	// GetMetricsFormat is the golang fmt format string for http://docs.akana.com/cm/api/apis/m_apis_getMetrics.htm
	GetMetricsFormat = "/api/apis/versions/%s/metrics"
)

Variables

This section is empty.

Functions

func APIList

func APIList(config control.Configuration, debug bool) error

APIList returns a list of apis on the platform

func APIListVersions

func APIListVersions(config control.Configuration, debug bool) error

APIListVersions outputs a list of all APIs

func APILogs

func APILogs(apiID string, config control.Configuration, debug bool) error

APILogs lists logs for an API

func APIMetrics

func APIMetrics(apiID string, config control.Configuration, debug bool) error

APIMetrics lists metrics of an API

func APIVersions

func APIVersions(apiID string, config control.Configuration, debug bool) error

APIVersions gets the versions of a particular API

func CreateAPINameOnly

func CreateAPINameOnly(name string, config control.Configuration, debug bool) error

CreateAPINameOnly adds an API to the Platform, but with a name only - no design document http://docs.akana.com/cm/api/apis/m_apis_createAPI.htm

func CreateAPINameOnlyWithEndpoint

func CreateAPINameOnlyWithEndpoint(name string, endpoint string, config control.Configuration, debug bool) error

CreateAPINameOnlyWithEndpoint adds an API with a name and endpoint

func CreateAPIfromExistingService

func CreateAPIfromExistingService(name string, serviceID string, config control.Configuration, debug bool) error

CreateAPIfromExistingService publishes an existing API to the Platform http://docs.akana.com/cm/api/apis/m_apis_createAPI.htm

func CreateAPIwithSpec

func CreateAPIwithSpec(name string, specpath string, config control.Configuration, debug bool) error

CreateAPIwithSpec adds in an API, given an API specification document (swagger/oai, wadl, wsdl, raml) http://docs.akana.com/cm/api/apis/m_apis_createAPI.htm this happens in two steps, first uploading the spec to the CMS staging area, and then adding the API, referring to the uploaded spec This is invoked by: rwctl apis create APINAME --spec PATH_TO_SPECFILE

func ShowDetailsforAPIID

func ShowDetailsforAPIID(apiID string, useVersion bool, config control.Configuration, debug bool) error

ShowDetailsforAPIID outputs API details

Types

type API

type API struct {
	Name       string `json:"name"`
	ID         string `json:"id"`
	Version    string `json:"version"`
	VersionID  string `json:"vid"`
	Endpoint   string `json:"endpoint"`
	Visibility string `json:"visibility"`
}

API is a convenience structure for a CM API

type APIs

type APIs []API

APIs is a collection of API structs

func (APIs) Len

func (slice APIs) Len() int

Len is an implementation of sort interface for length of APIs

func (APIs) Less

func (slice APIs) Less(i, j int) bool

Less is an implementation of sort interface for less comparison

func (APIs) Swap

func (slice APIs) Swap(i, j int)

Swap is an implementation of the sort interface swap function

type APIwithSpec

type APIwithSpec struct {
	DLDescriptor SDR
}

DLDescriptor is used to reference a previously uploaded spec doc

type CreateMechanism

type CreateMechanism struct {
	CreateMechanism string
}

CreateMechanism is used in NameOnlyAPI

type Metric

type Metric struct {
	AvgResponseTime int
	MinResponseTime int
	MaxResponseTime int
	TotalCount      int
	SuccessCount    int
	FaultCount      int
}

Metric is a convenience struct

type MetricCollection

type MetricCollection struct {
	StartTime string
	Metrics   []MetricNameValue `json:"Metric"`
}

MetricCollection in the MetricsResponse

type MetricNameValue

type MetricNameValue struct {
	Name  string
	Value int
}

MetricNameValue is a name:value pair

type MetricNameValueCollection

type MetricNameValueCollection struct {
	Metric []MetricNameValue
}

MetricNameValueCollection is a collection of MetricNameValue pairs

type MetricsResponse

type MetricsResponse struct {
	StartTime string
	EndTime   string
	Interval  []MetricCollection `json:"Interval"`
}

MetricsResponse is the json object that holds metrics

type NameEndpointAPI

type NameEndpointAPI struct {
	APIVersionInfo              NameValue
	AddAPIImplementationRequest ProxyImplementationRequest
}

NameEndpointAPI is the structure for creating an API with a name and endpoint

type NameOnlyAPI

type NameOnlyAPI struct {
	APIVersionInfo              NameValue
	AddAPIImplementationRequest CreateMechanism
}

NameOnlyAPI is the structure for creating an API with name only

type NameValue

type NameValue struct {
	Name string
}

NameValue is a convenience for NameOnlyAPI and NameEndpointAPI

type ProxyImplementationRequest

type ProxyImplementationRequest struct {
	ProxyImplementationRequest TargetEndpointURL
}

ProxyImplementationRequest is for creating an API with a name and endpoint

type SDR

type SDR struct {
	ServiceDescriptorReference ServiceDescriptorReference
}

SDR is a placeholder for ServiceDescriptorReference, used with DLDescriptor, in adding an API with spec doc

type ServiceDescriptorReference

type ServiceDescriptorReference struct {
	ServiceName  string
	FileName     string
	DropoxFileID int `json:"DropboxFileId"`
}

ServiceDescriptorReference represents the needed information for referencing a spec doc

type TargetEndpointURL

type TargetEndpointURL struct {
	TargetEndpointURL []string
}

TargetEndpointURL is a struct to hold endpoints

Jump to

Keyboard shortcuts

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