← Back to packages

Package vsam

Service VSamService

Message ExecuteCommandsRequest

Message ExecuteCommandsResponse

Message GetElementsFilter

Message GetElementsRequest

Message GetElementsResponse

Message GetInfoRequest

Message GetInfoResponse

Message HSMElementFlags

Message MediaAPDU

Message MediaInfo

Message MediaResponse

Message PingRequest

Message PingResponse

Message ReadMediaInfoRequest

Message ReadMediaInfoResponse

Message SetStatusRequest

Message SetStatusResponse

Message TopupMediaRequest

Message TopupMediaResponse

Message VSAMCommand

Message VSAMCommandResponse

Message VSAMMetadata

Message VSamElement

Enum QuarantineStatus

Enum VSAMChipType

Enum VSAMExternalStatus

Services

service VSamService

Can be used to check if the server and sam is alive and responding.

Retrieves information about the VSAM service, including server resource usage such as memory and CPU.

Retrieves all SAM chip elements associated with the server, along with their metadata, including UID, chip balance, issuance and expiration dates, and external SAM status.

Allows the client to execute commands on a specific element. This is a streaming method where the client can send multiple commands and receive responses in a streaming fashion. Upon initiating executeCommands, the SAM will be locked and unlocked after the client closes the communication channel.

The method returns the commands to be sent to the card and, at the end of the process, responds with the card balance and data.

Streams the process of topping up credit on a user card. This method is responsible for allocating an LSAM from the VSAM, debiting it, crediting the user's card, confirming the transaction, generating the signature, and completing the process.

Sets a status for an element (LSAM). This status is persisted in the database and can be used by the client to determine actions to be taken on the LSAM, such as parameterizations and initializations. The status set here is returned in getElements.

Messages

message ExecuteCommandsRequest

Request message to execute commands.

Field Type Description
1 elementId uint32

ID of the element.

2 commands repeated vsam.ExecuteCommandsRequest.VSAMCommand

List of VSAM commands.

message ExecuteCommandsResponse

Response message containing command execution results.

Field Type Description
1 elementId uint32

ID of the element.

2 responses repeated vsam.ExecuteCommandsResponse.VSAMCommandResponse

List of VSAM command responses.

message GetElementsFilter (Nested in vsam.GetElementsRequest )

Filter for getting elements.

Field Type Description
1 uid optional bytes

Unique identifier of the element.

2 status optional vsam.VSAMExternalStatus

External status of the element.

3 ltBalance optional uint32

Balance of the element. Less than.

4 gteBalance optional uint32

Balance of the element. Greater than or equal to.

5 quarantineStatus optional vsam.GetElementsRequest.QuarantineStatus

Only quarantined elements.

message GetElementsRequest

Request message to get elements.

Field Type Description
1 filter optional vsam.GetElementsRequest.GetElementsFilter

Filter for getting elements (optional).

message GetElementsResponse

Response message containing elements.

Field Type Description
1 elements repeated vsam.VSamElement

List of VSAM elements.

message GetInfoRequest

Request message to get information.

Field Type Description
1 checkHSMConnection optional bool

Flag to indicate whether to check the HSM connection. Default is false.

message GetInfoResponse

Response message containing information.

Field Type Description
1 version string

Version of the system.

2 uptime uint32

Uptime of the system in seconds.

3 ip string

IP address of the system.

4 hsmHost string

HSM host of the system.

5 macAddress string

MAC address of the system.

6 totalMemory uint32

Total memory of the system in bytes.

7 freeMemory uint32

Free memory of the system in bytes.

8 usedMemory uint32

Used memory of the system in bytes.

9 cpuUsage uint32

CPU usage of the system in percentage.

10 userPool string

User pool of the system.

message HSMElementFlags

Flags for the HSM element.

Field Type Description
1 isAPic bool

Flag indicating if the element is an APic.

2 isInUse bool

Flag indicating if the element is in use.

3 isOnGroups bool

Flag indicating if the element is on groups.

