Governance Registry REST API Adding states - wso2-api-manager

How to get the governance registry lifecycles using this api https://localhost:9443//governance/restservices in payload of json.I am getting all the field but i am not getting lifecycle value in that api.Can anyone suggest how to get that.I also see this api to get lifecycle state GET https://localhost:9443/ /governance/restservices/44dadw4/states but I dont want to use this api because I have to call for each time this api to get its lifecycle state.I want to use this api https://localhost:9443//governance/restservices and get the rest service lifecycle value in json payload.
Please help i am searching in web for this approach but not getting enough result.

There is no way getting LC details from https://localhost:9443//governance/restservices using vanilla WSO2 G-Reg. This endpoint is used to retrieve rest service artifact metadata.
I don't understand your point, why you can't use https://localhost:9443/ /governance/restservices/44dadw4/states endpoint for this. Documentation.
However, You can achieve this using a custom deployment. If you want to get LC details from this endpoint you have to update the existing API code. Basically you need to update Asset.java and deploy the new governance.war file.

Related

Azure Api Management append api to existing api with arm

I wonder how you can append a second api to an already registered api in Azure api management via an ARM deploy?
If I use the same value for the name property in my Microsoft.ApiManagement/service/apis resource. It overwrites the whole api instead of appending it. I don't find a property in the arm reference docs to specify I want to append the api instead of overwriting it: https://learn.microsoft.com/en-us/azure/templates/microsoft.apimanagement/2019-01-01/service/apis
I want to accomplish the same result via arm, like I am able todo via the Azure portal import menu
This is also described in the docs: https://learn.microsoft.com/en-us/azure/api-management/add-api-manually#append-other-apis
That is easily not possible at the moment. "Append" logic is implemented in UI, but it does rely only on publicly available ARM calls. You could inspect calls it makes to ARM to append one API to another and try to reproduce it "by hand".

Understanding of OData services

This is a question to improve my understanding about OData and the process of OData services. I'm not sure about the process when an OData request is sent to the server from my Fiori app. The app is added to our Fiori Launchpad. When the user wants to create a new target group in the UI, a create request is sent. What happens then in detail? What I thought so far:
OData service checks the data
If the data is valid, a new entry in the database is created (HTTP POST)
If the data is not valid, the OData service sends an error
I'm not sure about what information is delivered by the OData service and what information is delivered directly from the database? Does the OData service work like a adjustor which transfers the messages sent from the database to the application?
I hope you can understand what I'm trying to figure out. Thank you for your time.
it depends how your backend-methods are implemented. Every Entityset usually has one of these Methods:
Get Entity
Get EntitySet
Create
Update
Delete
There are some more I guess, but these are mostly used by developers. You can redefine every single method and implement your own Business Logic in there.
So, let's assume you want to send data from the Frontend to your service and insert the data into a table inside your database. You have to redefine the create method of your entity and implement own logic. This could contain an insert into a database-table. You have to consider, that your oData Service will throw an Error if the types which are sent from the frontend do not match the Entity-Types (i.e. a String into an edm.Time type).
Here you can find all EDM.Types oData could consume and the correct mapping of the types:
https://help.sap.com/saphelp_gateway20sp12/helpdata/en/76/4a837928fa4751ab6e0a50a2a4a56b/frameset.htm
Hope this helps :)

Tracing Telemetry in Application Insights across different layers

I'm currently using App insights for logging exceptions and tracing.
My project is Asp.net MVC based and I've 3 different layers. One is front end (MVC with angular) and rest two are Web API service layers.
I've default telemetry logging enabled for all the 3 layers and it is logging all the operations.My problem is that I'm not able to correlate the operation on all the 3 layers. How can I achieve this. I've read that one option is to set the custom property (userID in session) on Telemetry Initializer , but I don't have that information on my Web API layers as they are stateless.
One solution I can think about:
You can generate an internal identifier (e.g. a GUID) for each operation in your MVC layer, add it as a custom parameter (using the Telemetry Initializer) and pass that same ID to the Web API layers for each API call you make. For every telemetry event these Web API layers send, add the identifier as a custom parameter in the same fashion as above.
This way you will be able to correlate the events based on your internal ID.
Besides the already mentioned alternatives, there's already partial support for this built into AI through the ParentOperationId and OperationId context fields. However, there's nothing in place right now that can propagate the fields through Http calls automatically.
It should be possible to have your code add the necessary headers when making outgoing HTTP calls and if you use the right ones, and the other side has the necessary telemetry initializers, it should be better.

Adding correlation id to automatically generated telemetry with App Insights

I'm very new to Application Insights, and I'm thinking of using it for a set of services I plan on implementing with asp.net webapi. I was able to get the basic telemetry up and running very easily (right-clicking on a project on VS, Add Application Insights), but then I hit a block. I plan to have a correlation id set in the request headers for calls to downstream services, and I would like to tag all the telemetry related to one outside call with the same correlation id.
So far I've found that there is a way to configure a TelemetryInitializer, but if I understood correctly, this is run before I get to access the request, meaning I can't check if there is a correlation id that I should attach.
So I guess there might be 2 ways to solve this: 1) if I can somehow actually get access to the request headers before the initializer, that would obviously solver the problem, or 2) somehow get a hold of the TelemetryClient instance that is used to report the automatically generated telemetry.
Perhaps the last resort would be to turn off all of the automatic stuff and do all of it manually, when I could of course control what properties are set on the TelemetryClient. But this would be quite a lot more work, so I'd prefer to find some other solution.
You were rights saying that you should use TelemetryInitializer. All TelemetryInitializers are called when Track method is called on any telemetry item. Autogenerated request telemetry is "tracked" on request OnEnd, you should have all your custom headers available for you at that time.
Please also have a look at OperationId - this is part of the standard context managed by App Inisghts and is used exactly for the purpose of correlating requests with downstream execution. This is created and passed automatically, including traces (if you use trackTrace).
Moreover, we have built-in support in our UX for easily seeing all telemetry for a particular operation - it can be found in "Search->Details-->Related Items-->All telemetry for this operation"

CDA Broker API : Get ComponentPresentations by list of component IDs

I am trying to see if there is a way to get the ComponentPresentations by passing the list of ComponentIDs in one single API instead of passing each one in a loop. In my case all the DCPs are using the same template as well.
When I checked the API I could not find any method which could accept the list of tcmids or something in those lines. The use case I am trying to solve is getting all the DCPs in one single API call vs. looping through 10-15 (in my case) and get each DCP independently which is not effective when the first time we hit the broker db.
I was able to get the same using OData web service, but we not yet ready to use the Odata. Not sure if Odata and broker API are slightly different, but could not find any documentation that explain API vs Odata difference in capabilities from query point.
Any help will be appreciated.
ENV: Tridion 2011 SP1, Java API.
OData and Broker API are very different. If you want information on OData I'd recommend checking here and here.
No, you can't do that operation through the Content Delivery API. With a properly configured cache you will be hitting the database only once per component presentation, so the impact is minimized...

Resources