Phone sales support +39 0575 05077
  Phone technical support +39 0575 0508
 
Computing > 4 - Advanced manipulation of the items > Managing the Cloud Server Notes

4.1.11 Managing the Cloud Server Notes

Using Aruba's WsEndUser SetChangeNoteServer method you can add, change or delete the notes associated with the virtual server specified. You can completely delete the notes, by setting an empty string string. The insertion of a new note overwrites the note previously stored.

Parameters
serverId
Type: int
System.Int32 type value which represents the unique identifier of the virtual server.
note
Type: string
System.String type value that represents the notes you want to associate with the virtual server specified.

Let's look at the example of a method that sets the notes of a virtual server.

//IWsEndUser.SetChangeNoteServer Method (c# .NET)
private static void AddServerNote(WsEndUserClient client, int serverId, string note)
{
    try
    {
        //calls the SetChangeNoteServer method, 
        //getting a WsResult object
        WsResult result = client.SetChangeNoteServer(serverId, note);

        if (!result.Success)
            throw new ApplicationException(result.ResultMessage);
    }
    catch (Exception ex)
    {
        //relaunches the error
        throw new ApplicationException(ex.Message);
    }
}
//IWsEndUser.setChangeNoteServer Method (JAVA)
private static void AddServerNote(IWsEndUser client, int serverId, String note)
{
    try
    {
        //calls the SetChangeNoteServer method, 
        //getting a WsResult object
        WsResult result = client.setChangeNoteServer(serverId, note);

        //if the call fails; it relaunches the error indicating the message
        if (!result.isSuccess())
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error
        System.out.println(ex);
    }
}

Let's look at the example of a method that removes the notes of a virtual server.

//IWsEndUser.SetChangeNoteServer Method (c# .NET)
private static void RemoveServerNote(WsEndUserClient client, int serverId)
{
    try
    {
        WsResult result = client.SetChangeNoteServer(serverId, null);

        if (!result.Success)
            throw new ApplicationException(result.ResultMessage);
    }
    catch (Exception ex)
    {
        //relaunches the error
        throw new ApplicationException(ex.Message);
    }
}
//IWsEndUser.setChangeNoteServer Method (JAVA)
private static void RemoveServerNote(IWsEndUser client, int serverId)
{
    try
    {
        //calls the SetChangeNoteServer method, 
        //getting a WsResult object
        WsResult result = client.setChangeNoteServer(serverId, null);

        //if the call fails; it relaunches the error indicating the message
        if (!result.isSuccess())
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        //prints the error
        System.out.println(ex);
    }
}

Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl
See also

API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl