All Products
Search
Document Center

OpenSearch:C# Config class

Last Updated:Feb 23, 2023

Parameters

  • Config: the key parameters that are used to make a request for OpenSearch API.

    • string endpoint: the endpoint of OpenSearch API. The value does not contain the http:// or https:// prefix.

    • string protocol: the request protocol. Valid values: HTTP and HTTPS.

    • string type: the authentication method. Valid values: access_key and sts. You can implement authentication based on an Alibaba Cloud account, a RAM user, or Security Token Service (STS).

    • string securityToken: the security token that is used for authentication. This parameter is required if you set the type parameter to sts. You can call the AssumeRole operation of Alibaba Cloud Resource Access Management (RAM) to obtain an STS token.

    • string accessKeyId and accessKeySecret: the AccessKey pair that is used to access OpenSearch. You can click the following link to go to the AccessKey Pair page and create an AccessKey pair:

      https://ram.console.alibabacloud.com/manage/ak

    • string userAgent: the user identification information. In most cases, this parameter is not specified.

    Sample code

    The following sample code configures a C# Config instance:

    using System;
    using System.Collections.Generic;
    using System.IO;
    using Tea;
    
    
    public class Config : TeaModel
    {
      [NameInMap("endpoint")]
      [Validation(Required = false)]
      public string Endpoint { get; set; }
    
      [NameInMap("protocol")]
      [Validation(Required = false)]
      public string Protocol { get; set; }
    
      [NameInMap("type")]
      [Validation(Required = false)]
      public string Type { get; set; }
    
      [NameInMap("securityToken")]
      [Validation(Required = false)]
      public string SecurityToken { get; set; }
    
      [NameInMap("accessKeyId")]
      [Validation(Required = false)]
      public string AccessKeyId { get; set; }
    
      [NameInMap("accessKeySecret")]
      [Validation(Required = false)]
      public string AccessKeySecret { get; set; }
    
      [NameInMap("userAgent")]
      [Validation(Required = false)]
      public string UserAgent { get; set; }
    }