cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Occasional contributor

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

Hmmmm dreaming of Travel and Holidays here 🙂

I tried example "curl -X GET --url https://flex[blah]-uat.compliance.flexnetoperations.com/api/1.0/instances/[blahblah]/version   "

and guess what ... voila it worked.. I get a response

(✿◠‿◠) ... ѽ͜ (ᵔ ̮ ᵔ)›

However.. I got more questions now:) on your previous response you said first I need to authorize, and then I can list the features.. I'm stuck on authorizing.. so the url and the endpoint, I got figured.

-- 

3. Authorize - https://flexXXXX.compliance.flexnetoperations.com/api/1.0/instances/XXXXXXXXXXXX/authorize using a body:

{
"user":"admin",
"password":"PasswordFromStep2Above"
}

where XXXXXXXXXXXX is your unique CLS ID

4. Features - https://flexxxxx.compliance.flexnetoperations.com/api/1.0/instances/XXXXXXXXXXXX/features

----

here is what I tried :

curl -X GET --url https://flex[blah]-uat.compliance.flexnetoperations.com/api/1.0/instances/[blahblah]/features

{

  "key" : "glsErr.userAccessDenied",

  "message" : "Access denied to uri=/GlobalLicensingService/api/1.0/instances/[blahblah]/features for user (unknown)",

  "arguments" : [ "uri=/GlobalLicensingService/api/1.0/instances/[blahblah]/features", "(unknown)" ]

}

that's fair! you want to get to know me before you talk to me.. 🙂 

---- to authorize I tried :

curl -i -H "Accept: application/json" -H "X-HTTP-Method-Override: PUT" -X PUT -d"user":"usernamex","password":"open sesame " --url https://flex[blah]-uat.compliance.flexnetoperations.com/api/1.0/instances/[blahblah]/authorize

and I get no response. 

-- I tried also 

curl -i --header "Content-Type: application/json" --request POST --data '{"user":"itsme","password":"opensesame"}' https://flex[blah]-uat.compliance.flexnetoperations.com/api/1.0/instances/[blahblah]/authorize

still no luck , they get no response and if I try ../features I get user access denied. So /authorize did not work.  

I am guessing I have not gotten the curl parameters right. If you have any insight please ... 

 

Cheers, and thanks again. 

 

PS. Also could you let me know how I can find the REST API manual.  I am searching the documents haven't found it yet. 

 

 

 

 

 

0 Kudos
Revenera Moderator Revenera Moderator
Revenera Moderator

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

Looks very close @ertugrul  and thank you for the detail.

1. Go into the entitled user of the account and enabled the 'Portal Admin User' role.

2. Log into the Customer Portal using the Portal Admin Role above.

3. Navigate and find the CLS Server ID, and click it.

4.  Under the button menu pull-down 'Action', select "Set Password".

5.  Set Password - e.g. MyPassword1!

6. Use Password from step 5 above in your cURL authorization.

 

P.S. And hope your holiday comes soon !

0 Kudos
Occasional contributor

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

And we are really close..  

I am using the password I entered however I get. 

{

  "key" : "glsErr.userAuthFailed",

  "message" : "Authorization attempt at uri=/GlobalLicensingService/api/1.0/instances/[blahblah]/authorize failed for user userx@gmail.com (error BadCredentialsException(Bad credentials))",

  "arguments" : [ "uri=/GlobalLicensingService/api/1.0/instances/[blahblah]/authorize", "userx@gmail.com", "BadCredentialsException", "Bad credentials" ] }

 

so I'm close.. really close 

I just set the password, maybe it takes time? 

 

0 Kudos
Revenera Moderator Revenera Moderator
Revenera Moderator

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

Hello @ertugrul ,

The password you set for the Cloud License Server in the Customer Portal is for the user "admin".  Please use "admin" instead of userx@gmail.com to authorize.

Thanks,

View solution in original post

Revenera Moderator Revenera Moderator
Revenera Moderator

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

Hi @ertugrul ,

