• Please be aware that ADSM.ORG will be going through forum software conversion and migration over the next several weeks. The cut-over date and time will be posted in the ADSM.ORG News & Announcements section as we near the target date. Please visit the following link for more details ADSM News & Announcements
  • Community Tip: Please Give Thanks to Those Sharing Their Knowledge.

    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.

  • Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)

    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

Examples of syntax for the Operations Center REST API

sergio.morales

ADSM.ORG Member
Joined
Jun 20, 2003
Messages
131
Reaction score
2
Points
0
Website
http
Hello everyone. Recently I've started to tinker with the REST API available on Operations Center (8.1.4) and I was wondering if anyone had any resources out there that show me the syntax for using it? I'm interested in all the available commands, but specifically the following commands:

cli/issueCommand, cli/issueCommand/{server name}, cli/issueConfirmedCommand, bcli/issueConfirmedCommand/{server name}

Again, if anyone has any syntax examples they'd be willing to share, I'd appreciate it!

Thanks in advance!
 

brenx

Newcomer
Joined
Feb 20, 2023
Messages
1
Reaction score
0
Points
0
Hi,
this is an old post, but in case it can help someone :
I use powershell and my peace of code goes like :

$admin = "[username]"
$pass = "[password]"

$passSEC = ConvertTo-SecureString -String $pass -AsPlainText -Force
$cred = [pscredential]::new($admin,$passSEC)

$headers = @{}
$headers.add("OC-API-Version", "1.0")
$headers.Add("accept" , "application/json")
$headers.add("Content-Type","text/plain")

$body = "SELECT START_TIME,END_TIME,BYTES_PROTECTED,SOURCE_POOL,TARGET_POOL FROM PROTHISTORY WHERE START_TIME>current_timestamp-72 hours order by START_TIME DESC" # here it's select that will be used in call
$comm = Invoke-RestMethod -uri "https://[oc_server_address]:11090/oc/api/cli/issueCommand/[tsm_server_name]" -Body $body -Credential $cred -Headers $headers -Method POST

# results can be accsessed from $comm.items. Down we have report for protection of storage pool
$comm.items | select SOURCE_POOL,TARGET_POOL,`
@{N="start";E={(get-date 01.01.1970).AddSeconds(($_ | select -ExpandProperty START_TIME).secs + ($_ | select -ExpandProperty START_TIME).tzo)}},`
@{N="end";E={(get-date 01.01.1970).AddSeconds(($_ | select -ExpandProperty END_TIME).secs + ($_ | select -ExpandProperty START_TIME).tzo)}},`
@{N="protected GB";E={[math]::round((($_ | select -ExpandProperty BYTES_PROTECTED)/1GB),2)}},`
@{N="duration";E={((get-date 01.01.1970).AddSeconds(($_ | select -ExpandProperty END_TIME).secs) - ((get-date 01.01.1970).AddSeconds(($_ | select -ExpandProperty START_TIME).secs)))}}
 

The Spectrum Protect TLA (Three-Letter Acronym): ISP or something else?

  • Every product needs a TLA, Let's call it ISP (IBM Spectrum Protect).

    Votes: 22 19.5%
  • Keep using TSM for Spectrum Protect.

    Votes: 67 59.3%
  • Let's be formal and just say Spectrum Protect

    Votes: 15 13.3%
  • Other (please comement)

    Votes: 9 8.0%

Forum statistics

Threads
31,872
Messages
134,996
Members
21,853
Latest member
mbacca70
Top