Size of module and models using APIs

Hi All,

I need a way to automate capturing the cell size of the modules and overall size of my models. 

Right now, for modules, I have to capture it one by one in the model itself, but that is not feasible as an administrator considering we have several models and thousands of modules. 

Is there a way, using APIs or otherwise, to get 
i. Size/Cell size of each module in a model

ii. Size of all the models that are present in my tenant

 

Thanks

Answers

  • @kauldheeraj Anaplan provides access to a Model if you have license for HyperCare. This model is based on the tenant of the organization and provides all the required info which you are looking for in a form of a Model wherein you can review Model size. This model is maintain by Anaplan platform team if you buy HyperCare license.

     

    However I am not sure whether Anaplan has exposed APIs to access all the information you are currently looking at. 

     

    You can refer Audit APIs which could help you track the changes in the model : https://auditservice.docs.apiary.io/#reference/audit-events

     

    AB

  • Thanks @ashish.banka I don't seem to be able to use Audit APIs, but none the less, this was something that I wasn't aware of. 

    Reading through the documentation, it doesn't look like something that will solve my problem/question. Thanks again for responding to my posts. 

  • @kauldheeraj 

     

    Out of curiosity, why is this information needed and what are you hoping to accomplish with it?

     

    Rob 

  • Good question @rob_marshall 

    We have a very complex and a large number of workspaces and models. In order to manage and automate day-to-day housekeeping activities, we are trying to tap into the metadata of our workspaces, models, modules, lists and their sizes and building analytics around this data to give us quick insights into what and where to clean-up things. e.g. after spending several hours of analysis across a workspace, we can figure out what module is taking up a bulk of the space. We can get this insight constantly if we have the information available through an automated program, which at this time is mostly available through APIs, so that we can refresh this data at regular intervals and analyze the data through a pre-defined model or report. 

    Right now, we are having to go through each and every model and analyze the modules by looking at the module list, which is very cumbersome and can change with one set of data integration runs to the models.

    Hope that makes it clear !

  • Hi @kauldheeraj 

    You can get the size of the models through the API but not sure about the size of modules. However you need to write the scripts to scrap the data looping through the each workspace and Models.

    1. Write the function to get the all the Workspace details (will be in JSON format) 

    2. Another function to get the Model details. - Will be in JSON format

    For above two functions you need to use the request library to hit the get request which would require basic authentication.

    3. Create a function to scrap the data which would take the workspace ID and model ID as input. In this function you need the selenium library to initiative the login to the Anaplan using the webdriver.Firefox() function and then hit a get request to the Anaplan end points.

    4. Loop through the each workspace and model and locate the size of the model using the selenium functions and then convert the size into the required format(GB,MB etc) and save all the details to an excel file.

    Regards,

    Riyaz Pasha

  • it seems it is not available via API however you can export the list of line items and calculate the size from that with a script. many models & some external apps do that.
  • How is that one data integration can make a big module small and the other way around? Sounds like you're clearing out lists and rebuilding them from scratch which doesn't sound like a particularly efficient modelling technique.

    And if that is true then what will be gained from constantly looking at the module metadata if the following data load it's all going to change anyway.

    The APIs will be able to give you model/workspace size which at least is a start point and from there it's the actual investigation as pointed out previously...

     

  • Thanks @riyazpasha 

    The workspace detail API provides enough information in JSON, which I have incorporated. 

    The Model API (https://anaplanbulkapi20.docs.apiary.io/#reference/models) does not provide this level of detail

     

     

  • @andrewtye The idea here is to assess the size of your models on an ongoing basis as you assess your models. Hypercare is a good solution for now but it does not provide all the information that we need, which is the size in terms of a module and list. Yes, we are clearing out a lot of lists and modules in our Data Hub layer, which requires this processing because of changing nature of our upstream data needs. 

  • Thanks @nathan_rudman . That is how I am doing it right now. Appreciate your response. 

  • Hi @kauldheeraj 

    Try this end point which will list all the models in that particular workspace.

    https://api.anaplan.com/2/0/workspaces/workspaceID/models

    1. You would require workspace ID, Model ID and Model name from the models end points.

    2. To scrap the data first you have to identify the Class name for the workspace by going to the any of the model and click on your account and then click manage models. The window listing all the models in that workspace will appear, then you can see at the top left "workspace size". Then try to find out the class name or class ID(right click and click on inspect) which is listing all the models.

    3. Then use the selenium library to find the ID by element and pass the class ID which you found for the models and get the text which will give the model size.

    4. Now you need a function to convert the size in one standard format. The model size can be in KB, MB or GB so you need to convert the size in to one format and write all the data to an excel file

     

    Note : You need to loop through each workspace first to get the models.

    Regards,

    Riyaz Pasha

  • Thanks @riyazpasha , I have the required data for models and workspaces, looping through each workspace. What I was expecting is to have the size information available in any of the API response. The information is available through the user interface as well as hypercare model at this time. I was trying to see if we could do it through APIs so that we don't need to go to different solutions for the data. Thanks for the detailed response. 

  • Hi @kauldheeraj ,

     

    You can achieve this by using transactional APIs.

     

    See the post from Jess Wilson.

     

    https://community.anaplan.com/t5/Anaplan-Platform/Transactional-API-Library/m-p/90521#M20235

     

    In one of the examples he shows how to get the total size ,available size of the models.

     

    Let me know in case of any further clarifications.

     

    Cheers,

    Yash

  • Thanks @Yash1 the total size and available size in the example is for workspace, which I am already capturing. The transactional APIs do not provide that info for models or modules (cell size in case of modules)

  • Hi @kauldheeraj 

     

    Yep, you are right.

    One more suggestion - if you export all the lineitems , use that file and then based on the cell count and type try to calculate the size.

     

    It sounds complicated but you may give it a try.

     

    Thanks,

    Yash