Skip to content

Conversation

@rbajoria26
Copy link
Contributor

@rbajoria26 rbajoria26 commented Mar 27, 2025

📝 Description

This PR adds the monitor APIs used by the ACLP functionality

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?
The changes can be verified by running the following code:

package main

import (
	"context"
	"fmt"
	"log"
	"net/http"
	"os"

	"github.com/linode/linodego"

	"golang.org/x/oauth2"
)

func main() {
	apiKey, ok := os.LookupEnv("LINODE_TOKEN")
	if !ok {
		log.Fatal("Could not find LINODE_TOKEN, please assert it is set.")
	}
	tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: apiKey})

	oauth2Client := &http.Client{
		Transport: &oauth2.Transport{
			Source: tokenSource,
		},
	}

	linodeClient := linodego.NewClient(oauth2Client)
	linodeClient.SetDebug(true)

	res, err := linodeClient.ListMonitorServices(context.Background(), nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%v", res)
}

How do I run the relevant unit/integration tests?
Run integration test as follows:

make test-int TEST_ARGS="-run TestMonitorServices_Get_smoke"
make test-int TEST_ARGS="-run TestMonitorDashboards_Get_smoke"
make fixtures TEST_ARGS="-run TestMonitorMetricDefinitions_Get_smoke"
make fixtures TEST_ARGS="-run TestMonitorServicesTokenCreation_Get_smoke"

Run unit test as follows:

make test-unit TEST_ARGS="-run TestListMonitorServices" 
make test-unit TEST_ARGS="-run TestListMonitorDashboards"
make test-unit TEST_ARGS="-run TestListMonitorMetricDefinitionsByType"
make test-unit TEST_ARGS="-run TestCreateMonitorServicesToken"

@rbajoria26 rbajoria26 marked this pull request as ready for review March 27, 2025 09:44
@rbajoria26 rbajoria26 requested a review from a team as a code owner March 27, 2025 09:44
@rbajoria26 rbajoria26 requested review from yec-akamai and zliang-akamai and removed request for a team March 27, 2025 09:44
Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for starting contributing to linodego for ACLP! I reviewed the dashboard change and find there are some common issue in the implementation. Can you fix them given the comments as well as in the rest of the PR? i.e. naming, enum, etc.

@rbajoria26 rbajoria26 requested a review from yec-akamai April 7, 2025 10:43
@rbajoria26 rbajoria26 requested a review from yec-akamai April 10, 2025 07:37
Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the issue reported by GHA?

@rbajoria26 rbajoria26 requested a review from yec-akamai April 17, 2025 07:17
Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests passed on my end, nice work!

@rbajoria26 rbajoria26 force-pushed the DI-23858-add-monitor-apis branch from dd86bb3 to eb9d203 Compare April 17, 2025 16:07
@rbajoria26 rbajoria26 requested a review from yec-akamai April 17, 2025 16:09
rbajoria26 and others added 15 commits April 17, 2025 21:47
build(deps): bump crazy-max/ghaction-github-labeler from 5.2.0 to 5.3.0 (linode#704)

Bumps [crazy-max/ghaction-github-labeler](https://github.com/crazy-max/ghaction-github-labeler) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/crazy-max/ghaction-github-labeler/releases)
- [Commits](crazy-max/ghaction-github-labeler@31674a3...24d110a)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-github-labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* lke-e node pool

* lint

build(deps): bump golangci/golangci-lint-action from 6 to 7 (linode#705)

* build(deps): bump golangci/golangci-lint-action from 6 to 7

Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@v6...v7)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* golangci-lint migrate

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zhiwei Liang <[email protected]>
Co-authored-by: Zhiwei Liang <[email protected]>
build(deps): bump golang.org/x/net from 0.37.0 to 0.38.0 (linode#703)

* build(deps): bump golang.org/x/net from 0.37.0 to 0.38.0

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.37.0 to 0.38.0.
- [Commits](golang/net@v0.37.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* make tidy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ye Chen <[email protected]>
Co-authored-by: Zhiwei Liang <[email protected]>

Add option to disable cloud firewall when running integration tests (linode#712)

* add environment variable option to disable cfw

* update backup disk size

* update backup disk size
build(deps): bump github.com/jarcoal/httpmock from 1.3.1 to 1.4.0 (linode#710)

* build(deps): bump github.com/jarcoal/httpmock from 1.3.1 to 1.4.0

Bumps [github.com/jarcoal/httpmock](https://github.com/jarcoal/httpmock) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/jarcoal/httpmock/releases)
- [Commits](jarcoal/httpmock@v1.3.1...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/jarcoal/httpmock
  dependency-version: 1.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Ran make tidy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ezilber-akamai <[email protected]>

Update LDE capability name and tests (linode#718)

* update lde capability name and tests

* Fix failing fixture

* Fix failing fixture

* Fix failing fixture
build(deps): bump golang.org/x/net from 0.38.0 to 0.39.0 (linode#716)

* build(deps): bump golang.org/x/net from 0.38.0 to 0.39.0

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.38.0 to 0.39.0.
- [Commits](golang/net@v0.38.0...v0.39.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Ran make tidy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ezilber-akamai <[email protected]>
Co-authored-by: Zhiwei Liang <[email protected]>

build(deps): bump golang.org/x/oauth2 from 0.28.0 to 0.29.0 (linode#709)

* build(deps): bump golang.org/x/oauth2 from 0.28.0 to 0.29.0

Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.28.0 to 0.29.0.
- [Commits](golang/oauth2@v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* make tidy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zhiwei Liang <[email protected]>
@rbajoria26 rbajoria26 force-pushed the DI-23858-add-monitor-apis branch 4 times, most recently from 5be250b to 800ccff Compare April 17, 2025 16:35
@rbajoria26
Copy link
Contributor Author

#722 - created a new PR with updates, the current one got messed up

@yec-akamai
Copy link
Contributor

Close this PR in favor of #722

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.

4 participants