From aa359793e308528b06d3bd5786afae1c39743ed6 Mon Sep 17 00:00:00 2001 From: Le Zhang Date: Mon, 23 Oct 2023 14:38:44 -0400 Subject: [PATCH] Update agbot secure api swagger Signed-off-by: Le Zhang --- agreementbot/secure_api.go | 369 ++++------- businesspolicy/business_policy.go | 1 + common/pattern_file.go | 2 + common/service_file.go | 1 + compcheck/comp_check.go | 2 + compcheck/policy_check.go | 1 + compcheck/secretbinding_check.go | 1 + compcheck/userinput_check.go | 1 + docs/agbot_secure_api.json | 782 +++++++++++++++--------- exchange/pattern.go | 1 + exchange/rpc.go | 1 + exchange/service.go | 2 + exchangecommon/nodepolicy.go | 1 + exchangecommon/secret.go | 2 + exchangecommon/service.go | 1 + externalpolicy/constraint_expression.go | 1 + externalpolicy/property_list.go | 2 + policy/user_input.go | 1 + 18 files changed, 620 insertions(+), 552 deletions(-) diff --git a/agreementbot/secure_api.go b/agreementbot/secure_api.go index 3c6c49052..fb58e27cc 100644 --- a/agreementbot/secure_api.go +++ b/agreementbot/secure_api.go @@ -214,6 +214,55 @@ func (a *SecureAPI) listen() { func (a *SecureAPI) haNodeNMPUpdateRequest(w http.ResponseWriter, r *http.Request) { switch r.Method { + // swagger:operation POST /org/{org}/hagroup/{group}/nodemanagement/{node}/{nmpid} haNodeNMPUpdateRequest + // + // Check node NMP update in the HA group + // + // This API checks NMP update availability for the HA group node + // + // --- + // consumes: + // - application/json + // produces: + // - application/json + // parameters: + // - name: org + // in: query + // type: string + // required: true + // description: "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern." + // - name: group + // in: query + // type: string + // required: true + // description: "Show the input which was used to come up with the result." + // - name: node + // in: query + // type: string + // required: true + // description: "The exchange id of the node. Mutually exclusive with node_policy." + // - name: nmpID + // in: query + // type: string + // required: true + // description: "The architecture of the node." + // responses: + // '201': + // description: "Created - Node can begin upgrad" + // schema: + // "$ref": "#/definitions/PutPostDeleteStandardResponse" + // '400': + // description: "Failure - Query parameter invalid" + // schema: + // "$ref": "#/definitions/PutPostDeleteStandardResponse" + // '409': + // description: "Conflict - Node can begin upgrade" + // schema: + // "$ref": "#/definitions/PutPostDeleteStandardResponse" + // '500': + // description: "Failure - Error" + // schema: + // "#ref": "#/definitions/PutPostDeleteStandardResponse" case "POST": pathVars := mux.Vars(r) org := pathVars["org"] @@ -278,62 +327,24 @@ func (a *SecureAPI) policy_compatible(w http.ResponseWriter, r *http.Request) { // parameters: // - name: checkAll // in: query - // type: bool + // type: boolean // required: false // description: "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern." // - name: long // in: query - // type: bool + // type: boolean // required: false // description: "Show the input which was used to come up with the result." - // - name: node_id + // - name: payload // in: body - // type: string - // required: false - // description: "The exchange id of the node. Mutually exclusive with node_policy." - // - name: node_arch - // in: body - // type: string - // required: false - // description: "The architecture of the node." - // - name: node_type - // in: body - // type: string - // required: false - // description: "The type of the node. It can be device or cluster. The default is device. It can be omitted if node_id is specified." - // - name: node_cluster_namespace - // in: body - // type: string - // required: false - // description: "The kubernetes namespace for the node with cluster type. The default namespace is openhorizon-agent. It can be omitted if node_id is specified or the node_type is device." - // - name: node_policy - // in: body - // required: false - // description: "The node policy that will be put in the exchange. Mutually exclusive with node_id." - // schema: - // "$ref": "#/definitions/ExternalPolicy" - // - name: business_policy_id - // in: body - // type: string - // required: false - // description: "The exchange id of the deployment policy. Mutually exclusive with business_policy." - // - name: business_policy - // in: body - // required: false - // description: "The defintion of the deployment policy that will be put in the exchange. Mutually exclusive with business_policy_id." - // schema: - // "$ref": "#/definitions/BusinessPolicy" - // - name: service_policy - // in: body - // required: false - // description: "The service policy that will be put in the exchange. They are for the top level service referenced in the deployment policy. If omitted, the service policy will be retrieved from the exchange. The service policy has the same format as the node policy." + // required: true + // description: "The payload body" // schema: - // "$ref": "#/definitions/ExternalPolicy" + // "$ref": "#/definitions/PolicyCheck" // responses: // '200': // description: "Success" // schema: - // type: compcheck.CompCheckOutput // "$ref": "#/definitions/CompCheckOutput" // '400': // description: "Failure - No input found" @@ -401,73 +412,24 @@ func (a *SecureAPI) userinput_compatible(w http.ResponseWriter, r *http.Request) // parameters: // - name: checkAll // in: query - // type: bool + // type: boolean // required: false // description: "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern." // - name: long // in: query - // type: bool + // type: boolean // required: false // description: "Show the input which was used to come up with the result." - // - name: node_id - // in: body - // type: string - // required: false - // description: "The exchange id of the node. Mutually exclusive with node_user_input." - // - name: node_arch - // in: body - // type: string - // required: false - // description: "The architecture of the node." - // - name: node_type - // in: body - // type: string - // required: false - // description: "The type of the node. It can be device or cluster. The default is device. It can be omitted if node_id is specified." - // - name: node_cluster_namespace + // - name: payload // in: body - // type: string - // required: false - // description: "The kubernetes namespace for the node with cluster type. The default namespace is openhorizon-agent. It can be omitted if node_id is specified." - // - name: node_user_input - // in: body - // required: false - // description: "The user input that will be put in the exchange for the services. Mutually exclusive with node_id." - // schema: - // "$ref": "#/definitions/UserInput" - // - name: business_policy_id - // in: body - // type: string - // required: false - // description: "The exchange id of the deployment policy. Mutually exclusive with business_policy. Mutually exclusive with pattern_id and pattern." - // - name: business_policy - // in: body - // required: false - // description: "The defintion of the deployment policy that will be put in the exchange. Mutually exclusive with business_policy_id. Mutually exclusive with pattern_id and pattern." + // required: true + // description: "The payload body" // schema: - // "$ref": "#/definitions/BusinessPolicy" - // - name: pattern_id - // in: body - // type: string - // required: false - // description: "The exchange id of the pattern. Mutually exclusive with pattern. Mutually exclusive with business_policy_id and business_policy." - // - name: pattern - // in: body - // required: false - // description: "The pattern that will be put in the exchange. Mutually exclusive with pattern_id. Mutually exclusive with business_policy_id and business_policy." - // schema: - // "$ref": "#/definitions/PatternFile" - // - name: service - // in: body - // required: false - // description: "An array of the top level services that will be put in the exchange. They are refrenced in the deployment policy or pattern. If omitted, the services will be retrieved from the exchange." - // schema: - // "$ref": "#/definitions/ServiceFile" + // "$ref": "#/definitions/UserInputCheck" // responses: // '200': // description: "Success" // schema: - // type: compcheck.CompCheckOutput // "$ref": "#/definitions/CompCheckOutput" // '400': // description: "Failure - No input found" @@ -535,62 +497,24 @@ func (a *SecureAPI) secretbinding_compatible(w http.ResponseWriter, r *http.Requ // parameters: // - name: checkAll // in: query - // type: bool + // type: boolean // required: false // description: "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern." // - name: long // in: query - // type: bool + // type: boolean // required: false // description: "Show the input which was used to come up with the result." - // - name: node_id - // in: body - // type: string - // required: false - // description: "The exchange id of the node. Mutually exclusive with node_user_input." - // - name: node_arch - // in: body - // type: string - // required: false - // description: "The architecture of the node." - // - name: node_org - // in: body - // type: string - // required: false - // description: "The organization of the node." - // - name: business_policy_id - // in: body - // type: string - // required: false - // description: "The exchange id of the deployment policy. Mutually exclusive with business_policy. Mutually exclusive with pattern_id and pattern." - // - name: business_policy - // in: body - // required: false - // description: "The defintion of the deployment policy that will be put in the exchange. Mutually exclusive with business_policy_id. Mutually exclusive with pattern_id and pattern." - // schema: - // "$ref": "#/definitions/BusinessPolicy" - // - name: pattern_id - // in: body - // type: string - // required: false - // description: "The exchange id of the pattern. Mutually exclusive with pattern. Mutually exclusive with business_policy_id and business_policy." - // - name: pattern - // in: body - // required: false - // description: "The pattern that will be put in the exchange. Mutually exclusive with pattern_id. Mutually exclusive with business_policy_id and business_policy." - // schema: - // "$ref": "#/definitions/PatternFile" - // - name: service + // - name: payload // in: body - // required: false - // description: "An array of the top level services that will be put in the exchange. They are refrenced in the deployment policy or pattern. If omitted, the services will be retrieved from the exchange." + // required: true + // description: "The payload body" // schema: - // "$ref": "#/definitions/ServiceFile" + // "$ref": "#/definitions/SecretBindingCheck" // responses: // '200': // description: "Success" // schema: - // type: compcheck.CompCheckOutput // "$ref": "#/definitions/CompCheckOutput" // '400': // description: "Failure - No input found" @@ -674,85 +598,24 @@ func (a *SecureAPI) deploy_compatible(w http.ResponseWriter, r *http.Request) { // parameters: // - name: checkAll // in: query - // type: bool + // type: boolean // required: false // description: "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern." // - name: long // in: query - // type: bool + // type: boolean // required: false // description: "Show the input which was used to come up with the result." - // - name: node_id - // in: body - // type: string - // required: false - // description: "The exchange id of the node. Mutually exclusive with node_policy and node_user_input." - // - name: node_arch - // in: body - // type: string - // required: false - // description: "The architecture of the node." - // - name: node_type - // in: body - // type: string - // required: false - // description: "The type of the node. It can be device or cluster. The default is device. It can be omitted if node_id is specified." - // - name: node_cluster_namespace + // - name: payload // in: body - // type: string - // required: false - // description: "The kubernetes namespace for the node with cluster type. The default namespace is openhorizon-agent. It can be omitted if node_id is specified or the node_type is device." - // - name: node_policy - // in: body - // required: false - // description: "The node policy that will be put in the exchange. Mutually exclusive with node_id." - // schema: - // "$ref": "#/definitions/ExternalPolicy" - // - name: node_user_input - // in: body - // required: false - // description: "The user input that will be put in the exchange for the services. Mutually exclusive with node_id." + // required: true + // description: "The payload body" // schema: - // "$ref": "#/definitions/UserInput" - // - name: business_policy_id - // in: body - // type: string - // required: false - // description: "The exchange id of the deployment policy. Mutually exclusive with business_policy. Mutually exclusive with pattern_id and pattern." - // - name: business_policy - // in: body - // required: false - // description: "The defintion of the deployment policy that will be put in the exchange. Mutually exclusive with business_policy_id. Mutually exclusive with pattern_id and pattern." - // schema: - // "$ref": "#/definitions/BusinessPolicy" - // - name: pattern_id - // in: body - // type: string - // required: false - // description: "The exchange id of the pattern. Mutually exclusive with pattern. Mutually exclusive with business_policy_id and business_policy." - // - name: pattern - // in: body - // required: false - // description: "The pattern that will be put in the exchange. Mutually exclusive with pattern_id. Mutually exclusive with business_policy_id and business_policy." - // schema: - // "$ref": "#/definitions/PatternFile" - // - name: service_policy - // in: body - // required: false - // description: "The service policy that will be put in the exchange. They are for the top level service referenced in the deployment policy. If omitted, the service policy will be retrieved from the exchange. The service policy has the same format as the node policy." - // schema: - // "$ref": "#/definitions/ExternalPolicy" - // - name: service - // in: body - // required: false - // description: "An array of the top level services that will be put in the exchange. They are refrenced in the deployment policy or pattern. If omitted, the services will be retrieved from the exchange." - // schema: - // "$ref": "#/definitions/ServiceFile" + // "$ref": "#/definitions/CompCheck" // responses: // '200': // description: "Success" // schema: - // type: compcheck.CompCheckOutput // "$ref": "#/definitions/CompCheckOutput" // '400': // description: "Failure - No input found" @@ -1063,40 +926,40 @@ type SecretRequestInfo struct { // // --- // consumes: -// - application/json -// +// - application/json +// produces: +// - application/json // parameters: -// - name: org -// in: query -// type: string -// required: true -// description: "The organisation name the secret belongs to. Must be the same as the org the user node belongs to." -// - name: user -// in: query -// type: string -// required: false -// description: "The user owning the secret." -// - name: node -// in: query -// type: string -// required: false -// description: "The node the secret is for." -// - name: secret -// in: query -// type: string -// required: false -// description: "The secret key (name)." -// +// - name: org +// in: query +// type: string +// required: true +// description: "The organisation name the secret belongs to. Must be the same as the org the user node belongs to." +// - name: user +// in: query +// type: string +// required: false +// description: "The user owning the secret." +// - name: node +// in: query +// type: string +// required: false +// description: "The node the secret is for." +// - name: secret +// in: query +// type: string +// required: false +// description: "The secret key (name)." // responses: -// -// '400': -// description: "Secret org or name does not meet constraints." -// schema: -// type: string -// '503': -// description: "Secret provider not ready or not configured." -// schema: -// type: string +// '400': +// description: "Secret org or name does not meet constraints." +// schema: +// type: string +// '503': +// description: "Secret provider not ready or not configured." +// schema: +// type: string + func (a *SecureAPI) secretsSetup(w http.ResponseWriter, r *http.Request) *SecretRequestInfo { // Process in the inputs and verify that they are consistent with the logged in user. @@ -1271,6 +1134,8 @@ func (a *SecureAPI) orgSecrets(w http.ResponseWriter, r *http.Request) { // // List all secrets belonging to the org. // + // The API to list all the org secrets + // // --- // consumes: // - application/json @@ -1283,16 +1148,20 @@ func (a *SecureAPI) orgSecrets(w http.ResponseWriter, r *http.Request) { // items: string // '401': // description: "Unauthenticated user." - // type: string + // schema: + // type: string // '403': // description: "Secrets permission denied to user." - // type: string + // schema: + // type: string // '503': // description: "Secret provider unavailable" - // type: string + // schema: + // type: string // '500': // description: "Invalid vault response" - // type: string + // schema: + // type: string case "LIST": if payload, err, httpCode := a.listVaultSecret(info); err != nil { glog.Errorf(APIlogString(err.Error())) @@ -1368,7 +1237,7 @@ func (a *SecureAPI) orgSecret(w http.ResponseWriter, r *http.Request) { writeResponse(w, errMsg, serr.ResponseCode) } case "OPTIONS": - w.Header().Set("Allow", "LIST, OPTIONS") + w.Header().Set("Allow", "GET, LIST, PUT, POST, DELETE, OPTIONS") w.WriteHeader(http.StatusOK) default: w.WriteHeader(http.StatusMethodNotAllowed) @@ -1502,7 +1371,7 @@ func (a *SecureAPI) userSecret(w http.ResponseWriter, r *http.Request) { writeResponse(w, errMsg, serr.ResponseCode) } case "OPTIONS": - w.Header().Set("Allow", "LIST, OPTIONS") + w.Header().Set("Allow", "GET, LIST, PUT, POST, DELETE, OPTIONS") w.WriteHeader(http.StatusOK) default: w.WriteHeader(http.StatusMethodNotAllowed) @@ -1561,7 +1430,7 @@ func (a *SecureAPI) nodeSecret(w http.ResponseWriter, r *http.Request) { writeResponse(w, errMsg, serr.ResponseCode) } case "OPTIONS": - w.Header().Set("Allow", "LIST, OPTIONS") + w.Header().Set("Allow", "GET, LIST, PUT, POST, DELETE, OPTIONS") w.WriteHeader(http.StatusOK) default: w.WriteHeader(http.StatusMethodNotAllowed) @@ -1620,7 +1489,7 @@ func (a *SecureAPI) nodeUserSecret(w http.ResponseWriter, r *http.Request) { writeResponse(w, errMsg, serr.ResponseCode) } case "OPTIONS": - w.Header().Set("Allow", "LIST, OPTIONS") + w.Header().Set("Allow", "GET, LIST, PUT, POST, DELETE, OPTIONS") w.WriteHeader(http.StatusOK) default: w.WriteHeader(http.StatusMethodNotAllowed) diff --git a/businesspolicy/business_policy.go b/businesspolicy/business_policy.go index df30234c8..9591888bf 100644 --- a/businesspolicy/business_policy.go +++ b/businesspolicy/business_policy.go @@ -37,6 +37,7 @@ func (w BusinessPolicy) String() string { w.SecretBinding) } +// swagger:model type ServiceRef struct { Name string `json:"name"` // refers to a service definition in the exchange Org string `json:"org,omitempty"` // the org holding the service definition diff --git a/common/pattern_file.go b/common/pattern_file.go index 1bc65046c..5a830fb60 100644 --- a/common/pattern_file.go +++ b/common/pattern_file.go @@ -6,6 +6,7 @@ import ( "github.com/open-horizon/anax/policy" ) +// swagger:model type AbstractPatternFile interface { GetOrg() string GetServices() []exchange.ServiceReference @@ -92,6 +93,7 @@ func (p *PatternFile) GetClusterNamespace() string { return p.ClusterNamespace } +// swagger:model type ServiceReferenceFile struct { ServiceURL string `json:"serviceUrl"` // refers to a service definition in the exchange ServiceOrg string `json:"serviceOrgid"` // the org holding the service definition diff --git a/common/service_file.go b/common/service_file.go index ba691649c..5304ba357 100644 --- a/common/service_file.go +++ b/common/service_file.go @@ -11,6 +11,7 @@ import ( "golang.org/x/text/message" ) +// swagger:model type AbstractServiceFile interface { GetOrg() string GetURL() string diff --git a/compcheck/comp_check.go b/compcheck/comp_check.go index 6800a3f50..088805bdc 100644 --- a/compcheck/comp_check.go +++ b/compcheck/comp_check.go @@ -61,6 +61,7 @@ func NewCompCheckError(err error, errCode int) *CompCheckError { } // The input format for the comptible check +// swagger:model type CompCheck struct { NodeId string `json:"node_id,omitempty"` NodeArch string `json:"node_arch,omitempty"` @@ -164,6 +165,7 @@ func NewCompCheckOutput(compatible bool, reason map[string]string, input *CompCh } // To store the resource (pattern, bp, services etc) used for compatibility check +// swagger:model type CompCheckResource struct { NodeId string `json:"node_id,omitempty"` NodeArch string `json:"node_arch,omitempty"` diff --git a/compcheck/policy_check.go b/compcheck/policy_check.go index 028c8e440..bad4391bf 100644 --- a/compcheck/policy_check.go +++ b/compcheck/policy_check.go @@ -17,6 +17,7 @@ import ( ) // The input format for the policy check +// swagger:model type PolicyCheck struct { NodeId string `json:"node_id,omitempty"` NodeArch string `json:"node_arch,omitempty"` diff --git a/compcheck/secretbinding_check.go b/compcheck/secretbinding_check.go index f79a13e6f..8cdcbe17d 100644 --- a/compcheck/secretbinding_check.go +++ b/compcheck/secretbinding_check.go @@ -16,6 +16,7 @@ import ( ) // The input format for the userinput check +// swagger:model type SecretBindingCheck struct { NodeId string `json:"node_id,omitempty"` NodeArch string `json:"node_arch,omitempty"` diff --git a/compcheck/userinput_check.go b/compcheck/userinput_check.go index 46256a210..e45d47985 100644 --- a/compcheck/userinput_check.go +++ b/compcheck/userinput_check.go @@ -16,6 +16,7 @@ import ( ) // The input format for the userinput check +// swagger:model type UserInputCheck struct { NodeId string `json:"node_id,omitempty"` NodeArch string `json:"node_arch,omitempty"` diff --git a/docs/agbot_secure_api.json b/docs/agbot_secure_api.json index c0d2bb5af..b17b92a84 100644 --- a/docs/agbot_secure_api.json +++ b/docs/agbot_secure_api.json @@ -29,93 +29,24 @@ "operationId": "deploy_compatible", "parameters": [ { - "type": "bool", + "type": "boolean", "description": "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern.", "name": "checkAll", "in": "query" }, { - "type": "bool", + "type": "boolean", "description": "Show the input which was used to come up with the result.", "name": "long", "in": "query" }, { - "type": "string", - "description": "The exchange id of the node. Mutually exclusive with node_policy and node_user_input.", - "name": "node_id", - "in": "body" - }, - { - "type": "string", - "description": "The architecture of the node.", - "name": "node_arch", - "in": "body" - }, - { - "type": "string", - "description": "The organization of the node.", - "name": "node_org", - "in": "body" - }, - { - "description": "The node policy that will be put in the exchange. Mutually exclusive with node_id.", - "name": "node_policy", - "in": "body", - "schema": { - "$ref": "#/definitions/ExternalPolicy" - } - }, - { - "description": "The user input that will be put in the exchange for the services. Mutually exclusive with node_id.", - "name": "node_user_input", - "in": "body", - "schema": { - "$ref": "#/definitions/UserInput" - } - }, - { - "type": "string", - "description": "The exchange id of the deployment policy. Mutually exclusive with business_policy. Mutually exclusive with pattern_id and pattern.", - "name": "business_policy_id", - "in": "body" - }, - { - "description": "The defintion of the deployment policy that will be put in the exchange. Mutually exclusive with business_policy_id. Mutually exclusive with pattern_id and pattern.", - "name": "business_policy", - "in": "body", - "schema": { - "$ref": "#/definitions/BusinessPolicy" - } - }, - { - "type": "string", - "description": "The exchange id of the pattern. Mutually exclusive with pattern. Mutually exclusive with business_policy_id and business_policy.", - "name": "pattern_id", - "in": "body" - }, - { - "description": "The pattern that will be put in the exchange. Mutually exclusive with pattern_id. Mutually exclusive with business_policy_id and business_policy.", - "name": "pattern", - "in": "body", - "schema": { - "$ref": "#/definitions/PatternFile" - } - }, - { - "description": "The service policy that will be put in the exchange. They are for the top level service referenced in the deployment policy. If omitted, the service policy will be retrieved from the exchange. The service policy has the same format as the node policy.", - "name": "service_policy", - "in": "body", - "schema": { - "$ref": "#/definitions/ExternalPolicy" - } - }, - { - "description": "An array of the top level services that will be put in the exchange. They are refrenced in the deployment policy or pattern. If omitted, the services will be retrieved from the exchange.", - "name": "service", + "description": "The payload body", + "name": "payload", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/ServiceFile" + "$ref": "#/definitions/CompCheck" } } ], @@ -123,7 +54,6 @@ "200": { "description": "Success", "schema": { - "type": "compcheck.CompCheckOutput", "$ref": "#/definitions/CompCheckOutput" } }, @@ -161,57 +91,24 @@ "operationId": "deployCheckPolicyCompatible", "parameters": [ { - "type": "bool", + "type": "boolean", "description": "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern.", "name": "checkAll", "in": "query" }, { - "type": "bool", + "type": "boolean", "description": "Show the input which was used to come up with the result.", "name": "long", "in": "query" }, { - "type": "string", - "description": "The exchange id of the node. Mutually exclusive with node_policy.", - "name": "node_id", - "in": "body" - }, - { - "type": "string", - "description": "The architecture of the node.", - "name": "node_arch", - "in": "body" - }, - { - "description": "The node policy that will be put in the exchange. Mutually exclusive with node_id.", - "name": "node_policy", + "description": "The payload body", + "name": "payload", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/ExternalPolicy" - } - }, - { - "type": "string", - "description": "The exchange id of the deployment policy. Mutually exclusive with business_policy.", - "name": "business_policy_id", - "in": "body" - }, - { - "description": "The defintion of the deployment policy that will be put in the exchange. Mutually exclusive with business_policy_id.", - "name": "business_policy", - "in": "body", - "schema": { - "$ref": "#/definitions/BusinessPolicy" - } - }, - { - "description": "The service policy that will be put in the exchange. They are for the top level service referenced in the deployment policy. If omitted, the service policy will be retrieved from the exchange. The service policy has the same format as the node policy.", - "name": "service_policy", - "in": "body", - "schema": { - "$ref": "#/definitions/ExternalPolicy" + "$ref": "#/definitions/PolicyCheck" } } ], @@ -219,7 +116,6 @@ "200": { "description": "Success", "schema": { - "type": "compcheck.CompCheckOutput", "$ref": "#/definitions/CompCheckOutput" } }, @@ -257,69 +153,24 @@ "operationId": "secretbinding_compatible", "parameters": [ { - "type": "bool", + "type": "boolean", "description": "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern.", "name": "checkAll", "in": "query" }, { - "type": "bool", + "type": "boolean", "description": "Show the input which was used to come up with the result.", "name": "long", "in": "query" }, { - "type": "string", - "description": "The exchange id of the node. Mutually exclusive with node_user_input.", - "name": "node_id", - "in": "body" - }, - { - "type": "string", - "description": "The architecture of the node.", - "name": "node_arch", - "in": "body" - }, - { - "type": "string", - "description": "The organization of the node.", - "name": "node_org", - "in": "body" - }, - { - "type": "string", - "description": "The exchange id of the deployment policy. Mutually exclusive with business_policy. Mutually exclusive with pattern_id and pattern.", - "name": "business_policy_id", - "in": "body" - }, - { - "description": "The defintion of the deployment policy that will be put in the exchange. Mutually exclusive with business_policy_id. Mutually exclusive with pattern_id and pattern.", - "name": "business_policy", - "in": "body", - "schema": { - "$ref": "#/definitions/BusinessPolicy" - } - }, - { - "type": "string", - "description": "The exchange id of the pattern. Mutually exclusive with pattern. Mutually exclusive with business_policy_id and business_policy.", - "name": "pattern_id", - "in": "body" - }, - { - "description": "The pattern that will be put in the exchange. Mutually exclusive with pattern_id. Mutually exclusive with business_policy_id and business_policy.", - "name": "pattern", + "description": "The payload body", + "name": "payload", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/PatternFile" - } - }, - { - "description": "An array of the top level services that will be put in the exchange. They are refrenced in the deployment policy or pattern. If omitted, the services will be retrieved from the exchange.", - "name": "service", - "in": "body", - "schema": { - "$ref": "#/definitions/ServiceFile" + "$ref": "#/definitions/SecretBindingCheck" } } ], @@ -327,7 +178,6 @@ "200": { "description": "Success", "schema": { - "type": "compcheck.CompCheckOutput", "$ref": "#/definitions/CompCheckOutput" } }, @@ -365,98 +215,119 @@ "operationId": "userinputCompatible", "parameters": [ { - "type": "bool", + "type": "boolean", "description": "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern.", "name": "checkAll", "in": "query" }, { - "type": "bool", + "type": "boolean", "description": "Show the input which was used to come up with the result.", "name": "long", "in": "query" }, { - "type": "string", - "description": "The exchange id of the node. Mutually exclusive with node_user_input.", - "name": "node_id", - "in": "body" - }, - { - "type": "string", - "description": "The architecture of the node.", - "name": "node_arch", - "in": "body" - }, - { - "description": "The user input that will be put in the exchange for the services. Mutually exclusive with node_id.", - "name": "node_user_input", + "description": "The payload body", + "name": "payload", "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UserInputCheck" + } + } + ], + "responses": { + "200": { + "description": "Success", "schema": { - "$ref": "#/definitions/UserInput" + "$ref": "#/definitions/CompCheckOutput" } }, - { - "type": "string", - "description": "The exchange id of the deployment policy. Mutually exclusive with business_policy. Mutually exclusive with pattern_id and pattern.", - "name": "business_policy_id", - "in": "body" + "400": { + "description": "Failure - No input found", + "schema": { + "type": "string" + } }, - { - "description": "The defintion of the deployment policy that will be put in the exchange. Mutually exclusive with business_policy_id. Mutually exclusive with pattern_id and pattern.", - "name": "business_policy", - "in": "body", + "401": { + "description": "Failure - Failed to authenticate", "schema": { - "$ref": "#/definitions/BusinessPolicy" + "type": "string" } }, + "500": { + "description": "Failure - Error", + "schema": { + "type": "string" + } + } + } + } + }, + "/org/{org}/hagroup/{group}/nodemanagement/{node}/{nmpid}": { + "post": { + "description": "This API checks NMP update availability for the HA group node", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Check node NMP update in the HA group", + "operationId": "haNodeNMPUpdateRequest", + "parameters": [ { "type": "string", - "description": "The exchange id of the pattern. Mutually exclusive with pattern. Mutually exclusive with business_policy_id and business_policy.", - "name": "pattern_id", - "in": "body" + "description": "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern.", + "name": "org", + "in": "query", + "required": true }, { - "description": "The pattern that will be put in the exchange. Mutually exclusive with pattern_id. Mutually exclusive with business_policy_id and business_policy.", - "name": "pattern", - "in": "body", - "schema": { - "$ref": "#/definitions/PatternFile" - } + "type": "string", + "description": "Show the input which was used to come up with the result.", + "name": "group", + "in": "query", + "required": true }, { - "description": "An array of the top level services that will be put in the exchange. They are refrenced in the deployment policy or pattern. If omitted, the services will be retrieved from the exchange.", - "name": "service", - "in": "body", - "schema": { - "$ref": "#/definitions/ServiceFile" - } + "type": "string", + "description": "The exchange id of the node. Mutually exclusive with node_policy.", + "name": "node", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "The architecture of the node.", + "name": "nmpID", + "in": "query", + "required": true } ], "responses": { - "200": { - "description": "Success", + "201": { + "description": "Created - Node can begin upgrad", "schema": { - "type": "compcheck.CompCheckOutput", - "$ref": "#/definitions/CompCheckOutput" + "$ref": "#/definitions/PutPostDeleteStandardResponse" } }, "400": { - "description": "Failure - No input found", + "description": "Failure - Query parameter invalid", "schema": { - "type": "string" + "$ref": "#/definitions/PutPostDeleteStandardResponse" } }, - "401": { - "description": "Failure - Failed to authenticate", + "409": { + "description": "Conflict - Node can begin upgrade", "schema": { - "type": "string" + "$ref": "#/definitions/PutPostDeleteStandardResponse" } }, "500": { "description": "Failure - Error", "schema": { - "type": "string" + "#ref": "#/definitions/PutPostDeleteStandardResponse" } } } @@ -469,6 +340,9 @@ "consumes": [ "application/json" ], + "produces": [ + "application/json" + ], "summary": "Common setup required before using the vault to manage secrets.", "operationId": "secrets_setup", "parameters": [ @@ -485,6 +359,12 @@ "name": "user", "in": "query" }, + { + "type": "string", + "description": "The node the secret is for.", + "name": "node", + "in": "query" + }, { "type": "string", "description": "The secret key (name).", @@ -513,6 +393,9 @@ "AbstractPatternFile": { "type": "object", "properties": { + "GetClusterNamespace": { + "type": "string" + }, "GetOrg": { "type": "string" }, @@ -546,12 +429,8 @@ "GetArch": { "type": "string" }, - "GetClusterDeployment": { - "type": "object" - }, - "GetDeployment": { - "type": "object" - }, + "GetClusterDeployment": {}, + "GetDeployment": {}, "GetOrg": { "type": "string" }, @@ -694,6 +573,78 @@ }, "x-go-package": "github.com/open-horizon/anax/businesspolicy" }, + "ChangeType": { + "description": "Can be one of:\n\n`0`: Modified (\"C\")\n`1`: Added (\"A\")\n`2`: Deleted (\"D\")", + "type": "integer", + "format": "uint8", + "title": "ChangeType Kind of change", + "x-go-package": "github.com/docker/docker/api/types/container" + }, + "CompCheck": { + "description": "The input format for the comptible check", + "type": "object", + "properties": { + "business_policy": { + "$ref": "#/definitions/BusinessPolicy" + }, + "business_policy_id": { + "type": "string", + "x-go-name": "BusinessPolId" + }, + "node_arch": { + "type": "string", + "x-go-name": "NodeArch" + }, + "node_cluster_namespace": { + "type": "string", + "x-go-name": "NodeClusterNS" + }, + "node_id": { + "type": "string", + "x-go-name": "NodeId" + }, + "node_namespace_scoped": { + "type": "boolean", + "x-go-name": "NodeNamespaceScoped" + }, + "node_org": { + "type": "string", + "x-go-name": "NodeOrg" + }, + "node_policy": { + "$ref": "#/definitions/NodePolicy" + }, + "node_type": { + "type": "string", + "x-go-name": "NodeType" + }, + "node_user_input": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + }, + "x-go-name": "NodeUserInput" + }, + "pattern": { + "$ref": "#/definitions/AbstractPatternFile" + }, + "pattern_id": { + "type": "string", + "x-go-name": "PatternId" + }, + "service": { + "type": "array", + "items": { + "$ref": "#/definitions/AbstractServiceFile" + }, + "x-go-name": "Service" + }, + "service_policy": { + "$ref": "#/definitions/ExternalPolicy" + } + }, + "x-go-package": "github.com/open-horizon/anax/compcheck" + }, "CompCheckOutput": { "description": "CompCheckOutput The output format for the compatibility check", "type": "object", @@ -752,10 +703,18 @@ "type": "string", "x-go-name": "NodeArch" }, + "node_cluster_namespace": { + "type": "string", + "x-go-name": "NodeClusterNS" + }, "node_id": { "type": "string", "x-go-name": "NodeId" }, + "node_namespace_scoped": { + "type": "boolean", + "x-go-name": "NodeNamespaceScoped" + }, "node_org": { "type": "string", "x-go-name": "NodeOrg" @@ -806,49 +765,6 @@ }, "x-go-package": "github.com/open-horizon/anax/externalpolicy" }, - "ContainerChangeResponseItem": { - "description": "ContainerChangeResponseItem change item in response to ContainerChanges operation", - "type": "object", - "required": [ - "Kind", - "Path" - ], - "properties": { - "Kind": { - "description": "Kind of change", - "type": "integer", - "format": "uint8" - }, - "Path": { - "description": "Path to file that has changed", - "type": "string" - } - }, - "x-go-package": "github.com/docker/docker/api/types/container" - }, - "ContainerCreateCreatedBody": { - "description": "ContainerCreateCreatedBody OK response to ContainerCreate operation", - "type": "object", - "required": [ - "Id", - "Warnings" - ], - "properties": { - "Id": { - "description": "The ID of the created container", - "type": "string", - "x-go-name": "ID" - }, - "Warnings": { - "description": "Warnings encountered when creating the container", - "type": "array", - "items": { - "type": "string" - } - } - }, - "x-go-package": "github.com/docker/docker/api/types/container" - }, "ContainerTopOKBody": { "description": "ContainerTopOKBody OK response to ContainerTop operation", "type": "object", @@ -894,32 +810,26 @@ }, "x-go-package": "github.com/docker/docker/api/types/container" }, - "ContainerWaitOKBody": { - "description": "ContainerWaitOKBody OK response to ContainerWait operation", + "CreateResponse": { + "description": "OK response to ContainerCreate operation", "type": "object", + "title": "CreateResponse ContainerCreateResponse", "required": [ - "Error", - "StatusCode" + "Id", + "Warnings" ], "properties": { - "Error": { - "$ref": "#/definitions/ContainerWaitOKBodyError" - }, - "StatusCode": { - "description": "Exit code of the container", - "type": "integer", - "format": "int64" - } - }, - "x-go-package": "github.com/docker/docker/api/types/container" - }, - "ContainerWaitOKBodyError": { - "description": "ContainerWaitOKBodyError container waiting error, if any", - "type": "object", - "properties": { - "Message": { - "description": "Details of an error", - "type": "string" + "Id": { + "description": "The ID of the created container", + "type": "string", + "x-go-name": "ID" + }, + "Warnings": { + "description": "Warnings encountered when creating the container", + "type": "array", + "items": { + "type": "string" + } } }, "x-go-package": "github.com/docker/docker/api/types/container" @@ -971,14 +881,43 @@ }, "x-go-package": "github.com/open-horizon/anax/externalpolicy" }, + "FilesystemChange": { + "type": "object", + "title": "FilesystemChange Change in the container's filesystem.", + "required": [ + "Kind", + "Path" + ], + "properties": { + "Kind": { + "$ref": "#/definitions/ChangeType" + }, + "Path": { + "description": "Path to file or directory that has changed.", + "type": "string" + } + }, + "x-go-package": "github.com/docker/docker/api/types/container" + }, "HardwareRequirement": { "type": "object", "title": "This type is used to abstract the various edge node hardware requirements. The schema is left wide open.", - "additionalProperties": { - "type": "object" - }, + "additionalProperties": {}, "x-go-package": "github.com/open-horizon/anax/exchange" }, + "Input": { + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + }, + "value": { + "x-go-name": "Value" + } + }, + "x-go-package": "github.com/open-horizon/anax/policy" + }, "Meter": { "type": "object", "properties": { @@ -1054,6 +993,10 @@ }, "x-go-name": "AgreementProtocols" }, + "clusterNamespace": { + "type": "string", + "x-go-name": "ClusterNamespace" + }, "description": { "type": "string", "x-go-name": "Description" @@ -1098,6 +1041,60 @@ }, "x-go-package": "github.com/open-horizon/anax/common" }, + "PolicyCheck": { + "description": "The input format for the policy check", + "type": "object", + "properties": { + "business_policy": { + "$ref": "#/definitions/BusinessPolicy" + }, + "business_policy_id": { + "type": "string", + "x-go-name": "BusinessPolId" + }, + "dependent_services": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ServiceDefinition" + }, + "x-go-name": "DepServices" + }, + "node_arch": { + "type": "string", + "x-go-name": "NodeArch" + }, + "node_cluster_namespace": { + "type": "string", + "x-go-name": "NodeClusterNS" + }, + "node_id": { + "type": "string", + "x-go-name": "NodeId" + }, + "node_namespace_scoped": { + "type": "boolean", + "x-go-name": "NodeNamespaceScoped" + }, + "node_policy": { + "$ref": "#/definitions/NodePolicy" + }, + "node_type": { + "type": "string", + "x-go-name": "NodeType" + }, + "service": { + "type": "array", + "items": { + "$ref": "#/definitions/AbstractServiceFile" + }, + "x-go-name": "Service" + }, + "service_policy": { + "$ref": "#/definitions/ExternalPolicy" + } + }, + "x-go-package": "github.com/open-horizon/anax/compcheck" + }, "Property": { "type": "object", "properties": { @@ -1110,7 +1107,6 @@ "x-go-name": "Type" }, "value": { - "type": "object", "x-go-name": "Value" } }, @@ -1124,10 +1120,28 @@ }, "x-go-package": "github.com/open-horizon/anax/externalpolicy" }, + "PutPostDeleteStandardResponse": { + "type": "object", + "properties": { + "code": { + "type": "string", + "x-go-name": "Code" + }, + "msg": { + "type": "string", + "x-go-name": "Msg" + } + }, + "x-go-package": "github.com/open-horizon/anax/exchange" + }, "SecretBinding": { "description": "The secret binding that maps service secret names to secret manager secret names", "type": "object", "properties": { + "enableNodeLevelSecrets": { + "type": "boolean", + "x-go-name": "EnableNodeLevelSecrets" + }, "secrets": { "type": "array", "items": { @@ -1154,11 +1168,68 @@ }, "x-go-package": "github.com/open-horizon/anax/exchangecommon" }, + "SecretBindingCheck": { + "description": "The input format for the userinput check", + "type": "object", + "properties": { + "business_policy": { + "$ref": "#/definitions/BusinessPolicy" + }, + "business_policy_id": { + "type": "string", + "x-go-name": "BusinessPolId" + }, + "dependent_services": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ServiceDefinition" + }, + "x-go-name": "DepServices" + }, + "node_arch": { + "type": "string", + "x-go-name": "NodeArch" + }, + "node_id": { + "type": "string", + "x-go-name": "NodeId" + }, + "node_org": { + "type": "string", + "x-go-name": "NodeOrg" + }, + "node_type": { + "type": "string", + "x-go-name": "NodeType" + }, + "pattern": { + "$ref": "#/definitions/AbstractPatternFile" + }, + "pattern_id": { + "type": "string", + "x-go-name": "PatternId" + }, + "service": { + "type": "array", + "items": { + "$ref": "#/definitions/AbstractServiceFile" + }, + "x-go-name": "Service" + }, + "service_to_check": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ServiceToCheck" + } + }, + "x-go-package": "github.com/open-horizon/anax/compcheck" + }, "ServiceChoiceFile": { "type": "object", "properties": { "deployment_overrides": { - "type": "object", "x-go-name": "DeploymentOverrides" }, "deployment_overrides_signature": { @@ -1295,7 +1366,6 @@ "x-go-name": "Arch" }, "clusterDeployment": { - "type": "object", "x-go-name": "ClusterDeployment" }, "clusterDeploymentSignature": { @@ -1303,7 +1373,6 @@ "x-go-name": "ClusterDeploymentSignature" }, "deployment": { - "type": "object", "x-go-name": "Deployment" }, "deploymentSignature": { @@ -1324,9 +1393,7 @@ }, "matchHardware": { "type": "object", - "additionalProperties": { - "type": "object" - }, + "additionalProperties": {}, "x-go-name": "MatchHardware" }, "org": { @@ -1373,6 +1440,10 @@ "type": "string", "x-go-name": "Arch" }, + "clusterNamespace": { + "type": "string", + "x-go-name": "ClusterNamespace" + }, "name": { "type": "string", "x-go-name": "Name" @@ -1501,9 +1572,116 @@ }, "x-go-package": "github.com/open-horizon/anax/exchangecommon" }, + "UserInputCheck": { + "description": "The input format for the userinput check", + "type": "object", + "properties": { + "business_policy": { + "$ref": "#/definitions/BusinessPolicy" + }, + "business_policy_id": { + "type": "string", + "x-go-name": "BusinessPolId" + }, + "dependent_services": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ServiceDefinition" + }, + "x-go-name": "DepServices" + }, + "node_arch": { + "type": "string", + "x-go-name": "NodeArch" + }, + "node_cluster_namespace": { + "type": "string", + "x-go-name": "NodeClusterNS" + }, + "node_id": { + "type": "string", + "x-go-name": "NodeId" + }, + "node_namespace_scoped": { + "type": "boolean", + "x-go-name": "NodeNamespaceScoped" + }, + "node_type": { + "type": "string", + "x-go-name": "NodeType" + }, + "node_user_input": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + }, + "x-go-name": "NodeUserInput" + }, + "pattern": { + "$ref": "#/definitions/AbstractPatternFile" + }, + "pattern_id": { + "type": "string", + "x-go-name": "PatternId" + }, + "service": { + "type": "array", + "items": { + "$ref": "#/definitions/AbstractServiceFile" + }, + "x-go-name": "Service" + }, + "service_to_check": { + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "ServiceToCheck" + } + }, + "x-go-package": "github.com/open-horizon/anax/compcheck" + }, + "WaitExitError": { + "description": "WaitExitError container waiting error, if any", + "type": "object", + "properties": { + "Message": { + "description": "Details of an error", + "type": "string" + } + }, + "x-go-package": "github.com/docker/docker/api/types/container" + }, + "WaitResponse": { + "description": "OK response to ContainerWait operation", + "type": "object", + "title": "WaitResponse ContainerWaitResponse", + "required": [ + "StatusCode" + ], + "properties": { + "Error": { + "$ref": "#/definitions/WaitExitError" + }, + "StatusCode": { + "description": "Exit code of the container", + "type": "integer", + "format": "int64" + } + }, + "x-go-package": "github.com/docker/docker/api/types/container" + }, "WorkloadChoice": { "type": "object", "properties": { + "deployment_overrides": { + "type": "string", + "x-go-name": "DeploymentOverrides" + }, + "deployment_overrides_signature": { + "type": "string", + "x-go-name": "DeploymentOverridesSignature" + }, "priority": { "$ref": "#/definitions/WorkloadPriority" }, @@ -1515,7 +1693,7 @@ "x-go-name": "Version" } }, - "x-go-package": "github.com/open-horizon/anax/businesspolicy" + "x-go-package": "github.com/open-horizon/anax/exchange" }, "WorkloadPriority": { "type": "object", diff --git a/exchange/pattern.go b/exchange/pattern.go index 3db64ed66..eb6494a06 100644 --- a/exchange/pattern.go +++ b/exchange/pattern.go @@ -191,6 +191,7 @@ type Blockchain struct { type BlockchainList []Blockchain +// swagger:model type AgreementProtocol struct { Name string `json:"name,omitempty"` // The name of the agreement protocol to be used ProtocolVersion int `json:"protocolVersion,omitempty"` // The max protocol version supported diff --git a/exchange/rpc.go b/exchange/rpc.go index c141629bb..5d20c1872 100644 --- a/exchange/rpc.go +++ b/exchange/rpc.go @@ -41,6 +41,7 @@ func GetId(id string) string { } } +// swagger:model type PutPostDeleteStandardResponse struct { Code string `json:"code"` Msg string `json:"msg"` diff --git a/exchange/service.go b/exchange/service.go index 43630628f..1d3906619 100644 --- a/exchange/service.go +++ b/exchange/service.go @@ -17,6 +17,7 @@ import ( // Types and functions used to work with the exchange's service objects. // This type is used to abstract the various edge node hardware requirements. The schema is left wide open. +// swagger:model type HardwareRequirement map[string]interface{} func (h HardwareRequirement) String() string { @@ -33,6 +34,7 @@ func (h HardwareRequirement) String() string { } // This is the structure of the object returned on a GET /service. +// swagger:model type ServiceDefinition struct { Owner string `json:"owner,omitempty"` Label string `json:"label"` diff --git a/exchangecommon/nodepolicy.go b/exchangecommon/nodepolicy.go index 4cbed693e..126df91fb 100644 --- a/exchangecommon/nodepolicy.go +++ b/exchangecommon/nodepolicy.go @@ -14,6 +14,7 @@ const NODEPOLICY_VERSION_VERSION_2 = "v2" // the perperty value of the second level takes the precedence. // If there are constraints defined in the second level, all the constraints defined in // the top level will be ignored. +// swagger:model type NodePolicy struct { Label string `json:"label,omitempty"` Description string `json:"description,omitempty"` diff --git a/exchangecommon/secret.go b/exchangecommon/secret.go index 2d50e6cbe..4733eb767 100644 --- a/exchangecommon/secret.go +++ b/exchangecommon/secret.go @@ -5,6 +5,7 @@ import ( ) // a binding that maps a secret name to a secret manager secret name. +// swagger:model type BoundSecret map[string]string // return both service secret name and secret manager secret name @@ -42,6 +43,7 @@ func (w BoundSecret) IsSame(other BoundSecret) bool { } // The secret binding that maps service secret names to secret manager secret names +// swagger:model type SecretBinding struct { ServiceOrgid string `json:"serviceOrgid"` ServiceUrl string `json:"serviceUrl"` diff --git a/exchangecommon/service.go b/exchangecommon/service.go index 2aef279c0..0b4cd4f14 100644 --- a/exchangecommon/service.go +++ b/exchangecommon/service.go @@ -19,6 +19,7 @@ const SERVICE_SHARING_MODE_MULTIPLE = "multiple" // Types and functions used to work with the exchange's service objects. // This type is a tuple used to refer to a specific service that is a dependency for the referencing service. +// swagger:model type ServiceDependency struct { URL string `json:"url"` Org string `json:"org"` diff --git a/externalpolicy/constraint_expression.go b/externalpolicy/constraint_expression.go index d7248029d..4b5a4c5d1 100644 --- a/externalpolicy/constraint_expression.go +++ b/externalpolicy/constraint_expression.go @@ -7,6 +7,7 @@ import ( ) // This type implements all the ConstraintLanguage Plugin methods and delegates to plugin system. +// swagger:model type ConstraintExpression []string func (c *ConstraintExpression) Validate() ([]string, error) { diff --git a/externalpolicy/property_list.go b/externalpolicy/property_list.go index 559a4fd75..4c0a56151 100644 --- a/externalpolicy/property_list.go +++ b/externalpolicy/property_list.go @@ -21,8 +21,10 @@ const ( ) // This struct represents property values advertised by the policy +// swagger:model type PropertyList []Property +// swagger:model type Property struct { Name string `json:"name"` // The Property name Value interface{} `json:"value"` // The Property value diff --git a/policy/user_input.go b/policy/user_input.go index eeadc4561..196cf0c4e 100644 --- a/policy/user_input.go +++ b/policy/user_input.go @@ -45,6 +45,7 @@ func (s Input) IsSame(input Input) bool { return true } +// swagger:model type UserInput struct { ServiceOrgid string `json:"serviceOrgid"` ServiceUrl string `json:"serviceUrl"`