ScannerVision Web Server

<back to all web services

PostConnections

The following routes are available for this service:
POST/connections
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PostConnections:
    login_command: Optional[str] = None
    logout_command: Optional[str] = None
    password: Optional[str] = None
    save_command: Optional[str] = None
    user_name: Optional[str] = None


class PermissionType(str, Enum):
    GROUP = 'Group'
    USER = 'User'


class IConnectionPermission(IInterface):
    allow: bool = False
    connection: Optional[IConnectorConnection] = None
    type: Optional[PermissionType] = None


class PropertyType(IntEnum):
    BINARY = 1
    BOOLEAN = 2
    CONNECTION_STRING = 3
    CREDENTIAL = 4
    INTEGER = 5
    PICKLIST = 6
    STRING = 7
    O_AUTH2 = 8
    CERTIFICATE = 9


class IConnectionPropertyDescription(IInterface):
    description: Optional[str] = None
    name: Optional[str] = None
    property_id: Optional[str] = None
    property_type: Optional[PropertyType] = None


class IUserGroup(IIdTemplatesItem, IGroup):
    users: Optional[ReadOnlyCollection[IUser]] = None


class IUser(IIdTemplatesItem):
    groups: Optional[ReadOnlyCollection[IUserGroup]] = None
    email_address: Optional[str] = None
    has_password: bool = False
    home_folder: Optional[str] = None
    password: Optional[str] = None
    sbc_user: Optional[bool] = None


class IConnectorConnection(IStatus):
    connector_id: Optional[str] = None
    description: Optional[str] = None
    id: Optional[str] = None
    max_connections: int = 0
    name: Optional[str] = None
    permissions: Optional[ReadOnlyCollection[IConnectionPermission]] = None
    property_descriptions: Optional[ReadOnlyCollection[IConnectionPropertyDescription]] = None
    setup_user: Optional[IUser] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetConnectionsResponse:
    connections: Optional[List[IConnectorConnection]] = None
    is_authenticated: bool = False

Python PostConnections DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /connections HTTP/1.1 
Host: buildmax.org 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"LoginCommand":"String","LogoutCommand":"String","Password":"String","SaveCommand":"String","UserName":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{Unable to show example output for type 'GetConnectionsResponse' using the custom 'other' filter}No parameterless constructor defined for this object.