Does Python Pulsar-Client SDK supports pulsar admin based classes? - python-3.x

Hi I was looking to fetch metadata of pulsar topics using python-client sdk provided by pulsar.
But i got stuck as , i was not able to find any classes regarding pulsar-admin actions like getting topics , there schema , stats etc.
Though the same things are available in java admin sdk.
example
In java :-
String namespace = "my-tenant/my-namespace";
admin.topics().getList(namespace);
link to doc :- https://pulsar.apache.org/docs/next/admin-api-topics
i need to get same set of functionally but in python sdk.
is there any way to do this or yet not supported.
Solutions Tried :-
i have tried the pulsar admin rest api's and they work.. but i prefer to go via sdk path.

The Python SDK does not have that yet.
You potentially could build a Python SDK using OpenAPI/Swagger which is available here https://pulsar.apache.org/admin-rest-api/
You could also make REST calls from Python.
You can make a request for this functionality: https://github.com/apache/pulsar/issues/new/choose
The full current documentation is here: https://pulsar.apache.org/api/python/

Related

Is there a way to delete Billing plans in paypal sdk?

SDK/Library version: 1.13.1
Environment: Sandbox and Live
PayPal-Debug-ID values: None
Language, the language version, and OS: Python, Ubuntu
Issue description:
So I was wondering if there is a way to delete billing plans? I searched but I can only find for PHP and not for python.
I tried:
billing_plan.delete()
billing_plan.remove()
but none of them work
I used BillingPlan.find() to get the information about the plan so I could remove but I can't find a way to perform this action.
BTW if there isn't a way via the API let me know if I can do it via PayPal website.
GitHub issue: https://github.com/paypal/PayPal-Python-SDK/issues/295
Assuming the Python SDK doesn't offer a method for this, you could read the PHP SDK's source code to find out how it's doing it, and then implement those methods, or call the Billing Plans API's HTTP methods directly: https://developer.paypal.com/docs/api/payments.billing-plans/v1/

Available Node Package Module that supports amazon product api version 5.0

Amazon recently published its Amazon Product Advertising API v5.0 for Amazon Affiliate Program. From 31st October 2019, previous version 4.0 of API will be taken down and only v5.0 will be supported to access Amazon products programmatically.
With these changes, most available node modules and applications will no longer work with V5.0. For this Amazon PA-API 5.0, Amazon has released an SDK for PHP, NodeJs, Python and, Java. However, using the SDK for NodeJs may require time to configure.
That being said, is there an available Node Package module that we can use to easily start integrating our application?
There are a few NPM wrappers that are available today that help you use Paapi 5.0 for NodeJS. All of this module uses the amazon SDK for their code.
amazon-paapi - By far my favorite as it uses simple to understand node syntax. Adding parameters is much like how you do it using amazon scratchpad. It also support custom parameter options.
amazon-pa-api50 - Another great module. However, as of this writing, I found some limitations on optional parameters you can add to some operations.
apaw - alternative option.

Post Service call with Multiple records

I would like to know how to post multiple records to SAP using "BatchRequestBuilder" along with ChangeSet .I am using a custom odata service call(ODataCreateRequestBuilder),not using the VDM model. I did'nt get any blog or documentation to start with.
Can you please help me in this regard.
Updated:
Below is what I am trying to post to SAP
[{"purchaseSchAgrmntNo":"","customerMaterialNumber":"","plant":"","vendorNo":""},{"purchaseSchAgrmntNo":"","customerMaterialNumber":"","plant":"","vendorNo":""}]
SAP SDK version : 3.9.0
I have added below code with only one CreateRequest.
ChangeSet changeSet = new ChangeSetBuilder().addCreateRequest( ODataCreateRequestBuilder.withEntity(sapConfig.getServiceUrlRepriceList(),
sapConfig.getEntityRepriceList())
.withBodyAsMap(responseBody)
.build()).build();
BatchResult batchResult = BatchRequestBuilder.withService("URL?").addChangeSet(changeSet).build().execute(httpClient);
Can you let me know if this is correct.Also let me know what I have to pass in the service.Is it service URL?
Thanks,
Arun Pai
The BatchRequestBuilder is actually not directly part of the SAP Cloud SDK but a dependency that the SDK internally uses to execute batch requests. That is why on the SDK level there is no documentation on how to use it.
Roughly, a batch request comprises of multiple change sets which in turn group together multiple operations. The ChangeSetBuilder allows you to build up change sets which you can then pass to a BatchRequestBuilder.
So if you want to run create requests in batch mode you would want to leverage public ChangeSetBuilder addCreateRequest(ODataCreateRequest oDataCreateRequest).
You can take a look at how the SAP Cloud SDK uses these classes to build up batch requests to get an idea how it works in detail. As a starting point look towards BatchFluentHelperBasic. However, unless you don't know the service you want to query at compile time, I recommend that you leverage the generator to generate this code so that you can use the VDM instead which simplifies this.
If you extend your question to hold more specific information on what you actually want to achieve I can expand my answer to give a more concrete example. Also please include the SDK version you are using.

IBM Natural Language Processing Projects (Beginner getting started question)

I've been digging into the IBM Cloud Services, Watson and NLP. Just installed the CLI and tried with Node SDKs, and a starterkit, unfortunately I did not succeed by trying to get a sample code by default to understand how it works.
After that, I did some research get a better open minded approach to how actually I could use some of their free services to get started, but there's actually to vague information, even though the IBM Docs are pretty extensive and well written, it can get very confusing.
I would appreciate any open source repo, or working/live project that you are willing to share to make a better image in my mind about it IBM cloud services.
A few days ago I wrote a sample application using the Natural Language Understanding service. Check the source code here: https://github.com/watson-developer-cloud/natural-language-understanding-code-pattern
The README has instructions on how to get the apikey which is the way you will use to authenticate your API calls.
Since you are using Node.js you can start with the sample above and also look at this page: https://cloud.ibm.com/apidocs/natural-language-understanding/natural-language-understanding?code=node which includes examples for all the features in Node.js using the node-sdk: https://github.com/watson-developer-cloud/node-sdk/

Which aws sdk to use?

I want to use dynamodb SDK for nodejs. Which SDK is it, may someone please send a link to the current api? I thought this link showed the most current:
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html
But according to
https://github.com/aws/aws-sdk-js/blob/master/UPGRADING.md
Anything using the .Client attributes are old. I am confused which is the most current. For example should I use dynamodb.get or dynamodb.getItem to get items?
As per the github, you should be using below link for DynamoDB -
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html
There is a tutorial as well to get started with the new dynamoDB SDK -
http://blogs.aws.amazon.com/javascript/post/Tx1OVH5LUZAFC6T/Announcing-the-Amazon-DynamoDB-Document-Client-in-the-AWS-SDK-for-JavaScript

Resources