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

Implement MAC settings profile CRUD API #7396

Merged
merged 12 commits into from
Nov 25, 2024
Merged

Conversation

halimi
Copy link
Contributor

@halimi halimi commented Nov 20, 2024

Summary

References: #7380

This PR implements the MAC settings profile CRUD API. This is the first step (1 out of 6) of the proposed implementation plan.

Changes

  • New API for MAC settings profile CRUD operation

Testing

Steps

Pre-requisite: Create an application

Tests:

  • Create/Get/Update/List/Delete a MAC settings profile using the HTTP API
Results
  • Create a MAC settings profile:

Request:

 POST http://localhost:1885/api/v3/ns/applications/myapp/mac_settings_profiles
> Authorization: Bearer  MFRWG.QRQCFEX537L4S3ETCM56BLPQKTT2OGOSHRHUCXI.AKJG32COZUA2VD74Z7KOQMKWJPENCDT4KIHPAWYSHHTMKYJL4OIQ
> content-type: application/json
> data
{
  "mac_settings_profile": {
    "ids": {
      "application_ids": {
        "application_id": "myapp"
      },
      "profile_id": "prof-01"
    },
    "mac_settings": {
      "resets_f_cnt": false,
      "factory_preset_frequencies": [
        1,
        2,
        3
      ]
    }
  }
}

Response:

{
  "mac_settings_profile": {
    "ids": {
      "application_ids": {
        "application_id": "myapp"
      },
      "profile_id": "prof-01"
    },
    "mac_settings": {
      "factory_preset_frequencies": [
        "1",
        "2",
        "3"
      ],
      "resets_f_cnt": false
    }
  }
}
  • Get a MAC settings profile

Request:

GET http://localhost:1885/api/v3/ns/applications/myapp/mac_settings_profiles/prof-01?field_mask=ids
> Authorization: Bearer MFRWG.QRQCFEX537L4S3ETCM56BLPQKTT2OGOSHRHUCXI.AKJG32COZUA2VD74Z7KOQMKWJPENCDT4KIHPAWYSHHTMKYJL4OIQ

Response:

{
  "mac_settings_profile": {
    "ids": {
      "application_ids": {
        "application_id": "myapp"
      },
      "profile_id": "prof-01"
    }
  }
}
  • Update a MAC settings profile

Request:

PUT http://localhost:1885/api/v3/ns/applications/myapp/mac_settings_profiles/prof-01
> Authorization: Bearer MFRWG.QRQCFEX537L4S3ETCM56BLPQKTT2OGOSHRHUCXI.AKJG32COZUA2VD74Z7KOQMKWJPENCDT4KIHPAWYSHHTMKYJL4OIQ
> content-type: application/json
> data
{
  "mac_settings_profile": {
    "ids": {
      "application_ids": {
        "application_id": "myapp"
      },
      "profile_id": "prof-01"
    },
    "mac_settings": {
      "resets_f_cnt": true,
      "factory_preset_frequencies": [
        1,
        2,
        3,
        4,
        5
      ]
    }
  }
}

Response:

{
  "mac_settings_profile": {
    "ids": {
      "application_ids": {
        "application_id": "myapp"
      },
      "profile_id": "prof-01"
    },
    "mac_settings": {
      "factory_preset_frequencies": [
        "1",
        "2",
        "3",
        "4",
        "5"
      ],
      "resets_f_cnt": true
    }
  }
}
  • List MAC settings profiles

Request:

GET http://localhost:1885/api/v3/ns/applications/myapp/mac_settings_profiles?field_mask=ids
> Authorization: Bearer MFRWG.QRQCFEX537L4S3ETCM56BLPQKTT2OGOSHRHUCXI.AKJG32COZUA2VD74Z7KOQMKWJPENCDT4KIHPAWYSHHTMKYJL4OIQ

Response:

{
  "mac_settings_profiles": [
    {
      "ids": {
        "application_ids": {
          "application_id": "myapp"
        },
        "profile_id": "prof-01"
      }
    },
    {
      "ids": {
        "application_ids": {
          "application_id": "myapp"
        },
        "profile_id": "prof-02"
      }
    }
  ]
}
  • Delete a MAC settings profile

Request:

DELETE http://localhost:1885/api/v3/ns/applications/myapp/mac_settings_profiles/prof-01
> Authorization: Bearer MFRWG.QRQCFEX537L4S3ETCM56BLPQKTT2OGOSHRHUCXI.AKJG32COZUA2VD74Z7KOQMKWJPENCDT4KIHPAWYSHHTMKYJL4OIQ

Response:

{}
Regressions

...

Notes for Reviewers

...

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • Testing: The steps/process to test this feature are clearly explained including testing for regressions.
  • Infrastructure: If infrastructural changes (e.g., new RPC, configuration) are needed, a separate issue is created in the infrastructural repositories.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@halimi halimi requested review from a team as code owners November 20, 2024 11:06
@github-actions github-actions bot added c/network server This is related to the Network Server compat/db This could affect Database compatibility compat/config This could affect Configuration compatibility labels Nov 20, 2024
@halimi halimi self-assigned this Nov 20, 2024
@halimi halimi added this to the v3.33.0 milestone Nov 20, 2024
@github-actions github-actions bot added ui/web This is related to a web interface tooling Development tooling labels Nov 20, 2024
@halimi halimi force-pushed the feature/mac-settings-profile branch from 5c16798 to 93769f2 Compare November 21, 2024 16:09
Copy link
Member

@johanstokking johanstokking left a comment

Choose a reason for hiding this comment

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

Great stuff!

pkg/networkserver/grpc_mac_settings_profile.go Outdated Show resolved Hide resolved
@KrishnaIyer
Copy link
Member

Should we mark this API as experimental until we complete the rest of the ToDo items this is tested with end devices?

@johanstokking
Copy link
Member

Should we mark this API as experimental until we complete the rest of the ToDo items this is tested with end devices?

Yeah good call, let's do that.

@halimi
Copy link
Contributor Author

halimi commented Nov 25, 2024

Should we mark this API as experimental until we complete the rest of the ToDo items this is tested with end devices?

@KrishnaIyer Can you please help me out? What should I do to mark it as experimental? Is it just the CHANGELOG or more?

@KrishnaIyer
Copy link
Member

  1. Changelog: Add a comment (This feature is experimental and subject to change)
  2. Service comment in the proto file: NsMACSettingsProfileRegistry EXPERIMENTAL: This service is subject to change.

@halimi halimi force-pushed the feature/mac-settings-profile branch from f4ef7a5 to b371c74 Compare November 25, 2024 16:09
@halimi halimi merged commit 80f08bf into v3.33 Nov 25, 2024
15 of 16 checks passed
@halimi halimi deleted the feature/mac-settings-profile branch November 25, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/network server This is related to the Network Server compat/config This could affect Configuration compatibility compat/db This could affect Database compatibility tooling Development tooling ui/web This is related to a web interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants