Skip to content

list pipelines api endpoint and api static app permissions#140

Merged
thecaffiend merged 7 commits into
mainfrom
136-list-pipelines-api-endpoint-and-api-static-app-permissions
Oct 7, 2024
Merged

list pipelines api endpoint and api static app permissions#140
thecaffiend merged 7 commits into
mainfrom
136-list-pipelines-api-endpoint-and-api-static-app-permissions

Conversation

@thecaffiend
Copy link
Copy Markdown
Member

@thecaffiend thecaffiend commented Oct 6, 2024

TO TEST

test proc

  • Depending on when this is reviewed, this may need to be deployed again. If that is the case
    • the API will need to be manually removed in AWS console
    • your local pulumi will need to be refreshed
    • then you can deploy
  • Deployment should go with no errors (except maybe one jobq related error that seems to pop up intermittently)
  • Once deployment is finished, the best way to test the endpoints is via a local javascript test. The API is currently public (until Move DAP api behind ALB and route53 #142)
    • open a browser
    • navigate to any site. best to chose one that doesn't print to the console a bunch. if you use your browser's default search page, this stuff may not work. so go to something like stackoverflow
    • open the dev tools
    • copy and paste the baseurl and 2 functions below into the console (but not the function calls after)
    • then one by one enter the function calls and see that they complete correctly. The POST should yield a 200 with a success message stating the pipeline will be scheduled. The GET should return a json object of available pipelines.

Code Snippet for test

baseurl = "https://3uqye6t1w1.execute-api.us-east-2.amazonaws.com/dev";

async function getData(url) {
  try {
    const response = await fetch(url);
    console.log("Response status: ", response.status);
    if (!response.ok) {
      console.log(response);
      throw new Error(`Response status: ${response.status}`);
    }

    const json = await response.json();
    console.log(json);
  } catch (error) {
    console.error(error.message);
  }
}


async function postData(url) {
  try {
    const response = await fetch(
        url, {
            method: "POST",
            body: JSON.stringify(
                {
                    "pipelineName": "bactopia 3.0.1 tutorial analysispipeline",
                    "pipelineVersion": "3.0.1",
                    "inputPath": "s3://input/blah/blah/blah",
                    "outputPath": "s3://output/blah/blah/blah"
                }
            )
        }
    );
    console.log("Response status: ", response.status);
    if (!response.ok) {
      console.log(response);
      throw new Error(`Response status: ${response.status}`);
    }

    const text = await response.text();
    console.log(text);
  } catch (error) {
    console.error(error.message);
  }
}



getData(baseurl+"/analysispipelines");

postData(baseurl+"/analysispipeline");

@thecaffiend thecaffiend linked an issue Oct 6, 2024 that may be closed by this pull request
@thecaffiend thecaffiend requested a review from mehalter October 6, 2024 14:41
@thecaffiend thecaffiend merged commit 7449a72 into main Oct 7, 2024
@thecaffiend thecaffiend deleted the 136-list-pipelines-api-endpoint-and-api-static-app-permissions branch October 7, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list pipelines api endpoint and api static app permissions

2 participants