4 isOnHold bool

Flag indicating if the element is on hold.

5 isUnavailable bool

Flag indicating if the element is unavailable.

message MediaAPDU

Media APDU command.

Field Type Description
1 apdu bytes

APDU command.

message MediaInfo

Media information.

Field Type Description
1 csn bytes

Card Serial Number of the media.

2 balance uint32

Balance of the media.

3 balancePost uint32

Balance post of the media.

message MediaResponse

Response message containing media information.

Field Type Description
1 isOK bool

Flag indicating if the operation is successful.

2 rawData bytes

Raw data of the response.

message PingRequest

Request message for Ping (health check).

Field Type Description

message PingResponse

Response message for Ping (health check).

Field Type Description
1 isOK bool

Flag indicating if the system is healthy.

message ReadMediaInfoRequest

Request message to read media information.

Field Type Description
1 uid uint64

Unique identifier of the media.

2 response repeated vsam.MediaResponse

List of media responses.

message ReadMediaInfoResponse

Response message containing media information after reading.

Field Type Description
1 uid uint64

Unique identifier of the media.

2 commands repeated vsam.MediaAPDU

List of media APDU commands.

3 mediaInfo vsam.MediaInfo

Media information.

message SetStatusRequest

Request message to set status of an element.

Field Type Description
1 elementId uint32

ID of the element.

2 status vsam.VSAMExternalStatus

External status of the element.

message SetStatusResponse

Response message after setting status of an element.

Field Type Description
1 elementId uint32

ID of the element.

2 status vsam.VSAMExternalStatus

External status of the element.

message TopupMediaRequest

Request message to top up media.

Field Type Description
1 uid uint64

Unique identifier of the media.

2 value uint32

Value to top-up.

3 response repeated vsam.MediaResponse

List of media responses.

message TopupMediaResponse

Response message after top up media.

Field Type Description
1 uid uint64

Unique identifier of the media.

2 commands repeated vsam.MediaAPDU

Value to top-up.

3 mediaInfo vsam.MediaInfo

Media information.

4 signature bytes

Signature of the transaction.

message VSAMCommand (Nested in vsam.ExecuteCommandsRequest )

VSAM command.

Field Type Description
1 apdu bytes

APDU command.

message VSAMCommandResponse (Nested in vsam.ExecuteCommandsResponse )

Response for a VSAM command.

Field Type Description
1 sw uint32

Status word of the response.

2 data bytes

Data of the response.

3 rawData bytes

Raw data of the response.

4 isOK bool

Flag indicating if the command execution is successful.

message VSAMMetadata

Metadata of the VSAM element.

Field Type Description
1 uid bytes

Unique identifier of the element.

2 type vsam.VSAMChipType

chip Type of the element

3 issueDate uint32

Issue date of the element (epoch in secods).

4 expirationDate uint32

Expiration date of the element (epoch in seconds).

5 lifeCycle uint32

Life cycle of the element.

6 balance uint32

Balance of the element.

7 status vsam.VSAMExternalStatus

External status of the element.

8 lastStatusUpdate optional uint32

Last status update of the element (epoch in seconds).

9 isQuaratined bool

Flag indicating if the element is quarantined.

10 hsmGroups repeated uint32

HSM groups of the element.

message VSamElement

VSAM element.

Field Type Description
1 id uint32

ID of the element.

2 serial bytes

Serial number of the element.

3 flags vsam.HSMElementFlags

Flags of the element.

4 metadata vsam.VSAMMetadata

Metadata of the element.

Enums

enum QuarantineStatus

Name Number Description
undefined 0

All elements.

quarantinedOnly 1

Only quarantined elements.

unQuarantinedOnly 2

Only non-quarantined elements.

enum VSAMChipType

Enum for the type of VSAM chip.

Name Number Description
LSAM 0

LSAM

enum VSAMExternalStatus

Enum for the external status of VSAM.

Name Number Description
undefined 0

Undefined status

configured 1

configured status