All Products
Search
Document Center

Media content moderation

Last Updated: May 27, 2020

Initialize a client

Initialize a client before using the SDK. For more information, see InitVodClient.

Submit an automated review job

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.Core.Profile;
  5. using Aliyun.Acs.vod.Model.V20170321;
  6. namespace Aliyun.Acs.vod.Sdk.SubmitAIMediaAuditJob
  7. {
  8. class MainClass
  9. {
  10. /// <summary>
  11. /// The entry point of the program, where the program control starts and ends.
  12. /// </summary>
  13. /// <param name="args">The command-line arguments.</param>
  14. public static void Main(string[] args)
  15. {
  16. try
  17. {
  18. // Initializes the client.
  19. DefaultAcsClient client = InitVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  20. // Initiates the request and obtains a response.
  21. SubmitAIMediaAuditJobResponse response = SubmitAIMediaAuditJob(client);
  22. Console.WriteLine("RequestId = " + response.RequestId);
  23. }
  24. catch (ServerException e)
  25. {
  26. if (e.RequestId ! = null)
  27. {
  28. Console.WriteLine("RequestId = " + e.RequestId);
  29. }
  30. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  31. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  32. }
  33. catch (ClientException e)
  34. {
  35. if (e.RequestId ! = null)
  36. {
  37. Console.WriteLine("RequestId = " + e.RequestId);
  38. }
  39. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  40. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  41. }
  42. catch (Exception e)
  43. {
  44. Console.WriteLine("ErrorMessage = " + e.ToString());
  45. }
  46. }
  47. /// <summary>
  48. /// Submits an automated review job.
  49. /// </summary>
  50. /// <param name="client">The client.</param>
  51. /// <summary>
  52. /// Submits an automated review job.
  53. /// </summary>
  54. /// <returns>The ID of the automated review job.</returns>
  55. /// <param name="client">The client.</param>
  56. public static SubmitAIMediaAuditJobResponse SubmitAIMediaAuditJob(DefaultAcsClient client)
  57. {
  58. // Constructs a request.
  59. SubmitAIMediaAuditJobRequest request = new SubmitAIMediaAuditJobRequest();
  60. // Sets the video ID.
  61. request.MediaId = "dc063078c1d845139e2a5bd8ffxxxxxx";
  62. // Obtains a response.
  63. return client.GetAcsResponse(request);
  64. }
  65. }
  66. }

Query an automated review job

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.Core.Profile;
  5. using Aliyun.Acs.vod.Model.V20170321;
  6. namespace Aliyun.Acs.vod.Sdk.GetAIMediaAuditJob
  7. {
  8. class MainClass
  9. {
  10. /// <summary>
  11. /// The entry point of the program, where the program control starts and ends.
  12. /// </summary>
  13. /// <param name="args">The command-line arguments. </param>
  14. public static void Main(string[] args)
  15. {
  16. try
  17. {
  18. // Initializes the client.
  19. DefaultAcsClient client = InitVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  20. // Initiates the request and obtains a response.
  21. GetAIMediaAuditJobResponse response = GetAIMediaAuditJob(client);
  22. // The GUID generated by Alibaba Cloud for the request.
  23. Console.WriteLine("RequestId = " + response.RequestId);
  24. // The job information.
  25. Console.WriteLine("MediaId = " + response.MediaAuditJob.MediaId);
  26. Console.WriteLine("JobId = " + response.MediaAuditJob.JobId);
  27. Console.WriteLine("Type = " + response.MediaAuditJob.Type);
  28. Console.WriteLine("Status = " + response.MediaAuditJob.Status);
  29. Console.WriteLine("Code = " + response.MediaAuditJob.Code);
  30. Console.WriteLine("Message = " + response.MediaAuditJob.Message);
  31. Console.WriteLine("Data AbnormalModules = " + response.MediaAuditJob.Data.AbnormalModules);
  32. Console.WriteLine("Data Label = " + response.MediaAuditJob.Data.Label);
  33. Console.WriteLine("Data Suggestion = " + response.MediaAuditJob.Data.Suggestion);
  34. }
  35. catch (ServerException e)
  36. {
  37. if (e.RequestId ! = null)
  38. {
  39. Console.WriteLine("RequestId = " + e.RequestId);
  40. }
  41. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  42. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  43. }
  44. catch (ClientException e)
  45. {
  46. if (e.RequestId ! = null)
  47. {
  48. Console.WriteLine("RequestId = " + e.RequestId);
  49. }
  50. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  51. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  52. }
  53. catch (Exception e)
  54. {
  55. Console.WriteLine("ErrorMessage = " + e.ToString());
  56. }
  57. }
  58. /// <summary>
  59. /// Queries an automated review job.
  60. /// </summary>
  61. /// <returns>The information about the automated review job.</returns>
  62. /// <param name="client">The client. </param>
  63. public static GetAIMediaAuditJobResponse GetAIMediaAuditJob(DefaultAcsClient client)
  64. {
  65. // Constructs a request.
  66. GetAIMediaAuditJobRequest request = new GetAIMediaAuditJobRequest();
  67. // Sets the job ID.
  68. request.JobId = "7dc69b893c8b4f13b47aae8de0xxxxxx";
  69. // Obtains a response.
  70. return client.GetAcsResponse(request);
  71. }
  72. }
  73. }

