How to get error description of action from github api? - api

GitHub api has the enpdoint to get logs of job from Actions: https://api.github.com/repos/:username/:repo/actions/runs/:log_id/logs
But this endpoint returns full log file with a lot of unnecessary information.
I need only a part of it: the description of an error. I wouldn't like to parse the whole log file, so is there a way to get only the description of an error?
Or can I change log level from INFO to ERROR?

Related

Is it possible to link to a job in the bigquery console?

If I execute a BigQuery job using the REST API (i.e. bigquery.googleapis.com) in the response I get back a selfLink that looks something like this:
https://bigquery.googleapis.com/bigquery/v2/projects/my-project/jobs/job_0123456789ABCDEF?location=EU
In the UI (ie.. console.cloud.google.com) I can see the very same job in the project's query history:
Is it possible to use the information within that API response and construct a URL that will allow a person to visit that URL in the browser and be taken directly to the information about that query in the UI? This would be really useful because we could log a message containing that URL so that anyone viewing the logs can see a user-friendly UI regarding that job.
I suspect the answer is "no" but just thought I'd ask.
I believe you can share this link:
https://console.cloud.google.com/bigquery?project=<my-project>j=<bq:<location>:<job_id>>&page=queryresults
For example: https://console.cloud.google.com/bigquery?project=my-project&j=bq:US:2846160a-9a13-4192-9bff-e691ff2adab6&page=queryresults
If a user has BQ Job List permission in that project, then when they open up the link they will be be able to see the query that was run in the UI, along with the job information.
But they can't see the query results, which is intended behavior. Instead they will get a warning:
Access Denied: User does not have permission to access results of another user's job.

How to get remote state file for my latest Terraform (Enterprise) run?

I want to get the latest run for my workspace and grab its Terraform state file. We are using Terraform Enterprise.
I did the below and I got get the payload:
https://ptfe-dev.company.com.au/api/v2/organizations/organization-name/workspaces/workspace1
I get output but information of the workspace id etc, but that is what not what I want.
With the above output, I get workspace id and I ran the query below:
https://ptfe-dev.companyname.com.au/api/v2/organizations/organization-name/workspaces/workspace1/current-state-version
However, the above query returns:
Sorry, the page /api/v2/organizations/rganization-name/workspaces/workspace1/states/sv-DKBZ2AFoV5mwY4kP could not be found.
This error could mean one of two things:
The resource doesn't exist
The resource exists, but you do not have permission to access it
If someone has linked you to this resource, ensure that they have given you proper permissions to access it.
I can, however, access the same resource (workspace1) state file via TFE UI.
Can anyone please advise me what I am doing wrong here?
In the payload from the first API call, you'll get the reference to the endpoint to get the state.
<tfe_host>/api/v2/workspaces/<workspace_id>/current-state-version
To include outputs, add include=putputs parameter like this:
<tfe_host>/api/v2/workspaces/<workspace_id>/current-state-version?include=outputs
You only need the organizations to get the workspace itself. When you get the state, you're referencing the workspace ID directly and don't need to include the organization.

Directus - AWS S3 Upload - error message: Cannot set property 'value' of undefined

I just set up directus with s3 storage like this: https://docs.directus.io/extensions/storage-adapters.html#core-adapters
It seems to be working: but there is one issue:
When I upload an image, it gives me an error: Cannot set property "value" of undefined
But when I refresh the page, all is done and it seems to be fine. The files are on s3 and I can see it in my admin panel. But the error message and the need to refresh the page sucks - especially when it comes to give it to my clients.
Is it possible that this could be a bug in the source code of directus?
But when its like that, why I am the only person having this issue ... ?
Here are my config details:
It could be a bug... perhaps related to a migrations issue (which would be why it's not seen by more people). You could open a ticket on GitHub and the developers will check it out. Just try to make sure it's not a config issue first. :)

GET Save Queries from log Analytics via Azure API

Hi there i'm trying to get the queries i've saved in log analytics via an API GET Request. and following the guide (even testing it from the Documentation page) doesn't work. I know the queries are there and are saved, am i missing something?
I follow this documentation:
Microsoft Docs - Saved Searches - Get
I Call the API like this:
GET
https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}?api-version=2015-03-20
Authorization: Bearer eyJ0...eXAQ
And the respons i get is this:
404 Not Found
{
"error": {
"code": "SavedSearchNotFound",
"message": "Saved search '[NAME OF MY SAVED QUERY]' could not be found."
}
}
I really cant figure out what the problem is here. Has anyone encountered this before?
Found My Answer:
The "{savedSearchId}" is supposed to be a guid... As i tried to find one at the beginning when constructing the URL i coundn't find an id for each search query. so i thought it was the name of it.
You can find the Query by clicking the three dots to the right of each saved query and click edit.
The query will show the ID for it under the name in Gray text.

How to get the list of all the issues in a project in JIRA using REST API?

I am trying to get the list of all the issues irrespective of their status in a JIRA project.
I am doing a GET requset to the following URL:
https://jira.org.com/rest/api/2/search?jql=project={projectID}&issuetype=all
But, this doesn't return all the issues in response.
Where am I going wrong? Is the URL format above wrong?