microsoftgraph / msgraph-cli-archived

The Microsoft Graph CLI repository has moved. This repository is now an archive.
https://github.com/microsoftgraph/msgraph-cli
Other
44 stars 9 forks source link

Missing entitysets and singletons for v1.0 #103

Closed MIchaelMainer closed 2 years ago

MIchaelMainer commented 3 years ago

Describe the bug This issue identifies which high level entity sets and singletons are missing from the CLI for v1.0. This is assuming subgroups should map to singletons and entity sets. There is a mapping here that needs to be understood. We need to be clear about how we map the functionality so we can make a claim about what we currently support and don't support at a high-level.

To Reproduce Steps to reproduce the behavior:

  1. Install the CLI.
  2. Run mg -h and observe the subgroups. Subgroups should map to the entitysets in the metadata.

Expected entity sets and singletons

These are expected in the sense that they exist in the metadata for v1.0. Some of these I have no idea about how they work or if they are expected to work.

Entity sets

agreementAcceptances agreements applications (actual) applicationTemplates authenticationMethodConfigurations certificateBasedAuthConfiguration chats contacts contracts dataPolicyOperations devices directoryObjects (actual) directoryRoles directoryRoleTemplates domainDnsRecords domains drives groupLifecyclePolicies groups groupSettings groupSettingTemplates identityProviders invitations localizations oauth2PermissionGrants organization permissionGrants places schemaExtensions (actual) scopedRoleMemberships servicePrincipals shares sites (actual) subscribedSkus subscriptions teams (actual) teamsTemplates users (actual) workbooks

Singletons

appCatalogs auditLogs authenticationMethodsPolicy branding communications deviceAppManagement deviceManagement directory drive education (actual) identity identityGovernance informationProtection me planner (actual) policies print reports (actual) roleManagement search security (actual) teamwork

Got the expected entity sets and singletons using a query like this:

string v1_0 = "https://graph.microsoft.com/v1.0/$metadata";
string metadata = new WebClient().DownloadString(v1_0);
XElement xMetadata = XElement.Parse(metadata);
var entitysets = xMetadata.Descendants("{http://docs.oasis-open.org/odata/ns/edm}EntitySet").OrderBy(m => m.Attribute("Name").Value).Select(m => m.Attribute("Name").Value).ToList();
foreach (var s in entitysets)
{
    Console.WriteLine(s.ToString());    
}

Actual entity sets and singletons

Note that there is a mapping between some of these and the above entity sets and singletons.

applications calendar changenotifications cloud cloudcommunications crossdeviceexperiences devicescorpmgt directoryobjects education files identitydirmgt identitysignins mail notes people personalcontacts planner reports schemaextensions security sites teams users ~usersactions~ ~usersfunctions~

AB#9367

jobala commented 3 years ago

Prioritizing this as P1 for now but will be promoted to P0 depending on incoming P0 items between now and the next triage. This wil resolve #111

MIchaelMainer commented 3 years ago

Note that PowerShell supports all singletons except for /me. Main reason is that /me is supported with /users

calebkiage commented 3 years ago

So, @peombwa was kind enough to direct me to a mapping that they use in the powershell SDK for the entity sets and singletons ModulesMapping.jsonc. I'll be going through it and confirming that all entity sets & singletons appear in the list. I can see for example that applicationTemplates is a part of the mapping under Applications. I do know from my conversation with Peter that there are some endpoints that are invalid e.g. workbooks which is commented out in the mapping file.