Did some more digging into using curl to authorize.  This format worked:

curl -k -X POST -H "Content-type:application/json" -d "{\"user\":\"admin\",\"password\":\"adminpassword\"}" https://yourinstance.compliance.flexnetoperations.com/api/1.0/instances/yourCLSID/authorize

You will get back something similar to:
{
  "expires" : "2019-09-28T12:24:43.258Z",
  "token" : "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImlzcyI6IkNVTDY4TUhaWEFVRCIsImlhdCI6MTU2OTU4NzA4MywiZXhwIjoxNTY5NjczNDgzLCJyb2xlcyI6IlJPTEVfQURNSU4sUk9MRV9EUk9QQ0xJRU5ULFJPTEVfUkVBRCxST0xFX1JFU0VSVkFUSU9OUyIsInhzcmZUb2tlbiI6ImEyNGY3Zjg0LWU3YmEtNDBmZC05ZThiLTQ0YWNlMTY0ZTcxOCJ9.AB1SaFitfnPUwbsKDG8uNXBUGSUtkzcPsyTwNrODDe1BvX3IaKn7gPWIobHCXp_ZBtiqRPek5YuPGA04ERJrNx"
}
 
You will then need to pass in this token for authentication on subsequent calls.  For example if you wish to view the details of the features on the server you would use the following:
 
curl -k -X GET -H "Content-type:application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImlzcyI6IkNVTDY4TUhaWEFVRCIsImlhdCI6MTU2OTU4NzA4MywiZXhwIjoxNTY5NjczNDgzLCJyb2xlcyI6IlJPTEVfQURNSU4sUk9MRV9EUk9QQ0xJRU5ULFJPTEVfUkVBRCxST0xFX1JFU0VSVkFUSU9OUyIsInhzcmZUb2tlbiI6ImEyNGY3Zjg0LWU3YmEtNDBmZC05ZThiLTQ0YWNlMTY0ZTcxOCJ9.AB1SaFitfnPUwbsKDG8uNXBUGSUtkzcPsyTwNrODDe1BvX3IaKn7gPWIobHCXp_ZBtiqRPek5YuPGA04ERJrNx" https://yourinstance.compliance.flexnetoperations.com/api/1.0/instances/yourCLSID/authorize
 
License Server REST API details can be found in the FlexNet Embedded 2019 R1 SP1 License Server Producer Guide which can be downloaded from the FlexNet Embedded Documentation section in the Flexera Product and License Center.
 
Best regards,

View solution in original post

Tags (2)
Occasional contributor

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

Ok that was the trick, you have to use username "admin" no matter what the actually username is. 

so I got the bearer token and used it to get the features

-------<<

curl -k -X GET -H "Content-Type:application/json" -H "Authorization: Bearer BIGBEARGOODBEARVTQTJLRiIsImlhdCI6MTU2OTYwMzUzNSwiZXhwIjoxNTY5Njg5OTM1LCJyb2xlcyI6IlJPTEVfQURNSU4sUk9MRV9EUk9QQ0xJRU5ULFJPTEVfUkVBRCxST0xFX1JFU0VSVkFUSU9OUyIsInhzcmZUb2tlbiI6IjljOGMwNDJjLWNmOWMtNGM1NS1hYTc4LTc5MTIzM2QyNTJmZSJ9.3nmdhS-JXq1OVREcXQuOy-Bg1rF-Ilhcd1ZtjgzVgnwagKrgqMeSCEYl-0bCMnIsDBIGBROWNBEAR" https://flex[blah]-uat.compliance.flexnetoperations.com/api/1.0/instances/[blahblah]/features