Obtain the summary of the automated review result

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.Core.Profile;
  5. using Aliyun.Acs.vod.Model.V20170321;
  6. namespace Aliyun.Acs.vod.Sdk.GetMediaAuditResult
  7. {
  8. class MainClass
  9. {
  10. /// <summary>
  11. /// The entry point of the program, where the program control starts and ends.
  12. /// </summary>
  13. /// <param name="args">The command-line arguments. </param>
  14. public static void Main(string[] args)
  15. {
  16. try
  17. {
  18. // Initializes the client.
  19. DefaultAcsClient client = InitVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  20. // Initiates the request and obtains a response.
  21. GetMediaAuditResultResponse response = GetMediaAuditResult(client);
  22. // The GUID generated by Alibaba Cloud for the request.
  23. Console.WriteLine("RequestId = " + response.RequestId);
  24. // The review result information.
  25. Console.WriteLine("Data AbnormalModules = " + response.MediaAuditResult.AbnormalModules);
  26. Console.WriteLine("Data Label = " + response.MediaAuditResult.Label);
  27. Console.WriteLine("Data Suggestion = " + response.MediaAuditResult.Suggestion);
  28. }
  29. catch (ServerException e)
  30. {
  31. if (e.RequestId ! = null)
  32. {
  33. Console.WriteLine("RequestId = " + e.RequestId);
  34. }
  35. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  36. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  37. }
  38. catch (ClientException e)
  39. {
  40. if (e.RequestId ! = null)
  41. {
  42. Console.WriteLine("RequestId = " + e.RequestId);
  43. }
  44. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  45. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  46. }
  47. catch (Exception e)
  48. {
  49. Console.WriteLine("ErrorMessage = " + e.ToString());
  50. }
  51. }
  52. /// <summary>
  53. /// Obtains the summary of automated review result.
  54. /// </summary>
  55. /// <returns>The summary of automated review result.</returns>
  56. /// <param name="client">The client. </param>
  57. public static GetMediaAuditResultResponse GetMediaAuditResult(DefaultAcsClient client)
  58. {
  59. // Constructs a request.
  60. GetMediaAuditResultRequest request = new GetMediaAuditResultRequest();
  61. // Sets the video ID.
  62. request.MediaId = "7dc69b893c8b4f13b47aae8de0xxxxxx";
  63. // Obtains a response.
  64. return client.GetAcsResponse(request);
  65. }
  66. }
  67. }

Obtain the details about the automated review result

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.Core.Profile;
  5. using Aliyun.Acs.vod.Model.V20170321;
  6. namespace Aliyun.Acs.vod.Sdk.GetMediaAuditResultDetail
  7. {
  8. class MainClass
  9. {
  10. /// <summary>
  11. /// The entry point of the program, where the program control starts and ends.
  12. /// </summary>
  13. /// <param name="args">The command-line arguments. </param>
  14. public static void Main(string[] args)
  15. {
  16. try
  17. {
  18. // Initializes the client.
  19. DefaultAcsClient client = InitVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  20. // Initiates the request and obtains a response.
  21. GetMediaAuditResultDetailResponse response = GetMediaAuditResultDetail(client);
  22. // The GUID generated by Alibaba Cloud for the request.
  23. Console.WriteLine("RequestId = " + response.RequestId);
  24. // The review result information.
  25. Console.WriteLine("Data Total = " + response.MediaAuditResultDetail.Total);
  26. Console.WriteLine("Data List Size = " + response.MediaAuditResultDetail.List.Count);
  27. }
  28. catch (ServerException e)
  29. {
  30. if (e.RequestId ! = null)
  31. {
  32. Console.WriteLine("RequestId = " + e.RequestId);
  33. }
  34. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  35. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  36. }
  37. catch (ClientException e)
  38. {
  39. if (e.RequestId ! = null)
  40. {
  41. Console.WriteLine("RequestId = " + e.RequestId);
  42. }
  43. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  44. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  45. }
  46. catch (Exception e)
  47. {
  48. Console.WriteLine("ErrorMessage = " + e.ToString());
  49. }
  50. }
  51. /// <summary>
  52. /// Obtains the details about automated review result.
  53. /// </summary>
  54. /// <returns>The details about automated review result.</returns>
  55. /// <param name="client">The client.</param>
  56. public static GetMediaAuditResultDetailResponse GetMediaAuditResultDetail(DefaultAcsClient client)
  57. {
  58. // Constructs a request.
  59. GetMediaAuditResultDetailRequest request = new GetMediaAuditResultDetailRequest();
  60. // Sets the video ID.
  61. request.MediaId = "7dc69b893c8b4f13b47aae8de0xxxxxx";
  62. // Sets the page number.
  63. request.PageNo = 1;
  64. // Obtains a response.
  65. return client.GetAcsResponse(request);
  66. }
  67. }
  68. }

Obtain the timeline of the automated review result

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.Core.Profile;
  5. using Aliyun.Acs.vod.Model.V20170321;
  6. namespace Aliyun.Acs.vod.Sdk.GetMediaAuditResultTimeline
  7. {
  8. class MainClass
  9. {
  10. /// <summary>
  11. /// The entry point of the program, where the program control starts and ends.
  12. /// </summary>
  13. /// <param name="args">The command-line arguments.</param>
  14. public static void Main(string[] args)
  15. {
  16. try
  17. {
  18. // Initializes the client.
  19. DefaultAcsClient client = InitVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  20. // Initiates the request and obtains a response.
  21. GetMediaAuditResultTimelineResponse response = GetMediaAuditResultTimeline(client);
  22. // The GUID generated by Alibaba Cloud for the request.
  23. Console.WriteLine("RequestId = " + response.RequestId);
  24. // The review result information.
  25. Console.WriteLine("Terrorism = " + response.MediaAuditResultTimeline.Terrorism);
  26. Console.WriteLine("Porn = " + response.MediaAuditResultTimeline.Porn);
  27. }
  28. catch (ServerException e)
  29. {
  30. if (e.RequestId ! = null)
  31. {
  32. Console.WriteLine("RequestId = " + e.RequestId);
  33. }
  34. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  35. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  36. }
  37. catch (ClientException e)
  38. {
  39. if (e.RequestId ! = null)
  40. {
  41. Console.WriteLine("RequestId = " + e.RequestId);
  42. }
  43. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  44. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  45. }
  46. catch (Exception e)
  47. {
  48. Console.WriteLine("ErrorMessage = " + e.ToString());
  49. }
  50. }
  51. /// <summary>
  52. /// Obtains the timeline of automated review result.
  53. /// </summary>
  54. /// <returns>The timeline of automated review result.</returns>
  55. /// <param name="client">The client. </param>
  56. public static GetMediaAuditResultTimelineResponse GetMediaAuditResultTimeline(DefaultAcsClient client)
  57. {
  58. // Constructs a request.
  59. GetMediaAuditResultTimelineRequest request = new GetMediaAuditResultTimelineRequest();
  60. // Sets the video ID.
  61. request.MediaId = "7dc69b893c8b4f13b47aae8de0xxxxxx";
  62. // Obtains a response.
  63. return client.GetAcsResponse(request);
  64. }
  65. }
  66. }

Start a manual review

For more information about the request and response parameters, see CreateAudit.

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.vod.Model.V20170321;
  5. using Newtonsoft.Json.Linq;
  6. namespace Aliyun.Acs.vod.Sdk.CreateAudit
  7. {
  8. class MainClass
  9. {
  10. /// <summary>
  11. /// The entry point of the program, where the program control starts and ends.
  12. /// </summary>
  13. /// <param name="args">The command-line arguments. </param>
  14. public static void Main(string[] args)
  15. {
  16. try
  17. {
  18. // Initializes the client.
  19. DefaultAcsClient client = InitVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  20. // Initiates the request and obtains a response.
  21. CreateAuditResponse response = CreateAudit(client);
  22. Console.WriteLine("RequestId = " + response.RequestId);
  23. }
  24. catch (ServerException e)
  25. {
  26. if (e.RequestId ! = null)
  27. {
  28. Console.WriteLine("RequestId = " + e.RequestId);
  29. }
  30. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  31. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  32. }
  33. catch (ClientException e)
  34. {
  35. if (e.RequestId ! = null)
  36. {
  37. Console.WriteLine("RequestId = " + e.RequestId);
  38. }
  39. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  40. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  41. }
  42. catch (Exception e)
  43. {
  44. Console.WriteLine("ErrorMessage = " + e.ToString());
  45. }
  46. }
  47. /// <summary>
  48. /// Starts manual review.
  49. /// </summary>
  50. /// <returns>The manual review.</returns>
  51. /// <param name="client">The client. </param>
  52. public static CreateAuditResponse CreateAudit(DefaultAcsClient client)
  53. {
  54. CreateAuditRequest request = new CreateAuditRequest();
  55. // Sets the manual review content.
  56. request.AuditContent = BuildAuditContent();
  57. return client.GetAcsResponse(request);
  58. }
  59. /// <summary>
  60. /// Constructs the manual review content.
  61. /// </summary>
  62. /// <returns>The manual review content.</returns>
  63. public static string BuildAuditContent()
  64. {
  65. JArray auditContents = new JArray();
  66. JObject auditContent = new JObject();
  67. auditContent.Add("VideoId", "3ebc10160bda481ca9b6858a0bxxxxxx");
  68. auditContent.Add("Status", "Blocked");
  69. auditContent.Add("Reason", "porn video");
  70. return auditContents.ToString();
  71. }
  72. }
  73. }

Obtain the manual review history

For more information about the request and response parameters, see GetAuditHistory.

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.Core.Profile;
  5. using Aliyun.Acs.vod.Model.V20170321;
  6. namespace Aliyun.Acs.vod.Sdk.GetAuditHistory
  7. {
  8. class MainClass
  9. {
  10. /// <summary>
  11. /// The entry point of the program, where the program control starts and ends.
  12. /// </summary>
  13. /// <param name="args">The command-line arguments. </param>
  14. public static void Main(string[] args)
  15. {
  16. try
  17. {
  18. // Initializes the client.
  19. DefaultAcsClient client = InitVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  20. // Initiates the request and obtains a response.
  21. GetAuditHistoryResponse response = GetAuditHistory(client);
  22. Console.WriteLine("RequestId = " + response.RequestId);
  23. // The latest manual review result.
  24. Console.WriteLine("Status = " + response.Status);
  25. // The number of records in the manual review history.
  26. Console.WriteLine("Total = " + response.Total);
  27. if (response.Histories ! = null && response.Histories.Count > 0)
  28. {
  29. foreach (GetAuditHistoryResponse.GetAuditHistory_History history in response.Histories) {
  30. Console.WriteLine("Status = " + history.Status);
  31. Console.WriteLine("CreationTime = " + history.CreationTime);
  32. Console.WriteLine("Reason = " + history.Reason);
  33. }
  34. }
  35. }
  36. catch (ServerException e)
  37. {
  38. if (e.RequestId ! = null)
  39. {
  40. Console.WriteLine("RequestId = " + e.RequestId);
  41. }
  42. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  43. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  44. }
  45. catch (ClientException e)
  46. {
  47. if (e.RequestId ! = null)
  48. {
  49. Console.WriteLine("RequestId = " + e.RequestId);
  50. }
  51. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  52. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  53. }
  54. catch (Exception e)
  55. {
  56. Console.WriteLine("ErrorMessage = " + e.ToString());
  57. }
  58. }
  59. /// <summary>
  60. /// Obtains the manual review history.
  61. /// </summary>
  62. /// <returns>The manual review history.</returns>
  63. /// <param name="client">The client.</param>
  64. public static GetAuditHistoryResponse GetAuditHistory(DefaultAcsClient client) {
  65. // Constructs a request.
  66. GetAuditHistoryRequest request = new GetAuditHistoryRequest();
  67. request.VideoId = "VideoId";
  68. request.PageNo = 1;
  69. request.PageSize = 10;
  70. return client.GetAcsResponse(request);
  71. }
  72. }
  73. }

Add IP addresses to review security groups

For more information about the request and response parameters, see SetAuditSecurityIp.

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.vod.Model.V20170321;
  5. namespace Aliyun.Acs.vod.Sdk.SetAuditSecurityIp
  6. {
  7. class MainClass
  8. {
  9. /// <summary>
  10. /// The main method.
  11. /// </summary>
  12. /// <param name="args">The command-line arguments.</param>
  13. public static void Main(string[] args)
  14. {
  15. try
  16. {
  17. // Initializes the client.
  18. DefaultAcsClient client = InitVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  19. SetAuditSecurityIpResponse response = SetAuditSecurityIp(client);
  20. Console.WriteLine("RequestId = " + response.RequestId);
  21. }
  22. catch (ServerException e)
  23. {
  24. if (e.RequestId ! = null)
  25. {
  26. Console.WriteLine("RequestId = " + e.RequestId);
  27. }
  28. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  29. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  30. }
  31. catch (ClientException e)
  32. {
  33. if (e.RequestId ! = null)
  34. {
  35. Console.WriteLine("RequestId = " + e.RequestId);
  36. }
  37. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  38. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  39. }
  40. catch (Exception e)
  41. {
  42. Console.WriteLine("ErrorMessage = " + e.ToString());
  43. }
  44. }
  45. /// <summary>
  46. /// Adds IP addresses to review security groups.
  47. /// </summary>
  48. /// <returns>The whitelist of IP addresses in review security groups.</returns>
  49. /// <param name="client">The client.</param>
  50. public static SetAuditSecurityIpResponse SetAuditSecurityIp (DefaultAcsClient client)
  51. {
  52. // Constructs a request.
  53. SetAuditSecurityIpRequest request = new SetAuditSecurityIpRequest();
  54. // Sets the name of each review security group. Default value: Default.
  55. request.SecurityGroupName = "MyGroupName";
  56. // Sets the write mode. The default value Append indicates that new IP addresses are appended to the whitelist.
  57. request.OperateMode = "Cover";
  58. // Sets the whitelist of IP addresses in each review security group.
  59. request.Ips = "10.23.12.20,10.23.12.21,10.23.12.22";
  60. return client.GetAcsResponse(request);
  61. }
  62. }
  63. }

Obtain a whitelist of IP addresses in review security groups

For more information about the request and response parameters, see ListAuditSecurityIp.

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.vod.Model.V20170321;
  5. namespace Aliyun.Acs.vod.Sdk.ListAuditSecurityIp
  6. {
  7. class MainClass
  8. {
  9. /// <summary>
  10. /// The entry point of the program, where the program control starts and ends.
  11. /// </summary>
  12. /// <param name="args">The command-line arguments. </param>
  13. public static void Main(string[] args)
  14. {
  15. try
  16. {
  17. // Initializes the client.
  18. DefaultAcsClient client = InitVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  19. // Initiates the request and obtains a response.
  20. ListAuditSecurityIpResponse response = ListAuditSecurityIp(client);
  21. Console.WriteLine("RequestId = " + response.RequestId);
  22. if (response.SecurityIpList ! = null && response.SecurityIpList.Count > 0)
  23. {
  24. foreach (ListAuditSecurityIpResponse.ListAuditSecurityIp_SecurityIp securityIp in response.SecurityIpList)
  25. {
  26. Console.WriteLine("SecurityGroupName = " + securityIp.SecurityGroupName);
  27. Console.WriteLine("Ips = " + securityIp.Ips);
  28. Console.WriteLine("CreationTime = " + securityIp.CreationTime);
  29. }
  30. }
  31. }
  32. catch (ServerException e)
  33. {
  34. if (e.RequestId ! = null)
  35. {
  36. Console.WriteLine("RequestId = " + e.RequestId);
  37. }
  38. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  39. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  40. }
  41. catch (ClientException e)
  42. {
  43. if (e.RequestId ! = null)
  44. {
  45. Console.WriteLine("RequestId = " + e.RequestId);
  46. }
  47. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  48. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  49. }
  50. catch (Exception e)
  51. {
  52. Console.WriteLine("ErrorMessage = " + e.ToString());
  53. }
  54. }
  55. /// <summary>
  56. /// Obtains a whitelist of IP addresses in review security groups.
  57. /// </summary>
  58. /// <returns>The whitelist of IP addresses in automated review security groups.</returns>
  59. /// <param name="client">The client.</param>
  60. public static ListAuditSecurityIpResponse ListAuditSecurityIp(DefaultAcsClient client)
  61. {
  62. // Constructs a request.
  63. ListAuditSecurityIpRequest request = new ListAuditSecurityIpRequest();
  64. // Sets the name of each review security group.
  65. request.SecurityGroupName = "MyGroupName";
  66. return client.GetAcsResponse(request);
  67. }
  68. }
  69. }