Skip to main content
Solved

How can I read ArcGIS credits in FME desktop?


joy
Enthusiast
Forum|alt.badge.img+14
  • Enthusiast

Instead of logging in and looking at the credits usage on ArcGIS.com daily/weekly, I would like to have a script running finally in the FME server that runs daily or weekly and informs me via a mail that the credits has reached a certain amount. This informs me that additional credits need to be bought.

 

Does anyone know what would be achievable in FME desktop? How can I retrieve credits information within FME deskstop?

Best answer by nielsgerrits

nielsgerrits wrote:

You can get this data using an HTTPCaller using subscriptionInfo.

https://<companyname>.maps.arcgis.com/sharing/rest/portals/self/subscriptionInfo?f=json&token=<token>

 

Attached a sample workspace demonstrating this.

View original
Did this help you find an answer to your question?

19 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

You can get this data using an HTTPCaller using subscriptionInfo.

https://<companyname>.maps.arcgis.com/sharing/rest/portals/self/subscriptionInfo?f=json&token=<token>

 


nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • June 27, 2022
nielsgerrits wrote:

You can get this data using an HTTPCaller using subscriptionInfo.

https://<companyname>.maps.arcgis.com/sharing/rest/portals/self/subscriptionInfo?f=json&token=<token>

 

Attached a sample workspace demonstrating this.


joy
Enthusiast
Forum|alt.badge.img+14
  • Author
  • Enthusiast
  • June 27, 2022
nielsgerrits wrote:

You can get this data using an HTTPCaller using subscriptionInfo.

https://<companyname>.maps.arcgis.com/sharing/rest/portals/self/subscriptionInfo?f=json&token=<token>

 

hi Niels, thank you for mentioning the httpcaller. Besides filling the company name, do I need some kind of token to fill in the above URL?


nielsgerrits
VIP
Forum|alt.badge.img+54
joy wrote:

hi Niels, thank you for mentioning the httpcaller. Besides filling the company name, do I need some kind of token to fill in the above URL?

Yes you need a token to do these kind of requests. To get a token you need to enter your credentials using https://www.arcgis.com/sharing/generateToken. See the documentation. You also can use my sample workspace and enter your companyname and credentials in the parameters.


joy
Enthusiast
Forum|alt.badge.img+14
  • Author
  • Enthusiast
  • June 27, 2022
joy wrote:

hi Niels, thank you for mentioning the httpcaller. Besides filling the company name, do I need some kind of token to fill in the above URL?

Thank you very much for providing the workspace. I am now stuck on the 2nd HTTPcaller with the following error: Couldn't resolve host name. I am quite sure that the user name and password are correct, so I think I am making a mistake with the company name. Do I need to consider spaces or something like that?

 


nielsgerrits
VIP
Forum|alt.badge.img+54
joy wrote:

hi Niels, thank you for mentioning the httpcaller. Besides filling the company name, do I need some kind of token to fill in the above URL?

The beginning of the url should be the same as when you log on to check the credits.


nielsgerrits
VIP
Forum|alt.badge.img+54
nielsgerrits wrote:

Attached a sample workspace demonstrating this.

Oops, the source of the JSONExtractor_2 should be JSON Document _response_body.


joy
Enthusiast
Forum|alt.badge.img+14
  • Author
  • Enthusiast
  • June 27, 2022
nielsgerrits wrote:

Attached a sample workspace demonstrating this.

Oh no problem, I figured using the response body, but my value is empty. So I am wondering where I went wrong. afbeelding" data-fileid="0694Q00000IrdDfQAJ


nielsgerrits
VIP
Forum|alt.badge.img+54
joy wrote:

hi Niels, thank you for mentioning the httpcaller. Besides filling the company name, do I need some kind of token to fill in the above URL?

Do you get a valid result from the httpcaller_2? Turning off featurecaching might help, as tokens do expire.


joy
Enthusiast
Forum|alt.badge.img+14
  • Author
  • Enthusiast
  • June 27, 2022
joy wrote:

hi Niels, thank you for mentioning the httpcaller. Besides filling the company name, do I need some kind of token to fill in the above URL?

huh, I get the following output of the response body which I think is weird {"error":{"code":403,"messageCode":"DS_0003","message":"User not allowed for this account","details":[]}}   This is weird, since the user name and user password are valid. afbeelding


joy
Enthusiast
Forum|alt.badge.img+14
  • Author
  • Enthusiast
  • June 28, 2022
joy wrote:

hi Niels, thank you for mentioning the httpcaller. Besides filling the company name, do I need some kind of token to fill in the above URL?

@nielsgerrits​ I didn't use the right company name, I have changed it and now it did the trick. It should be the same name when you log in and see the name before maps.arcgis. I now have information about the available credits. Thank you very much for helping and guiding me through each step.


nielsgerrits
VIP
Forum|alt.badge.img+54
joy wrote:

hi Niels, thank you for mentioning the httpcaller. Besides filling the company name, do I need some kind of token to fill in the above URL?

Cheers, thanks for the feedback :)


todd_davis
Supporter
Forum|alt.badge.img+22
  • Supporter
  • June 28, 2022

FYI...as this is the 'Portal' side of arcgis online you can use an existing FME webconnection as authorization in your httpcaller as that already generates a token. No need to make a seperate generatetoken call!

 

