SOAP API EntityService, Methods
Method: GetEntityByID
Description
Retrieve the entity by ID.
Input
The input of this method is the argument GetEntityByID having the following structure.
Element | Type | Nillable? | Description |
---|---|---|---|
entityID | int | No | The entity ID. |
Output
An entity with that ID.
Element | Type | Nillable? | Description |
---|---|---|---|
GetEntityByIDResult | EntityDataModel | Yes | Response model for the Entity. |
Faults
Name | Content | Description |
---|---|---|
LogRhythmWebServiceFaultFault | LogRhythmWebServiceFault | This is the error message object for all of LogRhythm Web Services. This object provides custom meaningful error messages to the client while retaining security precautions for the system. |
EXAMPLE
private EntityDataModel GetEntityByID(int entityID)
{
EntityServiceClient entityClient = null;
EntityDataModel model = null;
try
{
// Create connection to service.
entityClient = new EntityServiceClient("EntityServiceBasicAuth_EntityService");
entityClient.ClientCredentials.UserName.UserName = username;
entityClient.ClientCredentials.UserName.Password = password;
// Call method retrieving data model.
model = entityClient.GetEntityByID(entityID);
}
finally
{
if (entityClient != null && entityClient.State != System.ServiceModel.CommunicationState.Faulted)
{
entityClient.Close();
}
}
// This model is a single entity data model for the entity which ID was supplied. Or if not found you have a null object.
return model;
}
Method: GetEntityByName
Description
Retrieve an entity by name and root ID.
Input
The input of this method is the argument GetEntityByName having the following structure.
Element | Type | Nillable? | Description |
---|---|---|---|
entityName | string | Yes | Name of the entity. |
rootEntityID | int | No | The root entity ID. |
Output
A list of entities with that name.
Element | Type | Nillable? | Description |
---|---|---|---|
GetEntityByNameResult | ArrayOfEntityDataModel | Yes |
|
Faults
Name | Content | Description |
---|---|---|
LogRhythmWebServiceFaultFault | LogRhythmWebServiceFault | This is the error message object for all of LogRhythm Web Services. This object provides custom meaningful error messages to the client while retaining security precautions for the system. |
EXAMPLE
private EntityDataModel[] GetEntityByName(string entityName, int parentEntityID)
{
EntityServiceClient entityClient = null;
EntityDataModel[] model = null;
try
{
// Create connection to service.
entityClient = new EntityServiceClient("EntityServiceBasicAuth_EntityService");
entityClient.ClientCredentials.UserName.UserName = username;
entityClient.ClientCredentials.UserName.Password = password;
// Call method retrieving data model.
model = entityClient.GetEntityByName(entityName, parentEntityID);
}
finally
{
if (entityClient != null && entityClient.State != System.ServiceModel.CommunicationState.Faulted)
{
entityClient.Close();
}
}
// This model is a single entity data model for the entity which ID was supplied. Or if not found you have a null object.
return model;
}
Method: GetRootEntityByName
Description
Retrieve a root entity by name.
Input
The input of this method is the argument GetRootEntityByName having the following structure.
Element | Type | Nillable? | Description |
---|---|---|---|
entityName | string | Yes | Name of the entity. |
Output
A list of entities with that name.
Element | Type | Nillable? | Description |
---|---|---|---|
GetRootEntityByNameResult | ArrayOfEntityDataModel | Yes |
|
Faults
Name | Content | Description |
---|---|---|
LogRhythmWebServiceFaultFault | LogRhythmWebServiceFault | This is the error message object for all of LogRhythm Web Services. This object provides custom meaningful error messages to the client while retaining security precautions for the system. |