Commodore Commodore
Commodore
647 views

ServerService update

Jump to solution

why doe this does not work?

/opsw/api/com/opsware/server/ServerService/method
[b42139s@prd-vusaapp12 method](18) $ ./update self:i=180101 ServerVO.use="TEST"

 

Exception occurred while calling: update

ID: HPSA-005
Code: com.opsware.common.MessageSpec.ILLEGAL_VALUE
Details: vo is set to the illegal value null.

 

0 Likes
1 Solution

Accepted Solutions
Commodore
Commodore

The syntax is probably similar to one of the example scripts in the docs.

https://docs.microfocus.com/itom/Server_Automation:2018.08/API_Unified/Example_Scripts_1

# Create a public static group.
./create "vo={ parent:i=$public_root shortName=’Test Group A’ }"

 

However, I'd check whether "TEST" is a legit value.

From the twister docs:

public void setUse(java.lang.String use)

Set the intended use of the managed server.

Parameters:

use - One of: DEVELOPMENT, STAGING, PRODUCTION, or UNKNOWN.

 

View solution in original post

7 Replies
Commodore Commodore
Commodore

I mean I can create a python script based on the "pytwist Handbook" but I want to understand why and how sh script differ in handling these calls.

0 Likes
Micro Focus Expert
Micro Focus Expert

The method takes a ServerVO type object as the argument "vo".

I'd recommend to use the getServerVO method to obtain the current data, modify it and then apply your modifications with the update method.

0 Likes
Commodore Commodore
Commodore

and how do you do the update after the modification is done on the vo:

 method](24) $ vo=`./getServerVO self:i=180101`

./update  self:i=180101 ....?....

0 Likes
Commodore
Commodore

The syntax is probably similar to one of the example scripts in the docs.

https://docs.microfocus.com/itom/Server_Automation:2018.08/API_Unified/Example_Scripts_1

# Create a public static group.
./create "vo={ parent:i=$public_root shortName=’Test Group A’ }"

 

However, I'd check whether "TEST" is a legit value.

From the twister docs:

public void setUse(java.lang.String use)

Set the intended use of the managed server.

Parameters:

use - One of: DEVELOPMENT, STAGING, PRODUCTION, or UNKNOWN.

 

View solution in original post

Commodore Commodore
Commodore

Thanks RandomGuy,

 

TEST is a "use" that you can add in administration/attribute.

Anyway it works if used like this:

 

./update self:i=180101 "vo={ use="TEST"}" force=true refetch=false

method](76) $ ./getServerVO
{
osFlavor=
hostName="prd-vobrapp02.bbtnet.com"
virtualizationType=1
rebootRequired=false
use="TEST"
origin="ASSIMILATED"

0 Likes
Commodore Commodore
Commodore

We're migrating servers from one mesh to another (new infrastructure) and need to set the values to what they  were in the old.

 

so this also works:

./update self:i=180101 "vo={ use="TEST" stage="LIVE" }" force=true refetch=false

0 Likes
Micro Focus Expert
Micro Focus Expert

Given you're requirement we already ship a tool that does this and more.
# less /opt/opsware/support/man/man1/migrate.1

I would avoid reinventing the wheel.

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.