Kernel::System::CloudService::Backend::Run

NAME

Kernel::System::CloudService::Backend::Run – cloud service lib

DESCRIPTION

All functions for cloud service communication.

PUBLIC INTERFACE

new()

create a CloudService object. Do not use it directly, instead use:

    my $CloudServiceObject = $Kernel::OM->Get('Kernel::System::CloudService::Backend::Run');

Request()

perform a cloud service communication and return result data

    my $RequestResult = $CloudServiceObject->Request(
        OTRSIDAuth => { #  will be send encoded as JSON
            OTRSID => '',
            Password => '',
        },
        UniqueIDAuth => { #  will send encoded as JSON
            UniqueID => '',
            APIKey => '',
        },
        RequestData => { # this complex structure will be send encoded as JSON
            CloudServiceTest => [
                {
                    InstanceName = 'AnyName', # optional
                    Operation    => "ConfigurationSet",
                    Data         => {
                        # ... request operation data ...
                    },
                },
                {
                    Operation    => "SomeOperation",
                    Data         => {
                        # ... request operation data ...
                    },
                },
                # ... other entries may follow ...
            ],
            FeatureAddonManagement => [
                {
                    Operation    => "FAOListAssigned",
                    Data         => {
                        # ... request operation data ...
                    },
                },
                {
                    InstanceName = 'InstanceNameOne', # optional
                    Operation    => "FAOGet",
                    Data         => {
                        # ... request operation data ...
                    },
                },
                {
                    InstanceName = 'InstanceNameTwo', # optional
                    Operation    => "FAOGet",
                    Data         => {
                        # ... request operation data ...
                    },
                },
                # ... other entries may follow ...
            ],
            # ... other entries may follow ...
        },
        Timeout => 15,                  # optional, timeout
        Proxy   => 'proxy.example.com', # optional, proxy
    );

Returns: $RequestResult { Success => 1, ErrorMessage => '…', # optional Results => { CloudServiceTest => [ { Success => 1, # 1 or 0 ErrorMessage => '…', # optional InstanceName = 'AnyName', # optional Operation => "ConfigurationSet", Data => { # … response operation data .. }, }, { Success => 0, # 1 or 0 ErrorMessage => '…', # optional Operation => "SomeOperation", Data => { # … response operation data … }, }, ],

            FeatureAddonManagement => [
                {
                    Success      => 1, # 1 or 0
                    ErrorMessage => '...', # optional
                    Operation    => "FAOListAssigned",
                    Data         => {
                        # ... response operation data ..
                    },
                },
                {
                    Success      => 1, # 1 or 0
                    ErrorMessage => '...', # optional
                    InstanceName = 'InstanceNameOne', # optional
                    Operation    => "FaoGet",
                    Data         => {
                        # ... response operation data ...
                    },
                },
                {
                    Success      => 0, # 1 or 0
                    ErrorMessage => '...', # optional
                    InstanceName = 'InstanceNameTwo', # optional
                    Operation    => "FaoGet",
                    Data         => {
                        # ... response operation data ...
                    },
                },
            ],
        },
    };

OperationResultGet()

    my $OperationResult = $CloudServiceObject->OperationResultGet(
        CloudService => 'Test',
        Operation    => 'test',
        InstanceName => 'AnyName',      # optional
        RequestResult =>  {
            Success      => 1,
            Results      => {
                Test => [
                    {
                        Success      => 1,
                        InstanceName => 'AnyName',
                        Operation    => 'Test',
                        Data         => {
                            # ... response operation data ..
                        },
                    },
                    {
                        Success      => 0,
                        ErrorMessage => 'some message',
                        Operation    => 'SomeOperation',
                        Data         => {
                            # ... response operation data ...
                        },
                    },
                ],
            },
        };
    );

Returns:

    $OperationResult {
        Success      => 1,
        ErrorMessage => 'a message'         # optional
        InstanceName => 'AnyName',
        Operation    => "Test",
        Data         => {
            # ... response operation data ..
        },
    },
Scroll to Top