API - Manage Asset

Purpose

A post API to create and modify an asset in Sectona.

Accessing the API

XML
Endpoint: /API/APP/APP007/ManageAsset


HTTP METHOD

XML
POST


Parameters

Parameters

Data Type

Required

Description

APIActionType

String

Yes

Create OR Modify

AssetCategory

String

No

Asset category name (Considered OperatingSystem if APIActionType is Create and parameter is not provided)

AssetType

String

Yes

Asset type

HostName

String

Yes

Asset host name

DBInstance

String

No

Database instance (Required if AssetCategory is Database)

IPAddress

String

Yes

IP address

SecondaryIP

String

No

Secondary IP address. (Considered for modification when APIActionType is Modify and parameter is provided)

AssetVersion

String

No

Asset version. (Considered for modification when APIActionType is Modify and parameter is provided)

Description

String

No

Asset description

PortNo

Number

No

Port number. (Considered for modification when APIActionType is Modify and parameter is provided)

Config1

String

No

Value of config 1. (Considered for modification when APIActionType is Modify and parameter is provided)

Config2

String

No

Value of config 2. (Considered for modification when APIActionType is Modify and parameter is provided)

Config3

String

No

Value of config 3. (Considered for modification when APIActionType is Modify and parameter is provided)

Config4

String

No

Value of config 4. (Considered for modification when APIActionType is Modify and parameter is provided)

Location

String

No

Location name. (Considered for modification when APIActionType is Modify and parameter is provided)

CriticalityLevel

String

No

Criticality level. (Considered for modification when APIActionType is Modify and parameter is provided)

Owner

String

No

Owner name. (Considered for modification when APIActionType is Modify and parameter is provided)

Tags

String

No

Tags to be assigned to asset (multiple tags can be provided by comma separated)

CheckoutPolicy

String

No

Default policy will be assigned if policy name not provided. (Considered for modification when APIActionType is Modify and parameter is provided)

RotationPolicy

String

No

Default policy will be assigned if policy name not provided. (Considered for modification when APIActionType is Modify and parameter is provided)

ReconciliationPolicy

String

No

Default policy will be assigned if policy name not provided. (Considered for modification when APIActionType is Modify and parameter is provided)

AssetJITPolicy

String

No

Default policy will be assigned if policy name not provided. (Considered for modification when APIActionType is Modify and parameter is provided)

ExcludeFromAccountDiscovery

Boolean

No

Exclude this asset from account discovery. (Considered for modification when APIActionType is Modify and parameter is provided)

EnforceHostNameForConnection

Boolean

No

Enforce host name for connection. (Considered for modification when APIActionType is Modify and parameter is provided)

NewAssetType

String

No

Asset type (required when APIActionType is Modify and asset type to be modify)

NewHostName

String

No

Asset host name (required when APIActionType is Modify and host name to be modify)

NewDBInstance

String

No

Database instance (Required if APIActionType is Modify and AssetCategory is Database and Database to be modify)

NewIPAddress

String

No

New IP address (required when APIActionType is Modify and IP address to be modify)

Instance

String

Yes

Instance name

IsActive

Boolean

No

Status of asset (Default status is true when APIActionType is Create. Considered for modification when APIActionType is Modify and parameter is provided)


Sample Request (JSON)

XML
{
	 "APIActionType":"Create/Modify",
     "AssetCategory ":"Asset category",
     "AssetType ":"Asset type",
     "HostName ":"Host name",
     "DBInstance":"Database instance",
     "IPAddress ":"IP address",
     "SecondaryIP":"Secondary IP",
     "AssetVersion ":"Asset version",
     "Description ":"Description",
     "PortNo ":"Port No",
     "Config1":"Config1 data",
     "Config2":"Config2 data",
     "Config3":"Config3 data",
     "Config4":"Config4 data",
     "Location":"Location",
     "CriticalityLevel ":"Criticality level",
     "Owner ":"Owner",
     "Tags ":"Tag name 1,Tag name 2,…,Tag name n",
     "CheckoutPolicy ":"Checkout policy name",
     "RotationPolicy ":"Rotation policy name",
     "ReconciliationPolicy ":"Reconciliation policy name",
     "AssetJITPolicy":"Asset JIT policy name",
     "ExcludeFromAccountDiscovery ":true/false,
     "EnforceHostNameForConnection":true/false,
     "NewAssetType ":"New asset type",
     "NewHostName":"New host name",
     "NewDBInstance":"New database instance",
     "NewIPAddress":"New IP address",
     "Instance":"Instance name",
     "IsActive":true/false,
}


Sample Response (JSON)

XML
{
	"Version":"6.0.0.0",
	"IsSuccess”: true,
	"LogCode":"0",
	"Message":"Asset XXXX / 0.0.0.0 created/Updated successfully",
	"StatusCode":"OK",
	"Timestamp":"22 Apr 2019 18:33:25 GMT 05:30:00"
}


Standard Error Response Codes

Error Code

Error Description

011649

Current user do not have permission to take an action

011651

The authorization header is either empty or not basic

011673

Invalid credentials

011674

Invalid credentials

011675

Unable to validate request

011683

Invalid instance name

011803

Unable to insert API log details

032402

The system was unable to create asset

011658

Invalid asset type

011659

Invalid asset version

011660

Invalid Location

011661

Invalid Tags

011662

Invalid password checkout policy

011663

Invalid password rotation policy

011664

Invalid password reconciliation policy

011679

Unable to get asset properties

011684

Invalid criticality Level

011680

Unable to perform action

011842

Unable to create asset

011848

Invalid password Asset JIT policy