Also while you are looking at the total credits available, we have found it more useful to calculate the amount of credits each item is using across a month, so that we pinpoint what things are using the credits. Its alot more than a single call though.


nielsgerrits
VIP
Forum|alt.badge.img+54
todd_davis wrote:

FYI...as this is the 'Portal' side of arcgis online you can use an existing FME webconnection as authorization in your httpcaller as that already generates a token. No need to make a seperate generatetoken call!

 

Also while you are looking at the total credits available, we have found it more useful to calculate the amount of credits each item is using across a month, so that we pinpoint what things are using the credits. Its alot more than a single call though.

Good points @Todd Davis​ 

I would like to know more about the credits per item part. I assume you can't share a workspace because of the amount of work in it. How do you do this. Do you extract the cost per item from the dashboard? Or do you calculate it based on the size?


todd_davis
Supporter
Forum|alt.badge.img+22
  • Supporter
  • June 28, 2022
nielsgerrits wrote:

Good points @Todd Davis​ 

I would like to know more about the credits per item part. I assume you can't share a workspace because of the amount of work in it. How do you do this. Do you extract the cost per item from the dashboard? Or do you calculate it based on the size?

Yeah...I kind of wish I could share but as a company we are still figuring out what we are going to do with the 30+ custom transformers we have built to manage all sorts of aspects of the Esri environment (e.g. provide a service, provide audits, license transformers or put all the transformers up for free). We have put a few basic ones on the hub, but they aren't even scratching the surface

 

But the detail of it is:

  • Esri only reports storage credit use at a organisation level, rather than at item level
  • Credits use are calculated monthly e.g in Feb your use of credits goes up per day, because they are spread over only 28 days
  • Esri publish there credit calculation, so you need to break that down and implement it in FME
  • We need to get each item which holds a size of the file and a seperate size of any attachments (both will be used to calculate total credits)

 

It is very useful when your the admin and wondering why you credit balance is disappearing quicker than you every expected.

 

image


joy
Enthusiast
Forum|alt.badge.img+14
  • Author
  • Enthusiast
  • June 28, 2022
todd_davis wrote:

FYI...as this is the 'Portal' side of arcgis online you can use an existing FME webconnection as authorization in your httpcaller as that already generates a token. No need to make a seperate generatetoken call!

 

Also while you are looking at the total credits available, we have found it more useful to calculate the amount of credits each item is using across a month, so that we pinpoint what things are using the credits. Its alot more than a single call though.

I would be interested as well to have the credits per item part. Would it be possible for you to give a rough idea of how I might be able to tackle that in FME?


todd_davis
Supporter
Forum|alt.badge.img+22
  • Supporter
  • June 29, 2022

@joy​ @nielsgerrits​ I have my own thoughts on this, but would just like to confirm what you think. If you had a bunch of transformers that dealt with ArcGIS Online and Esri Enterprise and help you manage those things, would you be willing to pay for them or would you always build them yourself?

 

Seperately, I had a talk with our Innovation Manager this morning and they agreed that we should release the transformer that does this (and more), but we will utilise a code and a call home to verify that code before they run. I am building the processes around that right now, so might have the transformer released to the hub by next week. That way our company doesn't loss the hundreds of hours we have used to build these transformers by releasing them completely, but does enable users to freely make the most of them.


joy
Enthusiast
Forum|alt.badge.img+14
  • Author
  • Enthusiast
  • June 29, 2022
todd_davis wrote:

@joy​ @nielsgerrits​ I have my own thoughts on this, but would just like to confirm what you think. If you had a bunch of transformers that dealt with ArcGIS Online and Esri Enterprise and help you manage those things, would you be willing to pay for them or would you always build them yourself?

 

Seperately, I had a talk with our Innovation Manager this morning and they agreed that we should release the transformer that does this (and more), but we will utilise a code and a call home to verify that code before they run. I am building the processes around that right now, so might have the transformer released to the hub by next week. That way our company doesn't loss the hundreds of hours we have used to build these transformers by releasing them completely, but does enable users to freely make the most of them.

I think it depends on whether I would really need it and the price of the transformer. For now it's not really a must for me, but it's a nice thing to have. However, in case I would really need it and the price of the transformer is reasonable, then it's probably more practical/wise to buy the plugin than to spend a lot of time making on it.

 

At the moment, I would not buy the transformer. But nice to hear that you are making the transformer available in the hub. So in case, I would really need it, then I might be able to buy the transformer.


nielsgerrits
VIP
Forum|alt.badge.img+54
todd_davis wrote:

@joy​ @nielsgerrits​ I have my own thoughts on this, but would just like to confirm what you think. If you had a bunch of transformers that dealt with ArcGIS Online and Esri Enterprise and help you manage those things, would you be willing to pay for them or would you always build them yourself?

 

Seperately, I had a talk with our Innovation Manager this morning and they agreed that we should release the transformer that does this (and more), but we will utilise a code and a call home to verify that code before they run. I am building the processes around that right now, so might have the transformer released to the hub by next week. That way our company doesn't loss the hundreds of hours we have used to build these transformers by releasing them completely, but does enable users to freely make the most of them.

Hej @Todd Davis​ , thanks for your reply. There are probably orgs that are willing to pay for this kind of service, but we prefer to build stuff ourselves.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings