public async Task OnPostViewDashboardForTest1User(string dashboard) { const string userName = "******"; var account = await _amazonSecurityTokenService.GetCallerIdentityAsync(new GetCallerIdentityRequest()); await LoadDashBoardsAsync(account.Account); // ユーザーを取得(いなかったら登録)してグループに追加 var quickSightUserArn = await GetUserArnAsync(account.Account, "default", userName); if (string.IsNullOrEmpty(quickSightUserArn)) { quickSightUserArn = await RegisterUserAsync(account.Account, "default", userName, UserRole.READER); } await _amazonQuickSight.CreateGroupMembershipAsync( new CreateGroupMembershipRequest { AwsAccountId = account.Account, GroupName = "SampleDashboard", Namespace = "default", MemberName = userName }); // ダッシュボードを表示 var response = await _amazonQuickSight.GenerateEmbedUrlForRegisteredUserAsync(new GenerateEmbedUrlForRegisteredUserRequest { AwsAccountId = account.Account, ExperienceConfiguration = new RegisteredUserEmbeddingExperienceConfiguration { Dashboard = new RegisteredUserDashboardEmbeddingConfiguration { InitialDashboardId = dashboard, } }, UserArn = quickSightUserArn, SessionLifetimeInMinutes = 15, }); EmbedDashboardUrl = response.EmbedUrl; }
private Amazon.QuickSight.Model.CreateGroupMembershipResponse CallAWSServiceOperation(IAmazonQuickSight client, Amazon.QuickSight.Model.CreateGroupMembershipRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon QuickSight", "CreateGroupMembership"); try { #if DESKTOP return(client.CreateGroupMembership(request)); #elif CORECLR return(client.CreateGroupMembershipAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }