Latest post Tue, Nov 16 2021 11:36 AM by Antony Mitchell. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • Sun, Jun 28 2020 9:52 PM

    • jamieparry
    • Not Ranked
    • Joined on Wed, Jan 20 2010
    • Posts 4
    • Points 70

    reading available nexis workspaces

    very basic request here

    i want to make a commandline tool in python that just lists all our current nexis workspaces

    what would be the api call to do that please?

    i tried to follow the guidelines in the docs but didn't get very far i'm afraid.

    I'm used to making api calls on the baselight and from web services (that i've written in flask) but so far i haven't fully "got" what i need to do with nexis (ie what users are allowed to do what etc etc)

    all i want is a list though so surely i don't need massive root rights for just that?

    i have access through the nexis client manager so i know i can list things that way but, y'know..workflow yadda yadda..

    :-)

    any guidance would be very much appreciated. thankyou

    jamie

  • Mon, Aug 3 2020 2:03 PM In reply to

    Re: reading available nexis workspaces

    Not sure about Python, but this is what you need to do:

     

    The Nexis API is a REST service. First you need to use a login call to https://<nexis-host>/api/login . This gives you a token. With the token you can call https://<nexis-host>/api/workspaces. This gives you a list of all the workspaces and a large list of metadata to choose from.

    You might want to start with a tool like Postman. Its a direct way of testing the Nexis API. 

    I am fairly certain you need a administrator account to make a succesfull call to workspaces. You get a "Unable to complete operation. Protected." response if not.

    Example of the response (with only two workpace):

    {

        "workspace": [

            {

                "outID": "18968575579267",

                "ioName": "Workspace Name 1",

                "ioDescription": "",

                "outStorageGroupName": "storage group1",

                "ioStorageGroupID": "65537",

                "outSubGroupName": "Default",

                "ioSubGroupID": "0",

                "ioByteCount": "4000000000000",

                "outDeletePending": "0",

                "outUsedByteCount": "1793450558984",

                "outPercentUsed": "4483",

                "outPercentUsedString": "44.83%",

                "outReservedByteCount": "4000000000000",

                "outAvailableByteCount": "2206549441016",

                "outAllocatedByteCount": "2261255192576",

                "outFileCount": "19581",

                "outDirectoryCount": "89",

                "outDirInfoControls": "0",

                "outStatusString": "",

                "outConfigChanges": "5",

                "outStatus": "0",

                "outMinimumByteCount": "1793450558984",

                "outMaximumByteCount": "310784491381760",

                "outCnfgChunkSizePO2": "22",

                "ioProtectionMode": "1",

                "ioProtectionModeLocal": "4",

                "outSupportedProtectionMode": "1",

                "outPerformance": "1"

            },

            {

                "outID": "19241453456208",

                "ioName": "Workspace Name 2",

                "ioDescription": "",

                "outStorageGroupName": "storage group1",

                "ioStorageGroupID": "65537",

                "outSubGroupName": "Default",

                "ioSubGroupID": "0",

                "ioByteCount": "19000000000000",

                "outDeletePending": "0",

                "outUsedByteCount": "9851224613557",

                "outPercentUsed": "5184",

                "outPercentUsedString": "51.84%",

                "outReservedByteCount": "19000000000000",

                "outAvailableByteCount": "9148775386443",

                "outAllocatedByteCount": "12343723425792",

                "outFileCount": "27307",

                "outDirectoryCount": "303",

                "outDirInfoControls": "0",

                "outStatusString": "",

                "outConfigChanges": "5",

                "outStatus": "0",

                "outMinimumByteCount": "9851224613557",

                "outMaximumByteCount": "325784491381760",

                "outCnfgChunkSizePO2": "22",

                "ioProtectionMode": "1",

                "ioProtectionModeLocal": "4",

                "outSupportedProtectionMode": "1",

                "outPerformance": "1"

            }

    ]

    }

  • Sat, Sep 12 2020 11:51 PM In reply to

    Re: reading available nexis workspaces

    Hello rens van der Zwan I am trying to do exactly this but my Postman knowledge is a bit lacking. I am able to do the API call to login and get the token response in JSON format. However I do not know how to then use this to get the list of workspaces. How do I use postman to then do the second part of getting the JSON list of workspaces as you have shown here? 

    I also want to the do this via javascript (XMLHttpRequest) however I cant even do the login part with this as I get a CORS error about not having "Access-Control-Allow-Origin" in the headers. Any help on this would be much appreciated too.

    Regards,

    Murray

  • Sun, Sep 13 2020 9:38 AM In reply to

    Re: reading available nexis workspaces

    Hi, Murray

    The Nexis API uses tokens. The basic idea is to login once with the Admin credentials you also use for administering the system.

    This login gives you a "token" response. In this token is a field called "value". You need to use the value of this field for any other api call.

    Usually a token is valid for a limited period so you need to take in account if you receive a "400" error saying "Your session is no longer valid, please log in again." you need to get a new token by login in again. There is also a https://NexisVirtualHostName/api/checksession endpoint where you can test the validity of the session.

    If your Nexis has an invalid or expired certificate you could swith off the 'ssl certificate verification' in Postman's 'General' settings. Not a best practice btw.

    I have included a Postman collection which you can import into you own local Posman install. You need to provide the Nexis virtual hostname and credentials of you own system. I have only included login,logout and Workspaces API call. Have also included a pdf with the specifics of the calls. (Had to zip the documents as the forum only accepts certain file formats)

    Hope this gets you going.

     

    I have very limited experience with Javascript so i can't realy help in this area i am afraid. 

     

  • Tue, Dec 8 2020 6:18 PM In reply to

    • ProjectEng01
    • Not Ranked
    • Joined on Wed, Apr 29 2015
    • Maryland
    • Posts 8
    • Points 70

    Re: reading available nexis workspaces

    I know that this is a post from earlier in 2020 Big Smile

    I want to test if I can get a user's workspace R/W access using Postman.  Thanks for the zip and info.

  • Tue, Dec 8 2020 8:24 PM In reply to

    Re: reading available nexis workspaces

    I have not done this myself but you may find something useful in the API Doc I have uploaded.

     

    Cheers,

     

    Murray

  • Tue, Dec 8 2020 9:11 PM In reply to

    • ProjectEng01
    • Not Ranked
    • Joined on Wed, Apr 29 2015
    • Maryland
    • Posts 8
    • Points 70

    Re: reading available nexis workspaces

    First thing off the bat is that you may need to request an access token from the avid partners email...

    Cheers,

    Ferddy

  • Tue, Nov 16 2021 11:36 AM In reply to

    Re: reading available nexis workspaces

    rens van der Zwan:
    The Nexis API is a REST service. First you need to use a login call to https://<nexis-host>/api/login . This gives you a token. With the token you can call https://<nexis-host>/api/workspaces. This gives you a list of all the workspaces and a large list of metadata to choose from.

    The current api is prefixed by nxapi, but does not include a 'workspaces' end point, nor any method to retrieve them as far as I can see.

    Presumably at some point it did for your example to have worked, I wonder why it got removed.

    I tried moving api -> nxapi but the workspace end point is not there, and nothing is documented.

    Any pointers to get this working welcome.

     

     

Page 1 of 1 (8 items)

© Copyright 2011 Avid Technology, Inc.  Terms of Use |  Privacy Policy |  Site Map |  Find a Reseller