缺少 posixAccounts API 信息
posixAccounts API information missing
我没有从以下 link 中看到我的 posixAccounts 信息:
https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/get
{
"kind": "admin#directory#user",
"id": "8675309",
"etag": "\"UUID\"",
"primaryEmail": "email@example.com",
"name": {
"givenName": "Email",
"familyName": "Account",
"fullName": "Email Account"
},
"isAdmin": true,
"isDelegatedAdmin": false,
"lastLoginTime": "2021-08-04T21:11:17.000Z",
"creationTime": "2021-06-16T14:32:35.000Z",
"agreedToTerms": true,
"suspended": false,
"archived": false,
"changePasswordAtNextLogin": false,
"ipWhitelisted": false,
"emails": [
{
"address": "email@example.com",
"primary": true
},
{
"address": "email@example.com.test-google-a.com"
}
],
"phones": [
{
"value": "123-456-7890",
"type": "work"
}
],
"nonEditableAliases": [
"email@example.com.test-google-a.com"
],
"customerId": "id12345",
"orgUnitPath": "/path/to/org",
"isMailboxSetup": true,
"isEnrolledIn2Sv": false,
"isEnforcedIn2Sv": false,
"includeInGlobalAddressList": true
}
从上面的输出可以看出,没有posixAccount信息。我可以在 Apache Directory Studio 中打开 ldap 信息,所以我知道它在那里,但我无法从上面的输出中看到它。虽然我可以看到它,但我尝试使用 API.
中的更新功能对其进行更新
https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/update
我将其用于负载,因为我只是在测试更新 gid 信息。我使用下面的文档来获取所需的条目详细信息。至少据我所知。
{
"posixAccounts": [
{
"gid": "12345",
}
]
}
https://developers.google.com/admin-sdk/directory/reference/rest/v1/users
我收到 200 响应,但在执行 PUT 更新时,用户实际上没有任何变化。
我在这里尝试了另一个用户的类似更新方法,但无济于事:Google Admin SDK - Create posix attributes on existing user
我通过在我的 PUT 请求中提供额外的细节来解决这个问题:
{
"posixAccounts": [
{
"username": "email(excluding @domain.com)",
"uid": "1234",
"gid": "12345",
"operatingSystemType": "unspecified",
"shell": "/bin/bash",
"gecos": "Firstname Lastname"
"systemId": ""
}
]
}
在我将“systemId”放入其中之前,上面的内容不会反映在 LDAP 中。所以那部分是必需的。
我没有从以下 link 中看到我的 posixAccounts 信息: https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/get
{
"kind": "admin#directory#user",
"id": "8675309",
"etag": "\"UUID\"",
"primaryEmail": "email@example.com",
"name": {
"givenName": "Email",
"familyName": "Account",
"fullName": "Email Account"
},
"isAdmin": true,
"isDelegatedAdmin": false,
"lastLoginTime": "2021-08-04T21:11:17.000Z",
"creationTime": "2021-06-16T14:32:35.000Z",
"agreedToTerms": true,
"suspended": false,
"archived": false,
"changePasswordAtNextLogin": false,
"ipWhitelisted": false,
"emails": [
{
"address": "email@example.com",
"primary": true
},
{
"address": "email@example.com.test-google-a.com"
}
],
"phones": [
{
"value": "123-456-7890",
"type": "work"
}
],
"nonEditableAliases": [
"email@example.com.test-google-a.com"
],
"customerId": "id12345",
"orgUnitPath": "/path/to/org",
"isMailboxSetup": true,
"isEnrolledIn2Sv": false,
"isEnforcedIn2Sv": false,
"includeInGlobalAddressList": true
}
从上面的输出可以看出,没有posixAccount信息。我可以在 Apache Directory Studio 中打开 ldap 信息,所以我知道它在那里,但我无法从上面的输出中看到它。虽然我可以看到它,但我尝试使用 API.
中的更新功能对其进行更新https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/update
我将其用于负载,因为我只是在测试更新 gid 信息。我使用下面的文档来获取所需的条目详细信息。至少据我所知。
{
"posixAccounts": [
{
"gid": "12345",
}
]
}
https://developers.google.com/admin-sdk/directory/reference/rest/v1/users
我收到 200 响应,但在执行 PUT 更新时,用户实际上没有任何变化。
我在这里尝试了另一个用户的类似更新方法,但无济于事:Google Admin SDK - Create posix attributes on existing user
我通过在我的 PUT 请求中提供额外的细节来解决这个问题:
{
"posixAccounts": [
{
"username": "email(excluding @domain.com)",
"uid": "1234",
"gid": "12345",
"operatingSystemType": "unspecified",
"shell": "/bin/bash",
"gecos": "Firstname Lastname"
"systemId": ""
}
]
}
在我将“systemId”放入其中之前,上面的内容不会反映在 LDAP 中。所以那部分是必需的。