# HttpMethods

Method type of a EKS call.

- Source: [`aws-stepfunctions-tasks/lib/eks/call.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/eks/call.ts#L139)

## Example

TypeScript:

```ts
import * as eks from 'aws-cdk-lib/aws-eks';
import { KubectlV37Layer } from '@aws-cdk/lambda-layer-kubectl-v37';

const myEksCluster = new eks.Cluster(this, 'my sample cluster', {
  version: eks.KubernetesVersion.V1_37,
  clusterName: 'myEksCluster',
  kubectlLayer: new KubectlV37Layer(this, 'kubectl'),
});

new tasks.EksCall(this, 'Call a EKS Endpoint', {
  cluster: myEksCluster,
  httpMethod: tasks.HttpMethods.GET,
  httpPath: '/api/v1/namespaces/default/pods',
});
```

Python:

```python
import aws_cdk.aws_eks as eks
from aws_cdk.lambda_layer_kubectl_v37 import KubectlV37Layer

my_eks_cluster = eks.Cluster(self, "my sample cluster",
    version=eks.KubernetesVersion.V1_37,
    cluster_name="myEksCluster",
    kubectl_layer=KubectlV37Layer(self, "kubectl")
)

tasks.EksCall(self, "Call a EKS Endpoint",
    cluster=my_eks_cluster,
    http_method=tasks.HttpMethods.GET,
    http_path="/api/v1/namespaces/default/pods"
)
```

Java:

```java
import software.amazon.awscdk.services.eks.*;
import software.amazon.awscdk.cdk.lambdalayer.kubectl.v37.KubectlV37Layer;

Cluster myEksCluster = Cluster.Builder.create(this, "my sample cluster")
        .version(KubernetesVersion.V1_37)
        .clusterName("myEksCluster")
        .kubectlLayer(new KubectlV37Layer(this, "kubectl"))
        .build();

EksCall.Builder.create(this, "Call a EKS Endpoint")
        .cluster(myEksCluster)
        .httpMethod(HttpMethods.GET)
        .httpPath("/api/v1/namespaces/default/pods")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.EKS;
using Amazon.CDK.LambdaLayer.KubectlV37;

var myEksCluster = new Cluster(this, "my sample cluster", new ClusterProps {
    Version = KubernetesVersion.V1_37,
    ClusterName = "myEksCluster",
    KubectlLayer = new KubectlV37Layer(this, "kubectl")
});

new EksCall(this, "Call a EKS Endpoint", new EksCallProps {
    Cluster = myEksCluster,
    HttpMethod = HttpMethods.GET,
    HttpPath = "/api/v1/namespaces/default/pods"
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/cdklabs/awscdk-kubectl-go/kubectlv37"

myEksCluster := eks.NewCluster(this, jsii.String("my sample cluster"), &ClusterProps{
	Version: eks.KubernetesVersion_V1_37(),
	ClusterName: jsii.String("myEksCluster"),
	KubectlLayer: kubectlv37.NewKubectlV37Layer(this, jsii.String("kubectl")),
})

tasks.NewEksCall(this, jsii.String("Call a EKS Endpoint"), &EksCallProps{
	Cluster: myEksCluster,
	HttpMethod: tasks.HttpMethods_GET,
	HttpPath: jsii.String("/api/v1/namespaces/default/pods"),
})
```

## Members

| Member | Description |
| --- | --- |
| `GET` | Retrieve data from a server at the specified resource. |
| `POST` | Send data to the API endpoint to create or update a resource. |
| `PUT` | Send data to the API endpoint to update or create a resource. |
| `DELETE` | Delete the resource at the specified endpoint. |
| `PATCH` | Apply partial modifications to the resource. |
| `HEAD` | Retrieve data from a server at the specified resource without the response body. |

## Referenced by

- [`EksCallJsonataProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.EksCallJsonataProps.html).httpMethod
- [`EksCallJsonPathProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.EksCallJsonPathProps.html).httpMethod
- [`EksCallProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.EksCallProps.html).httpMethod
