func (s *InstanceVariablesService) GetVariable(key string, options ...RequestOptionFunc) (*InstanceVariable, *Response, error) {
	u := fmt.Sprintf("admin/ci/variables/%s", url.PathEscape(key))
	req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
	if err != nil {
		return nil, nil, err
	}
	v := new(InstanceVariable)
	resp, err := s.client.Do(req, v)
	if err != nil {
		return nil, resp, err
	}
	return v, resp, err
}
GetVariable gets a variable.

GitLab API docs:
https://docs.gitlab.com/ee/api/instance_level_ci_variables.html#show-instance-variable-details
package gitlab
import (
	"fmt"
	"net/http"
	"net/url"
)
type InstanceVariablesService struct {
	client *Client
}
type InstanceVariable struct {
	Key          string            `json:"key"`
	Value        string            `json:"value"`
	VariableType VariableTypeValue `json:"variable_type"`
	Protected    bool              `json:"protected"`
	Masked       bool              `json:"masked"`
}
func (v InstanceVariable) String() string {
	return Stringify(v)
}
type ListInstanceVariablesOptions ListOptions
func (s *InstanceVariablesService) ListVariables(opt *ListInstanceVariablesOptions, options ...RequestOptionFunc) ([]*InstanceVariable, *Response, error) {
	u := "admin/ci/variables"
	req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	var vs []*InstanceVariable
	resp, err := s.client.Do(req, &vs)
	if err != nil {
		return nil, resp, err
	}
	return vs, resp, err
}