Equivalent service for AWS Lambda in Azure - amazon-web-services

To get detailed info of ec2 instance via python in AWS, we can create a lambda function and use describe-instances boto3 api to fetch the results.
I'm looking for similar solution in Azure.
To get VM information via python in azure. Kindly share the APIs like boto3 and services to accomplish this.
Thanks in advance.

Boto3 (AWS SDK for Python) -> Azure SDK for Python
AWS Lambda (serverless functions) -> Azure Functions
I also suggest reviewing the Azure for AWS professionals documentation.

Equivalent describe instances on AWS boto SDK in Azure is
list_all()/list() at ComputeManagementClient.virtual_machines
https://learn.microsoft.com/en-us/python/api/azure-mgmt-compute/azure.mgmt.compute.v2019_07_01.operations.virtualmachinesoperations?view=azure-python#azure-mgmt-compute-v2019-07-01-operations-virtualmachinesoperations-list-all
Check this example.

Related

Is there a REST API available for SageMaker, or is it possible to interact with SageMaker over the Amazon API Gateway?

SageMaker provides a full machine learning development environment on AWS. It works with the Amazon SageMaker Python SDK, which allows Jupyter Notebooks to interact with the functionality. This also provides the path to using the Amazon SageMaker Feature Store.
Is there any REST API available for SageMaker? Say one wanted to create their own custom UI, but still use SageMaker features, is this possible?
Can it be done using the Amazon API Gateway?
Amazon API Gateway currently does not provide first-class integration for SageMaker. But you can use these services via AWS SDK. If you wish, you can embed the AWS SDK calls into a service, host on AWS (e.g. running on EC2 or as lambda functions) and use API gateway to expose your REST API.
Actually, SageMaker is not fundamentally different from any other AWS service from this aspect.
I think you're better off wrapping the functionalities you need as an API you own to avoid the timeouts associated with REST. Did you check out https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html as well?

How to connect Amazon S3 to IBM datastage server which is hosted on premise

I have IBM Datastage server installed on premises.
I want to connect to an Amazon S3 bucket from datastage to load data.
How can i establish a connection to Amazon S3 from datastage server.
From doing some online reading, the IBM product seems to work with a Java API.
https://www.ibm.com/docs/en/iis/11.5?topic=connections-java-code
Therefore, you can use the AWS SDK for Java to invoke Amazon S3 operations. If you are not familiar with how to use the AWS SDK for Java (V2), see this doc topic:
Get started with the AWS SDK for Java 2.x
Depending on your version, you may even have an S3 Connector stage available in your Palette.

Is there a way to programmatically list deployed API's on AWS API Gateway?

I have several API's hosted on AWS that sit behind API Gateway. They are deployed with the serverless framework.
Is there away for me to programmatically query for and retrieve a list of all the API's that are deployed?
if your APIs are deployed as different stacks, you cannot use the serverless CLI command to list them.
but instead, You can use the AWS CLI command to list all the APIs powered by API gateway using the command below.
aws apigateway get-rest-apis
hope this helps
You may use AWS SDK getRestApis service (I linked Java SDK, but you may use any language of your choice)

NiFi: Is there a way to call AWS Comprehend and connect to NiFi?

Just wondering if this is possible. In NiFi, it is possible to connect to S3 buckets.
Can you call Comprehend? Or is that capability totally beyond the pale? Thanks
There are no out-of-the-box Apache NiFi processors to communicate with AWS Comprehend at the moment, but there are multiple ways you can achieve this.
ExecuteStreamCommand using the AWS CLI -- execute shell commands that use the CLI tool to communicate with AWS
ExecuteScript with the AWS SDK -- execute custom code in Groovy/Python/Ruby using the relevant AWS SDK
InvokeHTTP with the Comprehend API -- execute HTTP requests sending and receiving JSON content
CustomProcessor with the AWS SDK -- write a custom processor using the AWS Java SDK
You can also open a feature request on the NiFi Jira for this capability.

How to use AWS(Amazon Web Services) EC2 DescribeInstanceStatus API Request in RestClient (Chrome Extention)

I am new to AWS and working on an application in which I have to display different Metrics about my AWS EC2 instance Health Like CPU usage and Memory and Running Processes info. I am trying to perform the Get Request from a REST client (Chrome Extention) for clarity of the function of this API exposed by AWS.
https://dns.regionxx.ec2.amazonaws.com/?
Action=DescribeInstanceStatus
&AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE
&Timestamp=1397109362
&Signature=lBP67vCvGlDMBQ1dofZxg8E8SUEXAMPLE
&SignatureVersion=2
&SignatureMethod=HMAC-SHA1
REST Client Support OAuth 1.0 is this an issue because AWS is supporting Signature Version 2 and 4.
Any Help?
You can do it the straight way with Signatures but why not use one of the existing SDKs like boto (Python), Ruby AWS SDK or the Java AWS SDK. These SDKs take care all of the authentication/authorization mechanism and you just need provide your aws_access_key_id and your aws_secret_access_key
For example with boto you can do something like this:
import boto.ec2
conn = boto.ec2.connect_to_region("us-east-1",
aws_access_key_id='<key>',
aws_secret_access_key='<secret>')
reservations = conn.get_all_instances
for reservation in reservations:
for instance in reservation:
print instance.status
Or you can use the EC2 command line API http://aws.amazon.com/developertools/351 :
ec2-describe-instance-status <instances->
Or you can use the AWS CLI:
aws ec2 describe-instance-status <instance id>