API Connection Model
Smarter API PluginData Sql Connection Manifest Constants
Smarter API Manifest - Plugin.spec
- pydantic model smarter.apps.plugin.manifest.models.api_connection.spec.ApiConnection[source]
Bases:
SmarterBasePydanticModelSmarter API - generic API Connection class.
Show JSON schema
{ "title": "ApiConnection", "description": "Smarter API - generic API Connection class.", "type": "object", "properties": { "baseUrl": { "description": "The root domain of the API. Example: 'https://api.example.com'.", "title": "Baseurl", "type": "string" }, "apiKey": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The API key for authentication, if required.", "title": "Apikey" }, "authMethod": { "default": "none", "description": "The authentication method to use. Example: 'Basic Auth', 'Token Auth'.", "title": "Authmethod", "type": "string" }, "timeout": { "default": 30, "description": "The timeout for the API request in seconds. Default is 30 seconds.", "minimum": 1, "title": "Timeout", "type": "integer" }, "proxyProtocol": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The protocol of the proxy connection. Example: 'http', 'https'.", "title": "Proxyprotocol" }, "proxyHost": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The remote host of the proxy connection.", "title": "Proxyhost" }, "proxyPort": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The port of the proxy connection.", "title": "Proxyport" }, "proxyUsername": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The username for the proxy connection.", "title": "Proxyusername" }, "proxyPassword": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The password for the proxy connection.", "title": "Proxypassword" } }, "required": [ "baseUrl" ] }
- Config:
from_attributes: bool = True
arbitrary_types_allowed: bool = True
frozen: bool = True
- Fields:
- Validators:
-
field authMethod:
str= 'none' The authentication method to use. Example: ‘Basic Auth’, ‘Token Auth’.
- Validated by:
-
field baseUrl:
str[Required] The root domain of the API. Example: ‘https://api.example.com’.
- Validated by:
-
field proxyProtocol:
Optional[str] = None The protocol of the proxy connection. Example: ‘http’, ‘https’.
- Validated by:
-
field timeout:
int= 30 The timeout for the API request in seconds. Default is 30 seconds.
- Constraints:
ge = 1
- Validated by:
- validator validate_auth_method » authMethod[source]
- validator validate_proxy_password » proxyPassword[source]
- validator validate_proxy_protocol » proxyProtocol[source]
- validator validate_proxy_username » proxyUsername[source]
- pydantic model smarter.apps.plugin.manifest.models.api_connection.spec.SAMApiConnectionSpec[source]
Bases:
AbstractSAMSpecBaseSmarter API Api Connection Manifest ApiConnection.spec
Show JSON schema
{ "title": "SAMApiConnectionSpec", "description": "Smarter API Api Connection Manifest ApiConnection.spec", "type": "object", "properties": { "connection": { "$ref": "#/$defs/ApiConnection", "description": "ApiConnection.spec.selector[obj]: the selector logic to use for the ApiConnection" } }, "$defs": { "ApiConnection": { "description": "Smarter API - generic API Connection class.", "properties": { "baseUrl": { "description": "The root domain of the API. Example: 'https://api.example.com'.", "title": "Baseurl", "type": "string" }, "apiKey": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The API key for authentication, if required.", "title": "Apikey" }, "authMethod": { "default": "none", "description": "The authentication method to use. Example: 'Basic Auth', 'Token Auth'.", "title": "Authmethod", "type": "string" }, "timeout": { "default": 30, "description": "The timeout for the API request in seconds. Default is 30 seconds.", "minimum": 1, "title": "Timeout", "type": "integer" }, "proxyProtocol": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The protocol of the proxy connection. Example: 'http', 'https'.", "title": "Proxyprotocol" }, "proxyHost": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The remote host of the proxy connection.", "title": "Proxyhost" }, "proxyPort": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The port of the proxy connection.", "title": "Proxyport" }, "proxyUsername": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The username for the proxy connection.", "title": "Proxyusername" }, "proxyPassword": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The password for the proxy connection.", "title": "Proxypassword" } }, "required": [ "baseUrl" ], "title": "ApiConnection", "type": "object" } }, "required": [ "connection" ] }
- Config:
from_attributes: bool = True
arbitrary_types_allowed: bool = True
frozen: bool = True
- Fields:
- Validators:
-
field connection:
ApiConnection[Required] ApiConnection.spec.selector[obj]: the selector logic to use for the ApiConnection
- Validated by:
- smarter.apps.plugin.manifest.models.api_connection.spec.should_log(level)[source]
Check if logging should be done based on the waffle switch.
Smarter API Plugin Manifest
- pydantic model smarter.apps.plugin.manifest.models.api_connection.model.SAMApiConnection[source]
Bases:
SAMConnectionCommonSmarter API Manifest - SqlPlugin Connection Model
Show JSON schema
{ "title": "SAMApiConnection", "description": "Smarter API Manifest - SqlPlugin Connection Model", "type": "object", "properties": { "apiVersion": { "description": "apiVersion[String]: Required. The API version of the AbstractSAMBase.", "title": "Apiversion", "type": "string" }, "kind": { "description": "kind[String]: Required. The kind of resource described by the manifest.", "title": "Kind", "type": "string" }, "metadata": { "$ref": "#/$defs/SAMConnectionCommonMetadata", "description": "Connection.metadata[obj]: Required, the Connection metadata." }, "spec": { "$ref": "#/$defs/SAMApiConnectionSpec", "description": "ApiConnection.spec[obj]: Required, the ApiConnection specification." }, "status": { "anyOf": [ { "$ref": "#/$defs/SAMConnectionCommonStatus" }, { "type": "null" } ], "default": null, "description": "Connection.status[obj]: Optional, Read-only. Stateful status information about the Connection." } }, "$defs": { "ApiConnection": { "description": "Smarter API - generic API Connection class.", "properties": { "baseUrl": { "description": "The root domain of the API. Example: 'https://api.example.com'.", "title": "Baseurl", "type": "string" }, "apiKey": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The API key for authentication, if required.", "title": "Apikey" }, "authMethod": { "default": "none", "description": "The authentication method to use. Example: 'Basic Auth', 'Token Auth'.", "title": "Authmethod", "type": "string" }, "timeout": { "default": 30, "description": "The timeout for the API request in seconds. Default is 30 seconds.", "minimum": 1, "title": "Timeout", "type": "integer" }, "proxyProtocol": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The protocol of the proxy connection. Example: 'http', 'https'.", "title": "Proxyprotocol" }, "proxyHost": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The remote host of the proxy connection.", "title": "Proxyhost" }, "proxyPort": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The port of the proxy connection.", "title": "Proxyport" }, "proxyUsername": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The username for the proxy connection.", "title": "Proxyusername" }, "proxyPassword": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The password for the proxy connection.", "title": "Proxypassword" } }, "required": [ "baseUrl" ], "title": "ApiConnection", "type": "object" }, "SAMApiConnectionSpec": { "description": "Smarter API Api Connection Manifest ApiConnection.spec", "properties": { "connection": { "$ref": "#/$defs/ApiConnection", "description": "ApiConnection.spec.selector[obj]: the selector logic to use for the ApiConnection" } }, "required": [ "connection" ], "title": "SAMApiConnectionSpec", "type": "object" }, "SAMConnectionCommonMetadata": { "description": "Smarter API Connection Manifest - common Metadata class.", "properties": { "name": { "description": "The camelCase name of the manifest resource", "title": "Name", "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "The description for this resource. Be brief. Keep it under 255 characters.", "title": "Description" }, "version": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "The semantic version of the manifest. Example: 0.1.0", "title": "Version" }, "tags": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "description": "The tags of the manifest. Used for generic resource categorization and search. Example: ['tag1', 'tag2']", "title": "Tags" }, "annotations": { "anyOf": [ { "items": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "integer" }, { "type": "number" }, { "type": "boolean" }, { "format": "date", "type": "string" }, { "format": "date-time", "type": "string" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "format": "uuid", "type": "string" }, { "format": "binary", "type": "string" }, { "items": {}, "type": "array" }, { "additionalProperties": true, "type": "object" } ] }, "type": "object" }, "type": "array" }, { "type": "null" } ], "description": "The manifest annotations. Used for storing arbitrary metadata as\n key-value pairs. Example: [{'smarter.sh/test-manifest/project-name': 'Scooby dooby do'}]. The\n key should be a valid url-friendly string. The value accepts\n multi-line string values (YAML block scalars) and various scalar types including\n str, int, float, bool, datetime.date, datetime.datetime, decimal.Decimal, uuid.UUID, bytes, list, dict.\n ", "title": "Annotations" } }, "required": [ "name", "description", "version" ], "title": "SAMConnectionCommonMetadata", "type": "object" }, "SAMConnectionCommonStatus": { "description": "Smarter API Connection Manifest - Status class.", "properties": { "recordLocator": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "recordLocator[String]: An optional identifier used to locate the resource record associated with this manifest. Read only.", "title": "Recordlocator" }, "created": { "description": "The date in which this resource was created. Read only.", "format": "date-time", "title": "Created", "type": "string" }, "modified": { "description": "The date in which this resource was most recently changed. Read only.", "format": "date-time", "title": "Modified", "type": "string" }, "account_number": { "description": "Connection.status.account_number: The account owner of this Connection. Read only.", "title": "Account Number", "type": "string" }, "username": { "description": "Connection.status.account_number: The Smarter user who created this Connection. Read only.", "title": "Username", "type": "string" } }, "required": [ "created", "modified", "account_number", "username" ], "title": "SAMConnectionCommonStatus", "type": "object" } }, "required": [ "apiVersion", "kind", "metadata", "spec" ] }
- Config:
from_attributes: bool = True
arbitrary_types_allowed: bool = True
frozen: bool = True
- Fields:
- Validators:
-
field spec:
SAMApiConnectionSpec[Required] ApiConnection.spec[obj]: Required, the ApiConnection specification.
- Validated by: