aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
235 stars 78 forks source link

EMR DescribeJobFlows API is deprecated - error while running Get-EMRJobFlow #155

Closed ketanbhut closed 2 years ago

ketanbhut commented 4 years ago

Provide a general summary of the issue in the Title above.

Expected Behavior

Get-EMRJobFlow should show a warning and move ahead with the output - given the API is deprecated. However it appears the API is removed, so I should not see that as an available action from PowerShell.

I don't see the command in CLI anymore, even though the CLI documentation is there..

Boto3 still has it, and it does fail just like it fails with PowerShell Get-EMRJobFlow

Current Behavior
Currently, we are presented with a warning, but we hit an error as well:

Get-EMRJobFlow

WARNING: The command 'Get-EMRJobFlow' is obsolete. This API is deprecated and will eventually be removed. We recommend that you use ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions instead. Get-EMRJobFlow: DescribeJobFlows API is deprecated. Please refer to http://docs.aws.amazon.com/ElasticMapReduce/latest/API/API_DescribeJobFlows.html for further information.

Possible Solution

Not sure about the solution, may be this can be raised with the dev team of EMR service - but we can remove the CommandLet/s.

Steps to Reproduce (for bugs)

Just run the Get-EMRJobFlow CommandLet

Context

There are certain other APIs other than DescribeJobFlows which depend on JobFlow ID as a 'Required' request parameter - for example:

API CmdLet
AddInstanceGroups Add-EMRInstanceGroup
AddJobFlowSteps Add-EMRJobFlowStep
SetTerminationProtection Set-EMRTerminationProtection
SetVisibleToAllUsers Set-EMRVisibleToAllUser

Your Environment

Include as many relevant details about the environment where the bug was discovered.

ashishdhingra commented 3 years ago

The Get-EMRJobFlow calls IAmazonElasticMapReduce.DescribeJobFlowsAsync(). Both the CmdLet and the .NET SDK method are marked as Obsolete. The AWS Service API page for DescribeJobFlows also mentions that This API is deprecated and will eventually be removed. We recommend you use ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions instead..

While executing Get-EMRJobFlow, only obsolete warning is displayed:

Get-EMRJobFlow: DescribeJobFlows API is deprecated. Please refer to http://docs.aws.amazon.com/ElasticMapReduce/latest/API/API_DescribeJobFlows.html for further information.

Executing the API call using Postman returns the following error response:

Request Headers

Content-Type: application/x-amz-json-1.1
X-Amz-Target: ElasticMapReduce.DescribeJobFlows
Authorization: AWS4-HMAC-SHA256 Credential=<Access Key>/<YYYYMMDD>/<AWS Region>/elasticmapreduce/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=<signaturevalue>
X-Amz-Content-Sha256: <sha-value>
X-Amz-Security-Token: <Session Token>
X-Amz-Date: <YYYYMMDD>T<HHMMSS>Z

Request Body

{
    "JobFlowIds": ["j-ZKIY4CKQRX72"],
    "DescriptionType": "EXTENDED"
}

Response

{
    "__type": "ValidationException",
    "message": "DescribeJobFlows API is deprecated. Please refer to http://docs.aws.amazon.com/ElasticMapReduce/latest/API/API_DescribeJobFlows.html for further information."
}

Not sure if other obsolete APIs have the same behavior when executed via PostMan.

ashishdhingra commented 2 years ago

Hi @ketanbhut,

Good afternoon.

I was reviewing this issue with the team and currently we do not remove the PowerShell CmdLet when the API is marked as obsolete/deprecated, and allow it to fail. This is the expected behavior for deprecated APIs. Closing this issue.

Thanks, Ashish

github-actions[bot] commented 2 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.