API
Package v1alpha3 contains the API Schema definitions for WSO2 APK.
Resource Types:
API ¶
API is the Schema for the apis API
Field | Description | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersion
string
|
dp.wso2.com/v1alpha3
|
||||||||||||||||||||||||||
kind
string
|
API |
||||||||||||||||||||||||||
metadata
Kubernetes meta/v1.ObjectMeta
|
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||||||||||||||
spec
APISpec
|
|
||||||||||||||||||||||||||
status
APIStatus
|
APISpec ¶
(Appears on: API)
APISpec defines the desired state of API
Field | Description |
---|---|
apiName
string
|
APIName is the unique name of the API can be used to uniquely identify an API. |
apiVersion
string
|
APIVersion is the version number of the API. |
isDefaultVersion
bool
|
(Optional)
IsDefaultVersion indicates whether this API version should be used as a default API |
definitionFileRef
string
|
(Optional)
DefinitionFileRef contains the definition of the API in a ConfigMap. |
definitionPath
string
|
DefinitionPath contains the path to expose the API definition. |
production
[]EnvConfig
|
(Optional)
Production contains a list of references to HttpRoutes of type HttpRoute. xref: https://github.com/kubernetes-sigs/gateway-api/blob/main/apis/v1beta1/httproute_types.go |
sandbox
[]EnvConfig
|
(Optional)
Sandbox contains a list of references to HttpRoutes of type HttpRoute. xref: https://github.com/kubernetes-sigs/gateway-api/blob/main/apis/v1beta1/httproute_types.go |
apiType
string
|
APIType denotes the type of the API. Possible values could be REST, GraphQL, GRPC |
basePath
string
|
BasePath denotes the basepath of the API. e.g: /pet-store-api/1.0.6 |
organization
string
|
(Optional)
Organization denotes the organization. related to the API |
systemAPI
bool
|
(Optional)
SystemAPI denotes if it is an internal system API. |
apiProperties
[]Property
|
(Optional)
APIProperties denotes the custom properties of the API. |
environment
string
|
(Optional)
Environment denotes the environment of the API. |
APIStatus ¶
(Appears on: API)
APIStatus defines the observed state of API
Field | Description |
---|---|
deploymentStatus
DeploymentStatus
|
(Optional)
DeploymentStatus denotes the deployment status of the API |
DeploymentStatus ¶
(Appears on: APIStatus)
DeploymentStatus contains the status of the API deployment
Field | Description |
---|---|
status
string
|
Status denotes the state of the API in its lifecycle. Possible values could be Accepted, Invalid, Deploy etc. |
message
string
|
(Optional)
Message represents a user friendly message that explains the current state of the API. |
accepted
bool
|
Accepted represents whether the API is accepted or not. |
transitionTime
Kubernetes meta/v1.Time
|
TransitionTime represents the last known transition timestamp. |
events
[]string
|
(Optional)
Events contains a list of events related to the API. |
EnvConfig ¶
(Appears on: APISpec)
EnvConfig contains the environment specific configuration
Field | Description |
---|---|
routeRefs
[]string
|
RouteRefs denotes the environment of the API. |
Property ¶
(Appears on: APISpec)
Property holds key value pair of APIProperties
Field | Description |
---|---|
name
string
|
|
value
string
|
Generated with gen-crd-api-reference-docs
.
API Sample¶
A single API in the APK project is defined using a set of combined Kubernetes resources.
This is the root level resource for an API. API related metadata are also defined in this CR.
In the following CR, we have defined a REST API by giving the name, context, and version information for the API. We have also referred to the HTTPRoute resource in spec.production.httpRouteRefs[0] path.
apiVersion: dp.wso2.com/v1alpha2
kind: API
metadata:
name: http-bin-api
spec:
apiName: HTTP Bin API
apiType: REST
apiVersion: 1.0.0
basePath: /http-bin-api/1.0.0
isDefaultVersion: true
production:
- httpRouteRefs:
- prod-http-route-http-bin-api
sandbox:
- httpRouteRefs:
- sand-http-route-http-bin-api
organization: apk-org
Refer Manage API for more information on how to configure APIs.