[ {

  "id" : 656312,

  "type" : "CONCURRENT",

  "featureName" : "prideauthor",

  "featureVersion" : "7.0",

  "expiry" : "2019-09-30",

  "featureCount" : 2,

  "overdraftCount" : 0,

  "used" : 0,

  "vendorString" : "TRACLabs",

  "issuer" : "TRACLabs",

  "issued" : "2019-09-12",

  "borrowInterval" : 604800,

  "renewInterval" : 20,

  "featureId" : "21rk-b6ze3",

  "starts" : "2019-09-05",

  "featureKind" : "NORMAL_FEATURE",

  "vendor" : "TRACLABS",

  "meteredUndoInterval" : 0,

  "meteredReusable" : false,

  "receivedTime" : "2019-09-13T00:15:11.000Z",

  "concurrent" : true,

  "metered" : false,

  "uncounted" : false,

  "uncappedOverdraft" : false,

  "reserved" : 0

}

---->>>>

How do I get the Devices served by this server,  (like when you go to > Devices > Device > View >ViewServed Devices  )  this will get you all the licenses that are checked out.  

What I am trying to do is, find a list of all licenses checked out. Then find active ones (that is count  > 0 ) and then force that license to release back to pool.

We are aware (Eric stated that this could lead to leak of authorized licenses.) But as long as we somehow find a way to get a notification when this is done. We are ok.

I am still trying to get the REST API documentation located and downloaded.

Thanks again for all the help!  Really appreciate it.

 

0 Kudos
Revenera Moderator Revenera Moderator
Revenera Moderator

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

Hi @ertugrul ,

Glad to hear you were able to successfully view the features.  You definitely need the referenced License Server Producer Guide to get access to the REST API documentation as it has the information you are requesting.

If you look at your response from /features you will see that each licensed feature has an associated id.   You can then use that id to see all devices/clients which currently have a license for that feature.  To do this send the request to /features/{featureid}/clients.  Here's an example request & response for devices which have a license for a feature with id 179837:

curl -k -X GET -H "Content-type:application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImlzcyI6IkNVTDY4TUhaWEFVRCIsImlhdCI6MTU2OTU4NzA4MywiZXhwIjoxNTY5NjczNDgzLCJyb2xlcyI6IlJPTEVfQURNSU4sUk9MRV9EUk9QQ0xJRU5ULFJPTEVfUkVBRCxST0xFX1JFU0VSVkFUSU9OUyIsInhzcmZUb2tlbiI6ImEyNGY3Zjg0LWU3YmEtNDBmZC05ZThiLTQ0YWNlMTY0ZTcxOCJ9.AB1SaFitfnPUwbsKDG8uNXBUGSUtkzcPsyTwNrODDe1BvX3IaKn7gPWIobHCXp_ZBtiqRPek5YuPGA04ERJrNx" https://flexNNNN.compliance.flexnetoperations.com/api/1.0/instances/yourCLSID/features/179837/clients
[ {
"id" : 967863608,
"usageKind" : "CONCURRENT_USAGE",
"client" : {
"id" : 441852507,
"hostid" : {
"hostidValue" : "MyDevice1",
"hostidType" : "STRING"
},
"updateTime" : "2019-09-27T17:31:21.918Z",
"servedStatus" : "NORMAL",
"hostType" : "FLX_CLIENT",
"machineType" : "PHYSICAL",
"trusted" : false,
"correlationId" : "d6e10cea-bacc-4f8d-8ab9-533e6c34d595",
"collectedHostIds" : "STRING MyDevice1",
"requestOperation" : "REQUEST",
"requestHostid" : {
"hostidValue" : "MyDevice1",
"hostidType" : "STRING"
},
"serverHostid" : {
"hostidValue" : "CUL68MHZXAUD",
"hostidType" : "STRING"
},
"expiry" : "2019-10-04T17:31:21.918Z"
},
"useCount" : 1,
"reservedCount" : 0
} ]

The response contains id(s) for all clients with this license feature.  To return a license for a given client, you will want to send a DELETE to the /clients/{deviceid} endpoint.   Here's an example:

curl -k -X DELETE -H "Content-type:application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImlzcyI6IkNVTDY4TUhaWEFVRCIsImlhdCI6MTU2OTU4NzA4MywiZXhwIjoxNTY5NjczNDgzLCJyb2xlcyI6IlJPTEVfQURNSU4sUk9MRV9EUk9QQ0xJRU5ULFJPTEVfUkVBRCxST0xFX1JFU0VSVkFUSU9OUyIsInhzcmZUb2tlbiI6ImEyNGY3Zjg0LWU3YmEtNDBmZC05ZThiLTQ0YWNlMTY0ZTcxOCJ9.AB1SaFitfnPUwbsKDG8uNXBUGSUtkzcPsyTwNrODDe1BvX3IaKn7gPWIobHCXp_ZBtiqRPek5YuPGA04ERJrNx" https://flexNNNN.compliance.flexnetoperations.com/api/1.0/instances/yourCLSID/clients/441852507

The license for this client is now returned to the server license pool.

Note you have the ability to set a policy on the server to determine how frequently devices can be deleted to prevent "dishonest" users from trying to overuse licenses above their entitled quantity.

Best regards,

View solution in original post

0 Kudos
Occasional contributor

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

Robot Happy 

Finally got the REST API documentation! yes!

and I got the list I wanted! 🙂 

.../features   > to get the {featureid} 

.../features/{featureid}/clients    >  active usage  

----<

......features/656312/clients   > gives me my active license used

[ {

  "id" : 465949816,

  "usageKind" : "CONCURRENT_USAGE",

  "client" : {

    "id" : 151451699,

    "hostid" : {

      "hostidValue" : "ertugrul",

      "hostidType" : "USER"

    },

    "updateTime" : "2019-09-27T17:38:29.838Z",

    "servedStatus" : "NORMAL",

    "machineType" : "PHYSICAL",

    "trusted" : false,

    "correlationId" : "b3f6a54b-ccf9-49ed-a327-0181b71d9aab",

    "collectedHostIds" : "USER ertugrul",

    "requestOperation" : "REQUEST",

    "requestHostid" : {

      "hostidValue" : "ertugrul",

      "hostidType" : "USER"

    },

    "serverHostid" : {

      "hostidValue" : "blahblah",

      "hostidType" : "STRING"

    },

    "expiry" : "2019-10-01T06:59:59.999Z"

  },

  "useCount" : 1,

  "reservedCount" : 0

} ]

---- 

...

curl -k DELETE   {blah}   ../[balhblah]/features/656312/clients/465949816     >> gives error 

{

  "key" : "glsErr.restNoSuchApi",

  "message" : "No such REST API and METHOD combination supported: uri=REDACTED with DELETE for user (unknown)",

  "arguments" : [ "uri=REDACTED", "DELETE", "(unknown)" ]

}

 

--

curl -k DELETE  -H { blah} .../features/656312/clients/151451699

{

  "key" : "glsErr.restNoSuchApi",

  "message" : "No such REST API and METHOD combination supported: uri=REDACTED with DELETE for user (unknown)",

  "arguments" : [ "uri=REDACTED", "DELETE", "(unknown)" ]

}

---

So how do I revoke this client license connection? 

and is there a way to setup an automated e-mail when a license revoked this way.

 

 

0 Kudos
Revenera Moderator Revenera Moderator
Revenera Moderator

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

Hi @ertugrul,

Send a DELETE to /clients/{deviceid} to reclaim the license as opposed to /features/{featureid}/clients/{deviceid}. 

There is no mechanism to send an automated email following the DELETE.  As referenced in my previous post you can set a policy to limit the frequency of deletion.

Best regards,

0 Kudos
Occasional contributor

Re: Customer Portal, FNE Cloud license server, process to see available licenses.

Jump to solution

many thanks! 

instead of:

[blah]/features/656312/clients/151451699

it was:

[blah]/clients/151451699

it worked!

I thought I tried that as well but I must have had something incorrect.. So I have done everything I wanted! 

Now I need to set the policy to get a notification when they do this.  If you can point me to the documentation location for this, I would be set 🙂 

(。◕‿◕。) 

(づ。◕‿‿◕。)づ

0 Kudos