Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for more granular configuration in asynchronous operations #51

Open
2 tasks done
dikhan opened this issue Sep 6, 2018 · 0 comments
Open
2 tasks done

Comments

@dikhan
Copy link
Owner

dikhan commented Sep 6, 2018

Is your feature request related to a problem?

Currently, asynchronous operations are handled properly but due to defaults some values might not meet the API timeouts and therefore asynchronous operations will not work as expected.

Describe the solution you'd like

Add support for the following extensions:

  • Resource timeouts - add support for 'x-terraform-resource-timeout: "30s"' extension on a operation level. This extension defines the amount of time to wait before timeout (applicable to both sync and async operations). In the terraform code this will imply addinfg support for &schema.Resource Timeouts in the resource schema object.

  • poll delay - add support for 'x-terraform-resource-poll-delay: "30s"' extension. This extension defines the wait time before querying the resource state

  • poll min timeout: - add support for 'x-terraform-resource-poll-min-timeout: "10s"' extension. This extension defines the smallest time to wait before refreshes.

  • poll interval - add support for 'x-terraform-resource-poll-interval: "60s"' extension. This extension defines the override MinTimeout/backoff and only poll this often

  • not found checks - add support for 'x-terraform-resource-poll-not-found-checks: 2' extension. This extension defines the number of times to allow not found responses

Acceptance criteria

What's required to consider this feature request complete?

  /v1/lbs:
    post:
      tags:
      - "lb"
      summary: "Create lb v1"
      operationId: "LBCreateV1"
      parameters:
      - in: "body"
        name: "body"
        description: "LB v1 payload object to be posted as part of the POST request"
        required: true
        schema:
          $ref: "#/definitions/LBV1"
        x-terraform-resource-timeout: "30s" # The amount of time to wait before timeout (applicable to both sync and async operations)
      responses:
        202: # Accepted
          x-terraform-resource-poll-enabled: true # [type (bool)] - this flags the response as trully async. Some resources might be async too but may require manual intervention from operators to complete the creation workflow. This flag will be used by the OpenAPI Service provider to detect whether the polling mechanism should be used or not. The flags below will only be applicable if this one is present with value 'true'
          x-terraform-resource-poll-target-statuses: "deployed" # [type (string)] - Comma separated values with the states that will considered this resource creation done/completed
          x-terraform-resource-poll-pending-statuses: "deploy_pending,deploy_in_progress" # [type (string)] - Comma separated values with the states that are "allowed" and will continue trying
          x-terraform-resource-poll-delay: "30s" # [type (string)] - Wait this time before quering the resource state
          x-terraform-resource-poll-min-timeout: "10s" # [type (string)] - Smallest time to wait before refreshes
          x-terraform-resource-poll-poll-interval: "60s" # [type (string)] - Override MinTimeout/backoff and only poll this often
          x-terraform-resource-poll-not-found-checks: 2 # [type (int)] - Number of times to allow not found
          description: "this operation is asynchronous, to check the status of the deployment call GET operation and check the status field returned in the payload"
          schema:
            $ref: "#/definitions/LBV1"
        default:
          description: "generic error response"
          schema:
            $ref: "#/definitions/Error"

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

This requests is coming from a 'nice to have' list that was scoped out from the following pool request:

#49

Checklist

Don't forget to go through the checklist to make sure the issue is created properly:

  • I have added a corresponding label (feature request/bug/etc) to the issue (right side menu)
  • I have added this issue to the 'API Terraform Provider' GitHub project (right side menu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant