From 6af525a62cd317501cd41f075994ec218abb9c21 Mon Sep 17 00:00:00 2001 From: zhangl Date: Thu, 2 Sep 2021 13:18:54 -0400 Subject: [PATCH] update mms_swagger.json Signed-off-by: zhangl --- docs/{swagger.json => mms_swagger.json} | 1397 +++-------------------- resource/secret_api.go | 4 +- 2 files changed, 182 insertions(+), 1219 deletions(-) rename docs/{swagger.json => mms_swagger.json} (76%) diff --git a/docs/swagger.json b/docs/mms_swagger.json similarity index 76% rename from docs/swagger.json rename to docs/mms_swagger.json index 253072fc4..793c274c1 100644 --- a/docs/swagger.json +++ b/docs/mms_swagger.json @@ -6,13 +6,14 @@ "application/json" ], "schemes": [ - "http" + "http", + "https" ], "swagger": "2.0", "info": { - "description": "This is the main package of the cloud synchronization service", - "title": "Cloud Syncronization Service", - "version": "0.0.1" + "description": "The Model Management System (MMS) delivers AI models and other files needed by edge services to the edge nodes where those services are running. MMS has two components, and therefore two APIs: Cloud Sync Service (CSS) is the MMS component that runs on the management hub that users or devops processes use to load models/files into MMS. The Edge Sync Service (ESS) runs on each edge node and is the API that edge services interact with to get the models/files and find out about updates.\n\nThe Agent Secrets APIs enables service containers to receive updated secrets", + "title": "Model Management System and Agent Secrets API", + "version": "1.0.0" }, "host": "localhost", "basePath": "/", @@ -1396,6 +1397,66 @@ } } } + }, + "post": { + "description": "Add or delete the list of sync service (ESS) nodes to/from be the destinations of the object of the specified object type and object ID.\nThis is a CSS only API.", + "consumes": [ + "application/json" + ], + "produces": [ + "text/plain" + ], + "tags": [ + "CSS" + ], + "summary": "Add/Delete the destinations of an object.", + "operationId": "handleObjectDestinationsUpdate", + "parameters": [ + { + "type": "string", + "description": "The orgID of the object whose destinations will be updated", + "name": "orgID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The object type of the object whose destinations will be updated", + "name": "objectType", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The object ID of the object whose destinations will be updated", + "name": "objectID", + "in": "path", + "required": true + }, + { + "description": "The object's destination list to add or remove", + "name": "payload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/bulkDestUpdate" + } + } + ], + "responses": { + "204": { + "description": "Object destinations updated", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Failed to update the object's destinations", + "schema": { + "type": "string" + } + } + } } }, "/api/v1/objects/{orgID}/{objectType}/{objectID}/policyreceived": { @@ -2378,805 +2439,94 @@ } } } + } + }, + "definitions": { + "ACLentry": { + "description": "ACLentry contains ACL information about each user", + "type": "object", + "properties": { + "ACLRole": { + "type": "string" + }, + "ACLUserType": { + "type": "string" + }, + "Username": { + "type": "string" + } + }, + "x-go-package": "github.com/open-horizon/edge-sync-service/common" }, - "/deploycheck/deploycompatible": { - "get": { - "description": "This API does compatibility check for the given deployment policy (or a pattern), service definition, node policy and node user input. It does both policy compatibility check and user input compatibility check. If the result is compatible, it means that, when deployed, the node will form an agreement with the agbot and the service will be running on the node.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "summary": "Check deployment compatibility. ", - "operationId": "deploy_compatible", - "parameters": [ - { - "type": "bool", - "description": "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern.", - "name": "checkAll", - "in": "query" - }, - { - "type": "bool", - "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", - "in": "body", - "schema": { - "$ref": "#/definitions/ServiceFile" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "compcheck.CompCheckOutput", - "$ref": "#/definitions/CompCheckOutput" - } - }, - "400": { - "description": "Failure - No input found", - "schema": { - "type": "string" - } - }, - "401": { - "description": "Failure - Failed to authenticate", - "schema": { - "type": "string" - } - }, - "500": { - "description": "Failure - Error", - "schema": { - "type": "string" - } - } + "AuthenticateOKBody": { + "description": "AuthenticateOKBody authenticate o k body", + "type": "object", + "required": [ + "IdentityToken", + "Status" + ], + "properties": { + "IdentityToken": { + "description": "An opaque token used to authenticate a user after a successful login", + "type": "string" + }, + "Status": { + "description": "The status of the authentication", + "type": "string" } - } + }, + "x-go-package": "github.com/docker/docker/api/types/registry" }, - "/deploycheck/policycompatible": { - "get": { - "description": "This API does the policy compatibility check for the given deployment policy, node policy and service policy. The deployment policy and the service policy will be merged to check against the node policy. If the result is compatible, it means that, when deployed, the node will form an agreement with the agbot and the service will be running on the node.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "summary": "Check the policy compatibility", - "operationId": "deployCheckPolicyCompatible", - "parameters": [ - { - "type": "bool", - "description": "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern.", - "name": "checkAll", - "in": "query" - }, - { - "type": "bool", - "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", - "in": "body", - "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" + "BoundSecret": { + "type": "object", + "title": "a binding that maps a secret name to a secret manager secret name.", + "additionalProperties": { + "type": "string" + }, + "x-go-package": "github.com/open-horizon/anax/exchangecommon" + }, + "BusinessPolicy": { + "description": "BusinessPolicy the business policy", + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/ConstraintExpression" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "label": { + "type": "string", + "x-go-name": "Label" + }, + "owner": { + "type": "string", + "x-go-name": "Owner" + }, + "properties": { + "$ref": "#/definitions/PropertyList" + }, + "secretBinding": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretBinding" }, - { - "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" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "compcheck.CompCheckOutput", - "$ref": "#/definitions/CompCheckOutput" - } - }, - "400": { - "description": "Failure - No input found", - "schema": { - "type": "string" - } - }, - "500": { - "description": "Failure - Error", - "schema": { - "type": "string" - } - }, - "501": { - "description": "Failure - Failed to authenticate", - "schema": { - "type": "string" - } - } - } - } - }, - "/deploycheck/secretbindingcompatible": { - "get": { - "description": "This API does the secret binding compatibility check for the given deployment policy (or a pattern) and service definition. It checks if each secret defined in a serice has a binding associated in the given deployment policy (or pattern) and each bound secret exists in the secret manager. If the result is compatible, it means that, when deployed, the node will form an agreement with the agbot and the service will be running on the node.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "summary": "Check the secret binding compatibility. ", - "operationId": "secretbinding_compatible", - "parameters": [ - { - "type": "bool", - "description": "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern.", - "name": "checkAll", - "in": "query" - }, - { - "type": "bool", - "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", - "in": "body", - "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" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "compcheck.CompCheckOutput", - "$ref": "#/definitions/CompCheckOutput" - } - }, - "400": { - "description": "Failure - No input found", - "schema": { - "type": "string" - } - }, - "401": { - "description": "Failure - Failed to authenticate", - "schema": { - "type": "string" - } - }, - "500": { - "description": "Failure - Error", - "schema": { - "type": "string" - } - } - } - } - }, - "/deploycheck/userinputcompatible": { - "get": { - "description": "This API does the user input compatibility check for the given deployment policy (or a pattern), service definition and node user input. The user input values in the deployment policy and the node will be merged to check against the service uer input requirement defined in the service definition. If the result is compatible, it means that, when deployed, the node will form an agreement with the agbot and the service will be running on the node.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "summary": "Check the user input compatibility.", - "operationId": "userinputCompatible", - "parameters": [ - { - "type": "bool", - "description": "Return the compatibility check result for all the service versions referenced in the deployment policy or pattern.", - "name": "checkAll", - "in": "query" - }, - { - "type": "bool", - "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", - "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": "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" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "type": "compcheck.CompCheckOutput", - "$ref": "#/definitions/CompCheckOutput" - } - }, - "400": { - "description": "Failure - No input found", - "schema": { - "type": "string" - } - }, - "401": { - "description": "Failure - Failed to authenticate", - "schema": { - "type": "string" - } - }, - "500": { - "description": "Failure - Error", - "schema": { - "type": "string" - } - } - } - } - }, - "/org/{org}/secrets": {}, - "/org/{org}/secrets/*": { - "get": { - "description": "Authenticates the node user with the exchange. Checks if the vault plugin being used is ready. \nPerforms sanity checks on the secret user and secret name provided.", - "consumes": [ - "application/json" - ], - "summary": "Common setup required before using the vault to manage secrets.", - "operationId": "secrets_setup", - "parameters": [ - { - "type": "string", - "description": "The organisation name the secret belongs to. Must be the same as the org the user node belongs to.", - "name": "org", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "The user owning the secret.", - "name": "user", - "in": "query" - }, - { - "type": "string", - "description": "The secret key (name).", - "name": "secret", - "in": "query" - } - ], - "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" - } - } - } - } - } - }, - "definitions": { - "ACLentry": { - "description": "ACLentry contains ACL information about each user", - "type": "object", - "properties": { - "ACLRole": { - "type": "string" - }, - "ACLUserType": { - "type": "string" - }, - "Username": { - "type": "string" - } - }, - "x-go-package": "github.com/open-horizon/edge-sync-service/common" - }, - "AbstractPatternFile": { - "type": "object", - "properties": { - "GetOrg": { - "type": "string" - }, - "GetSecretBinding": { - "type": "array", - "items": { - "$ref": "#/definitions/SecretBinding" - } - }, - "GetServices": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceReference" - } - }, - "GetUserInputs": { - "type": "array", - "items": { - "$ref": "#/definitions/UserInput" - } - }, - "IsPublic": { - "type": "boolean" - } - }, - "x-go-package": "github.com/open-horizon/anax/common" - }, - "AbstractServiceFile": { - "type": "object", - "properties": { - "GetArch": { - "type": "string" - }, - "GetClusterDeployment": { - "type": "object" - }, - "GetDeployment": { - "type": "object" - }, - "GetOrg": { - "type": "string" - }, - "GetRequiredServices": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceDependency" - } - }, - "GetServiceType": { - "type": "string" - }, - "GetURL": { - "type": "string" - }, - "GetUserInputs": { - "type": "array", - "items": { - "$ref": "#/definitions/UserInput" - } - }, - "GetVersion": { - "type": "string" - }, - "NeedsUserInput": { - "type": "boolean" - } - }, - "x-go-package": "github.com/open-horizon/anax/common" - }, - "AgreementProtocol": { - "type": "object", - "properties": { - "blockchains": { - "$ref": "#/definitions/BlockchainList" - }, - "name": { - "type": "string", - "x-go-name": "Name" - }, - "protocolVersion": { - "type": "integer", - "format": "int64", - "x-go-name": "ProtocolVersion" - } - }, - "x-go-package": "github.com/open-horizon/anax/exchange" - }, - "AuthenticateOKBody": { - "description": "AuthenticateOKBody authenticate o k body", - "type": "object", - "required": [ - "IdentityToken", - "Status" - ], - "properties": { - "IdentityToken": { - "description": "An opaque token used to authenticate a user after a successful login", - "type": "string" - }, - "Status": { - "description": "The status of the authentication", - "type": "string" - } - }, - "x-go-package": "github.com/docker/docker/api/types/registry" - }, - "Blockchain": { - "type": "object", - "properties": { - "name": { - "type": "string", - "x-go-name": "Name" - }, - "organization": { - "type": "string", - "x-go-name": "Org" - }, - "type": { - "type": "string", - "x-go-name": "Type" - } - }, - "x-go-package": "github.com/open-horizon/anax/exchange" - }, - "BlockchainList": { - "type": "array", - "items": { - "$ref": "#/definitions/Blockchain" - }, - "x-go-package": "github.com/open-horizon/anax/exchange" - }, - "BoundSecret": { - "type": "object", - "title": "a binding that maps a secret name to a secret manager secret name.", - "additionalProperties": { - "type": "string" - }, - "x-go-package": "github.com/open-horizon/anax/exchangecommon" - }, - "BusinessPolicy": { - "description": "BusinessPolicy the business policy", - "type": "object", - "properties": { - "constraints": { - "$ref": "#/definitions/ConstraintExpression" - }, - "description": { - "type": "string", - "x-go-name": "Description" - }, - "label": { - "type": "string", - "x-go-name": "Label" - }, - "owner": { - "type": "string", - "x-go-name": "Owner" - }, - "properties": { - "$ref": "#/definitions/PropertyList" - }, - "secretBinding": { - "type": "array", - "items": { - "$ref": "#/definitions/SecretBinding" - }, - "x-go-name": "SecretBinding" - }, - "service": { - "$ref": "#/definitions/ServiceRef" - }, - "userInput": { - "type": "array", - "items": { - "$ref": "#/definitions/UserInput" + "x-go-name": "SecretBinding" + }, + "service": { + "$ref": "#/definitions/ServiceRef" + }, + "userInput": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" }, "x-go-name": "UserInput" } }, "x-go-package": "github.com/open-horizon/anax/businesspolicy" }, - "CompCheckOutput": { - "description": "CompCheckOutput The output format for the compatibility check", - "type": "object", - "properties": { - "compatible": { - "type": "boolean", - "x-go-name": "Compatible" - }, - "input": { - "$ref": "#/definitions/CompCheckResource" - }, - "reason": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-go-name": "Reason" - } - }, - "x-go-package": "github.com/open-horizon/anax/compcheck" - }, - "CompCheckResource": { - "description": "To store the resource (pattern, bp, services etc) used for compatibility 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" - }, - "extraneous_secret_binding": { - "type": "array", - "items": { - "$ref": "#/definitions/SecretBinding" - }, - "x-go-name": "ExtraneousSB" - }, - "needed_secret_binding": { - "description": "It is either empty or provides ALL the dependent services needed. It is expected the top level service definitions are provided\nin the 'Service' attribute when this attribute is not empty.", - "type": "array", - "items": { - "$ref": "#/definitions/SecretBinding" - }, - "x-go-name": "NeededSB" - }, - "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_policy": { - "$ref": "#/definitions/ExternalPolicy" - }, - "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": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ExternalPolicy" - }, - "x-go-name": "ServicePolicy" - } - }, - "x-go-package": "github.com/open-horizon/anax/compcheck" - }, "ConstraintExpression": { "type": "array", "title": "This type implements all the ConstraintLanguage Plugin methods and delegates to plugin system.", @@ -3338,40 +2688,6 @@ }, "x-go-package": "github.com/open-horizon/edge-sync-service/common" }, - "DataVerification": { - "type": "object", - "properties": { - "URL": { - "type": "string" - }, - "check_rate": { - "type": "integer", - "format": "int64", - "x-go-name": "CheckRate" - }, - "enabled": { - "type": "boolean", - "x-go-name": "Enabled" - }, - "interval": { - "type": "integer", - "format": "int64", - "x-go-name": "Interval" - }, - "metering": { - "$ref": "#/definitions/Meter" - }, - "password": { - "type": "string", - "x-go-name": "URLPassword" - }, - "user": { - "type": "string", - "x-go-name": "URLUser" - } - }, - "x-go-package": "github.com/open-horizon/anax/exchange" - }, "Destination": { "description": "Each sync service edge node (ESS) has an address that is composed of the node's ID, Type, and Organization.\nAn ESS node communicates with the CSS using either MQTT or HTTP.", "type": "object", @@ -3468,14 +2784,6 @@ }, "x-go-package": "github.com/open-horizon/anax/externalpolicy" }, - "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" - }, - "x-go-package": "github.com/open-horizon/anax/exchange" - }, "HealthStatusInfo": { "description": "HealthStatusInfo describes the health status of the sync-service node", "type": "object", @@ -3723,26 +3031,6 @@ }, "x-go-package": "github.com/open-horizon/edge-sync-service/common" }, - "Meter": { - "type": "object", - "properties": { - "notification_interval": { - "type": "integer", - "format": "int64", - "x-go-name": "NotificationIntervalS" - }, - "per_time_unit": { - "type": "string", - "x-go-name": "PerTimeUnit" - }, - "tokens": { - "type": "integer", - "format": "uint64", - "x-go-name": "Tokens" - } - }, - "x-go-package": "github.com/open-horizon/anax/exchange" - }, "NodeHealth": { "type": "object", "properties": { @@ -3843,81 +3131,25 @@ "address": { "description": "Address is the broker address to be used when connecting to this organization", "type": "string", - "x-go-name": "Address" - }, - "orgID": { - "description": "OrgID is the organization ID of the organization", - "type": "string", - "x-go-name": "OrgID" - }, - "password": { - "description": "Password is the password to be used when connecting to this organization", - "type": "string", - "x-go-name": "Password" - }, - "user": { - "description": "User is the user name to be used when connecting to this organization", - "type": "string", - "x-go-name": "User" - } - }, - "x-go-package": "github.com/open-horizon/edge-sync-service/common" - }, - "PatternFile": { - "description": "It is used when reading json file the user gives us as an input to create the pattern", - "type": "object", - "title": "PatternFile An implementation of AbstractPatternFile.", - "properties": { - "agreementProtocols": { - "type": "array", - "items": { - "$ref": "#/definitions/AgreementProtocol" - }, - "x-go-name": "AgreementProtocols" - }, - "description": { - "type": "string", - "x-go-name": "Description" - }, - "label": { - "type": "string", - "x-go-name": "Label" - }, - "name": { - "type": "string", - "x-go-name": "Name" - }, - "org": { - "type": "string", - "x-go-name": "Org" - }, - "public": { - "type": "boolean", - "x-go-name": "Public" - }, - "secretBinding": { - "type": "array", - "items": { - "$ref": "#/definitions/SecretBinding" - }, - "x-go-name": "SecretBinding" + "x-go-name": "Address" }, - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceReferenceFile" - }, - "x-go-name": "Services" + "orgID": { + "description": "OrgID is the organization ID of the organization", + "type": "string", + "x-go-name": "OrgID" }, - "userInput": { - "type": "array", - "items": { - "$ref": "#/definitions/UserInput" - }, - "x-go-name": "UserInput" + "password": { + "description": "Password is the password to be used when connecting to this organization", + "type": "string", + "x-go-name": "Password" + }, + "user": { + "description": "User is the user name to be used when connecting to this organization", + "type": "string", + "x-go-name": "User" } }, - "x-go-package": "github.com/open-horizon/anax/common" + "x-go-package": "github.com/open-horizon/edge-sync-service/common" }, "Policy": { "description": "Policy describes a policy made up of a set of properties and constraints", @@ -4038,218 +3270,6 @@ }, "x-go-package": "github.com/open-horizon/anax/exchangecommon" }, - "ServiceChoiceFile": { - "type": "object", - "properties": { - "deployment_overrides": { - "type": "object", - "x-go-name": "DeploymentOverrides" - }, - "deployment_overrides_signature": { - "type": "string", - "x-go-name": "DeploymentOverridesSignature" - }, - "priority": { - "$ref": "#/definitions/WorkloadPriority" - }, - "upgradePolicy": { - "$ref": "#/definitions/UpgradePolicy" - }, - "version": { - "type": "string", - "x-go-name": "Version" - } - }, - "x-go-package": "github.com/open-horizon/anax/common" - }, - "ServiceDefinition": { - "type": "object", - "title": "This is the structure of the object returned on a GET /service.", - "properties": { - "arch": { - "type": "string", - "x-go-name": "Arch" - }, - "clusterDeployment": { - "type": "string", - "x-go-name": "ClusterDeployment" - }, - "clusterDeploymentSignature": { - "type": "string", - "x-go-name": "ClusterDeploymentSignature" - }, - "deployment": { - "type": "string", - "x-go-name": "Deployment" - }, - "deploymentSignature": { - "type": "string", - "x-go-name": "DeploymentSignature" - }, - "description": { - "type": "string", - "x-go-name": "Description" - }, - "documentation": { - "type": "string", - "x-go-name": "Documentation" - }, - "label": { - "type": "string", - "x-go-name": "Label" - }, - "lastUpdated": { - "type": "string", - "x-go-name": "LastUpdated" - }, - "matchHardware": { - "$ref": "#/definitions/HardwareRequirement" - }, - "owner": { - "type": "string", - "x-go-name": "Owner" - }, - "public": { - "type": "boolean", - "x-go-name": "Public" - }, - "requiredServices": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceDependency" - }, - "x-go-name": "RequiredServices" - }, - "sharable": { - "type": "string", - "x-go-name": "Sharable" - }, - "url": { - "type": "string", - "x-go-name": "URL" - }, - "userInput": { - "type": "array", - "items": { - "$ref": "#/definitions/UserInput" - }, - "x-go-name": "UserInputs" - }, - "version": { - "type": "string", - "x-go-name": "Version" - } - }, - "x-go-package": "github.com/open-horizon/anax/exchange" - }, - "ServiceDependency": { - "type": "object", - "title": "This type is a tuple used to refer to a specific service that is a dependency for the referencing service.", - "properties": { - "arch": { - "type": "string", - "x-go-name": "Arch" - }, - "org": { - "type": "string", - "x-go-name": "Org" - }, - "url": { - "type": "string", - "x-go-name": "URL" - }, - "version": { - "type": "string", - "x-go-name": "Version" - }, - "versionRange": { - "type": "string", - "x-go-name": "VersionRange" - } - }, - "x-go-package": "github.com/open-horizon/anax/exchangecommon" - }, - "ServiceFile": { - "description": "It is used when reading json file the user gives us as input to create the service", - "type": "object", - "title": "ServiceFile An implementation of AbstractServiceFile", - "properties": { - "arch": { - "type": "string", - "x-go-name": "Arch" - }, - "clusterDeployment": { - "type": "object", - "x-go-name": "ClusterDeployment" - }, - "clusterDeploymentSignature": { - "type": "string", - "x-go-name": "ClusterDeploymentSignature" - }, - "deployment": { - "type": "object", - "x-go-name": "Deployment" - }, - "deploymentSignature": { - "type": "string", - "x-go-name": "DeploymentSignature" - }, - "description": { - "type": "string", - "x-go-name": "Description" - }, - "documentation": { - "type": "string", - "x-go-name": "Documentation" - }, - "label": { - "type": "string", - "x-go-name": "Label" - }, - "matchHardware": { - "type": "object", - "additionalProperties": { - "type": "object" - }, - "x-go-name": "MatchHardware" - }, - "org": { - "type": "string", - "x-go-name": "Org" - }, - "public": { - "type": "boolean", - "x-go-name": "Public" - }, - "requiredServices": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceDependency" - }, - "x-go-name": "RequiredServices" - }, - "sharable": { - "type": "string", - "x-go-name": "Sharable" - }, - "url": { - "type": "string", - "x-go-name": "URL" - }, - "userInput": { - "type": "array", - "items": { - "$ref": "#/definitions/UserInput" - }, - "x-go-name": "UserInputs" - }, - "version": { - "type": "string", - "x-go-name": "Version" - } - }, - "x-go-package": "github.com/open-horizon/anax/common" - }, "ServiceID": { "description": "ServiceID contains the ID of a service to which an object may have affinity for", "type": "object", @@ -4305,76 +3325,6 @@ }, "x-go-package": "github.com/open-horizon/anax/businesspolicy" }, - "ServiceReference": { - "type": "object", - "properties": { - "agreementLess": { - "type": "boolean", - "x-go-name": "AgreementLess" - }, - "dataVerification": { - "$ref": "#/definitions/DataVerification" - }, - "nodeHealth": { - "$ref": "#/definitions/NodeHealth" - }, - "serviceArch": { - "type": "string", - "x-go-name": "ServiceArch" - }, - "serviceOrgid": { - "type": "string", - "x-go-name": "ServiceOrg" - }, - "serviceUrl": { - "type": "string", - "x-go-name": "ServiceURL" - }, - "serviceVersions": { - "type": "array", - "items": { - "$ref": "#/definitions/WorkloadChoice" - }, - "x-go-name": "ServiceVersions" - } - }, - "x-go-package": "github.com/open-horizon/anax/exchange" - }, - "ServiceReferenceFile": { - "type": "object", - "properties": { - "agreementLess": { - "type": "boolean", - "x-go-name": "AgreementLess" - }, - "dataVerification": { - "$ref": "#/definitions/DataVerification" - }, - "nodeHealth": { - "$ref": "#/definitions/NodeHealth" - }, - "serviceArch": { - "type": "string", - "x-go-name": "ServiceArch" - }, - "serviceOrgid": { - "type": "string", - "x-go-name": "ServiceOrg" - }, - "serviceUrl": { - "type": "string", - "x-go-name": "ServiceURL" - }, - "serviceVersions": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceChoiceFile" - }, - "x-go-name": "ServiceVersions" - } - }, - "x-go-package": "github.com/open-horizon/anax/common" - }, "UpgradePolicy": { "type": "object", "properties": { @@ -4387,7 +3337,7 @@ "x-go-name": "Time" } }, - "x-go-package": "github.com/open-horizon/anax/exchange" + "x-go-package": "github.com/open-horizon/anax/businesspolicy" }, "UsageInfo": { "description": "UsageInfo describes the usage of the sync-service node", @@ -4444,14 +3394,6 @@ "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" }, @@ -4463,7 +3405,7 @@ "x-go-name": "Version" } }, - "x-go-package": "github.com/open-horizon/anax/exchange" + "x-go-package": "github.com/open-horizon/anax/businesspolicy" }, "WorkloadPriority": { "type": "object", @@ -4511,6 +3453,25 @@ }, "x-go-package": "github.com/open-horizon/edge-sync-service/core/base" }, + "bulkDestUpdate": { + "description": "bulkDestUpdate is the payload used when need to add or remove destinations for an object", + "type": "object", + "properties": { + "action": { + "type": "string", + "x-go-name": "Action" + }, + "destinations": { + "description": "Destinations is an array of destinations, each entry is an string in form of \"\u003cdestinationType\u003e:\u003cdestinationID\u003e\"", + "type": "array", + "items": { + "type": "string" + }, + "x-go-name": "Destinations" + } + }, + "x-go-package": "github.com/open-horizon/edge-sync-service/core/base" + }, "healthReport": { "type": "object", "properties": { diff --git a/resource/secret_api.go b/resource/secret_api.go index 1f23b352f..054406a62 100644 --- a/resource/secret_api.go +++ b/resource/secret_api.go @@ -1,4 +1,6 @@ -// Package resource Agent Secrets API +// Package resource Model Management System and Agent Secrets API +// +// The Model Management System (MMS) delivers AI models and other files needed by edge services to the edge nodes where those services are running. MMS has two components, and therefore two APIs: Cloud Sync Service (CSS) is the MMS component that runs on the management hub that users or devops processes use to load models/files into MMS. The Edge Sync Service (ESS) runs on each edge node and is the API that edge services interact with to get the models/files and find out about updates. // // The Agent Secrets APIs enables service containers to receive updated secrets //