黄p网站_在线看中文字幕_亚洲电影免费观看_成人激情视频_欧美成视频_中国av在线

Consul 協程客戶端

EasySwoole 提供了一個協程安全的 Consul 協程版本客戶端,方便用戶做分布式的微服務開發。

組件要求

  • easyswoole/spl: ^1.1
  • easyswoole/http-client: ^1.2.5

安裝方法

composer require easyswoole/consul

倉庫地址

easy-swoole/consul

使用方式

  • 使用下面的接口方式,都需要先給 Consul 注入 Config 配置。
  • 接口只展示用法,具體的命名空間需要開發者自己引入
use EasySwoole\Consul\Config;
use EasySwoole\Consul\Consul;

// config默認  127.0.0.1:8500/v1
$config = new Config([
    'IP'       => '127.0.0.1',
    'port'     => '8500',
    'version'  => 'v1',
]);
$consul = new Consul($config);

// 兩種寫法,結果相同
$config = new Config();
$config->setIP('127.0.0.1');
$config->setPort('8500');
$config->setVersion('v1');    

$consul = new Consul($config);

ACLs

// Bootstrap ACLs
$bootstrap = new Bootstrap();
$this->consul->acl()->bootstrap($bootstrap);

// Check ACL Replication
$replication = new Replication();
$this->consul->acl()->replication($replication);

// Translate Rules
// Translate a Legacy Token's Rules
$translate = new Translate([
    'accessor_id' => $accessor_id
]);
$this->consul->acl()->translate($translate);

// Login to Auth Method
$login = new Login([
    "authMethod" => $authMethod,
    "bearerToken" => $bearerToken
]);
$this->consul->acl()->login($login);

// Logout from Auth Method
$logout = new Logout([
    'token' => $header['token']
]);
$this->consul->acl()->logout($logout);

Tokens

// Create a Token
$token = new Token([
    "description" => "Agent token for 'node1'",
    "Policies" => [
        ["ID" => "165d4317-e379-f732-ce70-86278c4558f7"],
        ["Name" => "node-read"],
    ],
    "Local" => false,
]);
$this->consul->acl()->token($token);

// Read a Token
$token = new Token([
    "AccessorID" => "6a1253d2-1785-24fd-91c2-f8e78c745511"
]);
$this->consul->acl()->readToken($token);

// Read Self Token
$self = new Token\GetSelf([
    'token' => "6a1253d2-1785-24fd-91c2-f8e78c745511"
]);
$this->consul->acl()->self($self);

// Update a Token
$update = new Token([
    'accessorID' => '6a1253d2-1785-24fd-91c2-f8e78c745511',
    "Description" => "Agent token for 'node1'",
    "Policies" => [],
    "local" => false
]);
$this->consul->acl()->updateToken($update);

// Clone a Token
$clone = new Token\CloneToken([
    'accessorID' => '8f246b77-f3e1-ff88-5b48-8ec93abf3e05',
    "description" => "Clone of Agent token for 'node1'",
]);
$this->consul->acl()->cloneToken($clone);

// Delete a Token
$delete = new Token([
    'AccessorID' => '8f246b77-f3e1-ff88-5b48-8ec93abf3e05'
]);
$this->consul->acl()->delete($delete);

// List Tokens
$token = new Tokens();
$this->consul->acl()->tokens($token);

Legacy Tokens

// Create ACL Token
$create = new Create([
    "Name" => "my-app-token",
    "Type" => "client",
    "rules" => "a"
]);
$this->consul->acl()->create($create);

// Update ACL Token
$update = new Update([
    "id" => "adf4238a-882b-9ddc-4a9d-5b6758e4159e",
    "Name" => "my-app-token-updated",
    "Type" => "client",
    "Rules" => "# New Rules",
]);
$this->consul->acl()->update($update);

// Delete ACL Token
$delete = new Destroy([
    'uuid' => '8f246b77-f3e1-ff88-5b48-8ec93abf3e05'
]);
$this->consul->acl()->destroy($delete);

// Read ACL Token
$info = new Info([
    'uuid' => '8f246b77-f3e1-ff88-5b48-8ec93abf3e05'
]);
$this->consul->acl()->info($info);

// Clone ACL Token
$cloneAclToken = new CloneACLToken([
    'uuid' => '8f246b77-f3e1-ff88-5b48-8ec93abf3e05'
]);
$this->consul->acl()->cloneAclToken($cloneAclToken);

// List ACLs
$getList = new Lists();
$this->consul->acl()->getList($getList);
$this->assertEquals('x','x');

Policies

// Create a Policy
$policy = new Policy([
    "Name" => "node-read",
    "Description" => "Grants read access to all node information",
    "Rules" => "node_prefix \"\" { policy = \"read\"}",
    "datacenters" => ["dc1"]
]);
$this->consul->acl()->policy($policy);

// Read a Policy
$policy = new Policy([
    'id' => 'c01a1f82-44be-41b0-a686-685fb6e0f485',
]);
$this->consul->acl()->readPolicy($policy);

// Update a Policy
$policy = new Policy([
    "ID" => "c01a1f82-44be-41b0-a686-685fb6e0f485",
    "Name" => "register-app-service",
    "Description" => "Grants write permissions necessary to register the 'app' service",
    "Rules" => "service \"app\" { policy = \"write\"}",
]);
$this->consul->acl()->updatePolicy($policy);

// Delete a Policy
$policy = new Policy([
    'id' => 'c01a1f82-44be-41b0-a686-685fb6e0f485'
]);
$this->consul->acl()->deletePolicy($policy);

// List Policies
$policies = new Policies();
$this->consul->acl()->policies($policies);

Roles

// Create a Role
$role = new Role([
    "name" => "example-role",
    "description" => "Showcases all input parameters",
]);
$this->consul->acl()->role($role);

// Read a Role
$role = new Role([
    'id' => 'aa770e5b-8b0b-7fcf-e5a1-8535fcc388b4'
]);
$this->consul->acl()->readRole($role);

// Read a Role by Name
$name = new Role([
    'name' => 'example-role'
]);
$this->consul->acl()->readRoleByName($name);

// Update a Role
$role = new Role([
    'id' => 'aa770e5b-8b0b-7fcf-e5a1-8535fcc388b4',
    "name" => "example-two",
]);
$this->consul->acl()->updateRole($role);

// Delete a Role
$role = new Role([
    'id' => 'aa770e5b-8b0b-7fcf-e5a1-8535fcc388b4'
]);
$this->consul->acl()->deleteRole($role);

// List Roles
$roles = new Roles();
$this->consul->acl()->roles($roles);

Auth Method

// Create an Auth Method
$method = new AuthMethod([
    "Name" => "minikube",
    "Type" => "kubernetes",
    "Description" => "dev minikube cluster",
    "Config" => [
        "Host" => "https://192.0.2.42:8443",
        "CACert" => "-----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----\n",
        "ServiceAccountJWT" => "eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9..."
    ]
]);
$this->consul->acl()->authMethod($method);

// Read an Auth Method
$method = new AuthMethod([
    'name' => 'minikube',
]);
$this->consul->acl()->readAuthMethod($method);

// Update an Auth Method
$method = new AuthMethod([
    "Name" => "minikube",
    "Type" => "kubernetes",
    "Description" => "dev minikube cluster",
    "Config" => [
        "Host" => "https://192.0.2.42:8443",
        "CACert" => "-----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----\n",
        "ServiceAccountJWT" => "eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9..."
    ]
]);
$this->consul->acl()->updateAuthMethod($method);

// Delete an Auth Method
$method = new AuthMethod([
    "Name" => "minikube",
]);
$this->consul->acl()->deleteAuthMethod($method);

// List Auth Methods
$method = new AuthMethods();
$this->consul->acl()->authMethods($method);

Binding Rules

// Create a Binding Rule
$bindingRule = new BindingRule([
    "description" => "example rule",
    "authMethod" => "minikube",
    "Selector" => "serviceaccount.namespace==default",
    "BindType" => "service",
    "BindName" => "{{ serviceaccount.name }}"
]);
$this->consul->acl()->bindingRule($bindingRule);

// Read a Binding Rule
$bindingRule = new BindingRule([
    'id' => '000ed53c-e2d3-e7e6-31a5-c19bc3518a3d',
]);
$this->consul->acl()->readBindingRule($bindingRule);

// Update a Binding Rule
$bindingRule = new BindingRule([
    'id' => '000ed53c-e2d3-e7e6-31a5-c19bc3518a3d',
    "Description" => "updated rule",
    "authMethod" => "minikube",
    "Selector" => "serviceaccount.namespace=dev",
    "BindType" => "role",
    "BindName" => "{{ serviceaccount.name }}",
]);
$this->consul->acl()->updateBindingRule($bindingRule);

// Delete a Binding Rule
$bindingRule = new BindingRule([
    'id' => '000ed53c-e2d3-e7e6-31a5-c19bc3518a3d',
]);
$this->consul->acl()->deleteBindingRule($bindingRule);

// List Binding Rules
$bindingRules = new BindingRules();
$this->consul->acl()->bindingRules($bindingRules);

Agent

// List Members
$this->consul->agent()->members(new Members([
    'wan' => 'a',
    'segment' => 'b',
]));

// Read Configuration
$self = new SelfParams();
$this->consul->agent()->self($self);

// Reload Agent
$reload = new Reload();
$this->consul->agent()->reload($reload);

// Enable Maintenance Mode
$maintenance = new Maintenance([
    'enable' => true,
    'reason' => 'whatever',
]);
$this->consul->agent()->maintenance($maintenance);

// View Metrics
$metrics = new Metrics([
    'format' => 'prometheus',
]);
$this->consul->agent()->metrics($metrics);

// Stream Logs
$monitor = new Monitor([
    'loglevel' => 'info',
]);
$this->consul->agent()->monitor($monitor);

// Join Agent
$join = new Join([
    'address' => '1.2.3.4',
    'wan' => false
]);
$this->consul->agent()->join($join);

// Graceful Leave and Shutdown
$leave = new Leave();
$this->consul->agent()->leave($leave);

// Force Leave and Shutdown
$forceLeave = new ForceLeave([
    'node' => 'consul'
]);
$this->consul->agent()->forceLeave($forceLeave);

// Update ACL Tokens
$token = new Token([
    'action' => 'acl_agent_token',
    'token' => 'token'
]);
$this->consul->agent()->token($token);

Checks

// List Checks
$checks = new Checks([
    'filter' => '',
]);
$this->consul->agent()->checks($checks);

// Register Check
$register = new Register([
    'name' => 'Memory_utilization', // 不可以出現空格或者其他url中不允許出現的特殊字符,否則取消注冊的check_id會報400 error
    "notes" => "Ensure we don't oversubscribe memory",
    "DeregisterCriticalServiceAfter" => "90m",
    "Args" => ["/usr/local/bin/check_mem.py"],
    "DockerContainerID" => "f972c95ebf0e",
    "Shell" => "/bin/bash",
    "HTTP" => "https://example.com",
    "Method" => "POST",
    "Header" => ["x-foo" => ["bar", "baz"]],
    "TCP" => "example.com:22",
    "Interval" => "10s",
    "TTL" => "15s",
    "TLSSkipVerify" => true,
]);
$this->consul->agent()->register($register);

// Deregister Check
$deRegister = new DeRegister([
    'check_id' => 'Memory_utilization'
]);
$this->consul->agent()->deRegister($deRegister);

// TTL Check Pass
$pass = new Pass([
    'check_id' => 'Memory_utilization',
    'note' => 'consul',
]);
$this->consul->agent()->pass($pass);

// TTL Check Warn
$warn = new Warn([
    'check_id' => 'Memory_utilization',
    'note' => 'consul',
]);
$this->consul->agent()->warn($warn);

// TTL Check Fail
$fail = new Fail([
    'check_id' => 'Memory_utilization',
    'note' => 'consul',
]);
$this->consul->agent()->fail($fail);

// TTL Check Update
$update = new Update([
    'check_id' => 'Memory_utilization',
    'Status' => 'passing',
    'Output' => 'update success'
]);
$this->consul->agent()->update($update);

Services

// List Services
$services = new Services([
    'filter' => '',
]);
$this->consul->agent()->services($services);

// Get Service Configuration
 $service = new Service([
    'service_id' => "consul"
]);
$this->consul->agent()->service($service);

// Get local service health
$name = new Name([
    'service_name' => 'consul',
    'format' => 'text',
]);
$this->consul->agent()->name($name);

// Get local service health by its ID
$id = new ID([
    'service_id' => 'consul',
    'format' => 'text',
]);
$this->consul->agent()->id($id);

// Register Service
 $register = new Service\Register([
    "ID" => "redis1",
    "name" => "redis",
    "Tags" => [
        "primary",
        "v1"
    ],
    "Address" => "127.0.0.1",
    "Port" => 8000,
    "meta" => [
        "redis_version" => "4.0",
    ],
    "EnableTagOverride" => false,
    "Check" => [
        "DeregisterCriticalServiceAfter" => "90m",
    "Args" => ["/usr/local/bin/check_redis.py"],
    "HTTP" => "http://localhost:5000/health",
    "Interval" => "10s",
    "TTL" => "15s"
    ],
    "weights" => [
        "Passing" => 10,
    "Warning" => 1
    ]
]);
$this->consul->agent()->serviceRegister($register);

// Deregister Service
$deregister = new Service\DeRegister([
    'service_id' => 'consul',
]);
$this->consul->agent()->serviceDeregister($deregister);

// Enable Maintenance Mode
$maintenance= new Service\Maintenance([
    'service_id' => 'consul',
    'enable' => true,
    'reason' => ''
]);
$this->consul->agent()->serviceMaintenance($maintenance);

Connect

// Authorize
$authorize = new Authorize([
    "target" => "db",
    "clientCertURI" => "spiffe://dc1-7e567ac2-551d-463f-8497-f78972856fc1.consul/ns/default/dc/dc1/svc/web",
    "clientCertSerial" => "04:00:00:00:00:01:15:4b:5a:c3:94"
]);
$this->consul->agent()->authorize($authorize);

// Certificate Authority (CA) Roots
$roots = new Roots();
$this->consul->agent()->roots($roots);

// Service Leaf Certificate
$leaf = new Leaf([
    'service' => 'consul'
]);
$this->consul->agent()->leaf($leaf);

Catalog

// Register Entity
$register = new Register([
    "datacenter" => "dc1",
    "id" => "40e4a748-2192-161a-0510-9bf59fe950b5",
    "node" => "foobar",
    "Address" => "192.168.10.10",
    "TaggedAddresses" => [
        "lan" => "192.168.10.10",
    "wan" => "10.0.10.10"
    ],
    "NodeMeta" => [
        "somekey" => "somevalue"
    ],
    "Service" => [
        "ID" => "redis1",
    "Service" => "redis",
    "Tags" => [
            "primary",
            "v1"
        ],
    "Address" => "127.0.0.1",
    "TaggedAddresses" => [
            "lan" => [
                "address" => "127.0.0.1",
        "port" => 8000,
      ],
      "wan" => [
                "address" => "198.18.0.1",
        "port" => 80
      ]
    ],
    "Meta" => [
            "redis_version" => "4.0"
    ],
    "Port" => 8000
    ],
    "Check" => [
        "Node" => "foobar",
    "CheckID" => "service:redis1",
    "Name" => "Redis health check",
    "Notes" => "Script based health check",
    "Status" => "passing",
    "ServiceID" => "redis1",
    "Definition" => [
            "TCP" => "localhost:8888",
      "Interval" => "5s",
      "Timeout" => "1s",
      "DeregisterCriticalServiceAfter" => "30s"
    ]
    ],
    "SkipNodeUpdate" => false
]);
$this->consul->catalog()->register($register);

// Deregister Entity
$deregister = new Deregister([
    "datacenter" => "dc1",
    "node" => "foobar",
    "CheckID" => "service:redis1",
]);
$this->consul->catalog()->deRegister($deregister);

// List Datacenters
$datacenters = new Datacenters();
$this->consul->catalog()->dataCenters($datacenters);

// List Nodes
$nodes = new Nodes([
    'dc' => 'dc1',
    'node-meta' => '',
    'near' => '',
    'filter' => '',
]);
$this->consul->catalog()->nodes($nodes);

// List Services
$nodes = new Nodes([
$services = new Services([
    'dc' => 'dc1',
    'node-meta' => '',
]);
$this->consul->catalog()->services($services);
]);
$this->consul->catalog()->nodes($nodes);

// List Nodes for Service
$services = new Services([
    'dc' => 'a',
    'node-meta' => 'b',
]);
$this->consul->catalog()->services($services);

// List Nodes for Connect-capable Service
$service = new Service([
    'service' => 'consul',
    'dc' => 'dc1',
    'tag' => '',
    'near' => '',
    'node-meta' => '',
    'filter' => '',
]);
$this->consul->catalog()->service($service);

// List Services for Node
$connect = new Connect([
    'service' => 'consul',
    'dc' => 'dc1',
    'tag' => '',
    'near' => '',
    'node-meta' => '',
    'filter' => '',
]);
$this->consul->catalog()->connect($connect);

// List Services for Node
$node = new Node([
    'node' => '2eb87046a6fe',
    'dc' => 'dc1',
    'filter' => '',
]);
$this->consul->catalog()->node($node);

Config

// Apply Configuration
$config = new \EasySwoole\Consul\Request\Config([
    'Kind' => 'service-defaults',
    'Name' => 'web',
    'Protocol' => 'Http'
]);
$this->consul->config()->config($config);

// Get Configuration
$config = new \EasySwoole\Consul\Request\Config([
    'Kind' => 'service-defaults',
    'name' => 'web',
]);
$this->consul->config()->getConfig($config);

// List Configurations
$config = new \EasySwoole\Consul\Request\Config([
    'Kind' => 'service-defaults'
]);
$this->consul->config()->listConfig($config);

// Delete Configuration
$config = new \EasySwoole\Consul\Request\Config([
    'Kind' => 'service-defaults',
    'name' => 'web',
]);
$this->consul->config()->deleteConfig($config);

Connect

Certificate Authority (CA)

// List CA Root Certificates
$roots = new Roots();
$this->consul->connect()->roots($roots);

// Get CA Configuration
$configuration = new Configuration();
$this->consul->connect()->configuration($configuration);

// Update CA Configuration
$configuration = new Configuration([
    'Provider' => 'consul',
    'Config' => [
        'LeafCertTTL' => '72h'
    ]
]);
$this->consul->connect()->updateConfiguration($configuration);

Intentions

// Create Intention
$intentions = new Intentions([
    'SourceName' => 'web',
    'DestinationName' => 'db',
    'SourceType' => 'consul',
    'action' => 'allow'
]);
$this->consul->connect()->intentions($intentions);

// Read Specific Intention
$intentions = new Intentions([
    'uuid' => 'e9ebc19f-d481-42b1-4871-4d298d3acd5c',
]);
$this->consul->connect()->readIntention($intentions);

// List Intentions
$intentions = new Intentions();
$this->consul->connect()->listIntention($intentions);

// Update Intention
$intentions = new Intentions([
    'uuid' => 'b40faaf3-34aa-349f-3cf2-f5d720240662',
    'description' => 'just a test description',
    'SourceName' => '',
    'DestinationName' => '',
    'Action' => 'allow'
]);
$this->consul->connect()->updateIntention($intentions);

// Delete Intention
$intentions = new Intentions([
    'uuid' => 'b40faaf3-34aa-349f-3cf2-f5d720240662',
]);
$this->consul->connect()->deleteIntention($intentions);

// Check Intention Result
$intentions = new Intentions\Check([
    'source' => 'web',
    'destination' => 'db',
]);
$this->consul->connect()->check($intentions);

// List Matching Intentions
$intentions = new Intentions\Match([
    'by' => 'source',
    'name' => 'web',
]);
$this->consul->connect()->match($intentions);

Coordinate

// Read WAN Coordinates
$datacenters = new Datacenters();
$this->consul->coordinates()->datacenters($datacenters);

// Read LAN Coordinates for all nodes
$nodes = new Nodes([]);
$this->consul->coordinates()->nodes($nodes);

// Read LAN Coordinates for a node
$node = new Node([
    'node' => '2456c2850382',
]);
$this->consul->coordinates()->node($node);

// Update LAN Coordinates for a node
$update = new Update([
    'dc' => 'dc1',
    'node' => '2456c2850382',
    'Segment' => 'update',
    "Coord" => [
        "Adjustment" => 0,
        "Error" => 1.5,
        "Height" => 0,
        "Vec" => [0, 0, 0, 0, 0, 0, 0, 0]
    ]
]);
$this->consul->coordinates()->update($update);

Events

// Fire Event
$fire = new Fire([
    'name' => 'consul',
    'dc' => 'dc1',
]);
$this->consul->event()->fire($fire);

// List Events
$listEvent = new ListEvent([
    'name' => 'consul',
]);
$this->consul->event()->listEvent($listEvent);

Health

// List Checks for Node
$node = new Node([
    'node' => '2456c2850382',
    'dc' => 'dc1',
]);
$this->consul->health()->node($node);

// List Checks for Service
$checks = new Checks([
   'service' => 'consul',
   'node_meta' => 'node-meta',
]);
$this->consul->health()->checks($checks);

// List Nodes for Service
$service = new Service([
    'service' => 'consul',
    'dc' => 'dc1',
]);
$this->consul->health()->service($service);

// List Nodes for Connect-capable Service
$connect = new Connect([
    'service' => 'consul'
]);
$this->consul->health()->connect($connect);

// List Checks in State
$state = new State([
    'state' => 'passing'
]);
$this->consul->health()->state($state);

KV Store

// Read Key
$kv = new Kv([
    'key' => 'my-key',
    'dc' => 'dc1',
]);
$this->consul->kvStore()->kv($kv);

// Create Key
$create = new kv([
    'key' => 'my-key',
    'dc' => 'dc1',
]);
$this->consul->kvStore()->create($create);

// Update Key
$update = new kv([
    'key' => 'my-key',
    'dc' => 'dc1',
]);
$this->consul->kvStore()->update($update);

// Delete Key
$delete = new Kv([
    'key' => 'my-key',
    'recurse' => false,
]);
$this->consul->kvStore()->delete($delete);

Operator

Area

// Create Network Area
$area = new Area([
    'PeerDatacenter' => 'dc1',
    "RetryJoin" => [ "10.1.2.3", "10.1.2.4", "10.1.2.5" ],
    "UseTLS" => false
]);
$this->consul->operator()->area($area);

// List Network Areas
$area = new Area([
    'dc' => 'dc1',
    'uuid' => '10275a2e-aa8f-2cf3-0adf-ff03d8950902',
]);
$this->consul->operator()->areaList($area);

// List Specific Network Area
$area = new Area([
    'dc' => 'dc1',
    'uuid' => '10275a2e-aa8f-2cf3-0adf-ff03d8950902',
]);
$this->consul->operator()->areaList($area);

// Update Network Area
$area = new Area([
    'uuid' => '10275a2e-aa8f-2cf3-0adf-ff03d8950902',
    'UseTLS' => true,
    'dc' => 'dc1',
]);
$this->consul->operator()->updateArea($area);

// Delete Network Area
$area = new Area([
    'uuid' => '10275a2e-aa8f-2cf3-0adf-ff03d8950902',
]);
$this->consul->operator()->deleteArea($area);

// Join Network Area
$area = new Area([
    'uuid' => '10275a2e-aa8f-2cf3-0adf-ff03d8950902',
]);
$this->consul->operator()->joinArea($area);

// List Network Area Members
$area = new Area([
    'uuid' => '10275a2e-aa8f-2cf3-0adf-ff03d8950902'
]);
$this->consul->operator()->membersArea($area);

Autopilot

// Read Configuration
$configuration = new Configuration([
    'dc' => 'dc1',
    'stale' => true,
]);
$this->consul->operator()->getConfiguration($configuration);

// Update Configuration
$configuration = new Configuration([
    'dc' => 'dc1',
    'stale' => true,
    "cleanupDeadServers" => true,
    "lastContactThreshold" => "200ms",
    "MaxTrailingLogs" => 250,
    "ServerStabilizationTime" => "10s",
    "RedundancyZoneTag" => "",
    "DisableUpgradeMigration" => false,
    "UpgradeVersionTag" => "",

]);
$this->consul->operator()->updateConfiguration($configuration);

// Read Health
$health = new Health([
    'dc' => 'dc1',
]);
$this->consul->operator()->health($health);

Keyring

// List Gossip Encryption Keys
$keyring = new Keyring();
$keyring->setRelayFactor(0);
$keyring->setLocalOnly(false);
$this->consul->operator()->getKeyring($keyring);

// Add New Gossip Encryption Key
$keyring = new Keyring([
    "Key" => "3lg9DxVfKNzI8O+IQ5Ek+Q==",
    'relayFactor' => 1,
]);
$this->consul->operator()->addKeyring($keyring);

// Change Primary Gossip Encryption Key
$keyring = new Keyring([
    "Key" => "3lg9DxVfKNzI8O+IQ5Ek+Q==",
]);
$this->consul->operator()->changeKeyring($keyring);

// Delete Gossip Encryption Key
$keyring = new Keyring([
    "Key" => "3lg9DxVfKNzI8O+IQ5Ek+Q==",
    "relayFactor" => 1
]);
$this->consul->operator()->deleteKeyring($keyring);

License

// Getting the Consul License
$license = new License([
    'dc' => 'dc1',
]);
$this->consul->operator()->getLicense($license);

// Updating the Consul License
$license = new License([
    'dc' => 'dc1'
]);
$this->consul->operator()->updateLicense($license);

// Resetting the Consul License
$license = new License([
    'dc' => 'dc1'
]);
$this->consul->operator()->resetLicense($license);

Raft

// Read Configuration
$raft = new \EasySwoole\Consul\Request\Operator\Raft\Configuration();
$this->consul->operator()->getRaftConfiguration($raft);

// Delete Raft Peer
$peer = new Peer([
    'address' => '172.17.0.18:8301',
    'dc' => 'dc1',
]);
$this->consul->operator()->peer($peer);

Segment

// List Network Segments
$segment = new Segment();
$this->consul->operator()->segment($segment);

Prepared Query

// Create Prepared Query
$query = new Query([
    "name" => "my-query",
    "Session" => "adf4238a-882b-9ddc-4a9d-5b6758e4159e",
    "Token" => "11",
    "Service" => [
        "Service" => "redis",
        "Failover" => [
            "NearestN" => 3,
            "Datacenters" => ["dc1", "dc2"]
         ],
        "Near" => "node1",
        "OnlyPassing" => false,
        "Tags" => ["primary", "!experimental"],
        "NodeMeta" => ["instance_type" => "m3.large"],
        "ServiceMeta" => ["environment" => "production"]
    ],
    "DNS" => [
        "TTL" => "10s"
    ],
]);
$this->consul->query()->query($query);

// Read Prepared Query
$query = new Query([
    'dc' => 'dc1'
]);
$this->consul->query()->readQuery($query);

// Update Prepared Query
$query = new Query([
    'uuid' => '90dce5ca-5697-ae2f-09ae-51e9542ea58c',
    'dc' => 'dc1',
]);
$this->consul->query()->updateQuery($query);;

// Read Prepared Query
$query = new Query([
    'dc' => 'dc1'
]);
$this->consul->query()->readQuery($query);

// Delete Prepared Query
$query = new Query([
    'uuid' => '90dce5ca-5697-ae2f-09ae-51e9542ea58c'
]);
$this->consul->query()->deleteQuery($query);;

// Execute Prepared Query
$execute = new Query\Execute([
    'uuid' => '90dce5ca-5697-ae2f-09ae-51e9542ea58c',
    'dc' => 'dc1',
]);
$this->consul->query()->execute($execute);

// Explain Prepared Query
$execute = new Query\Explain([
    'uuid' => '90dce5ca-5697-ae2f-09ae-51e9542ea58c',
    'dc' => 'dc1',
]);
$this->consul->query()->explain($execute);

Sessions

// Create Session
$create = new Create([
    'dc' => 'dc1',
    "LockDelay" => "15s",
    "Name" => "my-service-lock",
    "Node" => "foobar",
    "Checks" => ["a", "b", "c"],
    "Behavior" => "release",
    "TTL" => "30s",
]);
$this->consul->session()->create($create);

// Delete Session
$destroy = new Destroy([
    'uuid' => 'f32a15b3-1baa-c047-bde9-bec3015ea013',
    'dc' => 'dc1',
]);
$this->consul->session()->destroy($destroy);

// Read Session
$info = new Info([
    'uuid' => 'f32a15b3-1baa-c047-bde9-bec3015ea013',
    'dc' => 'dc1',
]);
$this->consul->session()->info($info);

// List Sessions for Node
$node = new Node([
    'node' => '2456c2850382',
    'dc' => 'dc1',
]);
$this->consul->session()->node($node);

// List Sessions
$sessionList = new SessionList([
    'dc' => 'dc1'
]);
$this->consul->session()->sessionList($sessionList);

// Renew Session
$renew = new Renew([
    'uuid' => '4f6d1cf6-b60a-c929-eeb8-12f4d7eaff62',
    'dc' => 'dc1'
]);
$this->consul->session()->renew($renew);

Snapshots

// Generate Snapshot
$generate = new Snapshot([
    'dc' => 'dc1',
    'stale' => 'true',
]);
$this->consul->snapshot()->generate($generate);

// Restore Snapshot
$restore = new Snapshot();
$this->consul->snapshot()->restore($restore);

Status

// Get Raft Leader
$leader = new Leader();
$this->consul->status()->leader($leader);

// List Raft Peers
$peers = new Peers([
    'dc' => 'dc1',
]);
$this->consul->status()->peers($peers);

Transactions

// Create Transaction
$transaction = new Txn([]);
$this->consul->transaction()->create($transaction);
$node = new Node([
    'node' => '44e4656a94cd',
    'dc' => 'dc1',
    'filter' => '',
]);
$consul->catalog()->node($node);
主站蜘蛛池模板: 亚洲热av | 麻豆网址 | 野狼在线社区2017入口 | www欧美| 中国女人黄色大片 | 天天干一干 | 亚洲xx视频 | 中文字幕av第一页 | 天堂久久一区 | 欧美中文字幕在线 | 日韩久久网站 | 成人免费aaa | 北条麻妃一区二区三区中文字幕 | 欧美.com | 成人欧美一区二区三区黑人孕妇 | 日韩免费一区二区 | 成人欧美一区二区三区在线播放 | 狠狠操夜夜操 | 精品久久一区二区三区 | 狠狠草视频 | 久久久91精品国产一区二区精品 | 国产精品免费观看 | 欧美精品福利视频 | 在线国产视频 | 久草在线高清 | 美女视频黄又黄又免费 | 精品久久久久国产免费 | 日韩高清一区 | 亚洲精品久久久久久下一站 | 久久精品二区 | 麻豆精品一区二区 | 91久久91久久精品免观看 | 欧美日韩午夜精品 | 精品国产伦一区二区三区观看说明 | 欧美精品一区二区三区四区五区 | 国产高清一区二区三区 | 国产女无套免费网站 | 欧美日韩在线观看视频 | 中文字幕欧美在线观看 | 日韩色综合| 在线日韩欧美 | 国产午夜精品久久久久久久 | 国产精品久久 | 一区二区三区四区在线播放 | 亚洲欧美aa| 国产三级| 91一区在线 | 色网在线 | 日韩欧美综合 | 亚洲一区中文字幕 | 精品国产一区二区 | 日本在线观看网站 | 欧美激情综合五月色丁香小说 | 亚洲国产二区 | 日韩无在线 | www.久久.com| 精品久久ai | 精品www| 在线视频这里只有精品 | 精品久久久久久久人人人人传媒 | 一区二区中文字幕 | 婷婷精品视频 | www国产亚洲精品久久网站 | 精品久久久久久久久久久久久久 | 欧美日韩在线观看一区二区 | 日韩一区二区三区在线观看 | 国产精品三级久久久久久电影 | 欧美日韩高清在线一区 | 2019国产精品 | 亚洲国产高清在线 | 91hd精品少妇 | 亚洲精品乱码 | 午夜影院在线 | 91精品国产综合久久久久久蜜月 | 欧洲美女7788成人免费视频 | 欧美日韩精品一区二区三区蜜桃 | 一区二区三区回区在观看免费视频 | 香蕉在线影院 | 亚洲精品乱码久久久久久蜜桃91 | 不卡一区二区三区四区 | 久久久久久1 | 久久精品久久久 | 精品在线不卡 | 久草在线高清 | 久久视频一区 | 永久91嫩草亚洲精品人人 | 日韩免费一级 | 精品一区二区三区免费视频 | 日韩欧美在线观看一区二区 | 精品国产乱码久久久久久密桃99 | 欧美中文字幕在线 | 精品国产乱码久久久久久久软件 | 亚洲精品一区二区三区不 | 一区二区不卡视频 | 欧美一级日韩 | 日韩欧美在线视频 | 亚洲精品乱码8久久久久久日本 | 伊人久久综合 | 色婷婷在线播放 | 亚洲视频在线免费观看 | 丝袜久久| 亚洲中出| www.日韩| 久热99| 国产精品国产精品国产 | av在线精品 | 国产成人精品一区二区三区四区 | 欧美久久久久久 | 中文字幕亚洲一区二区va在线 | 美女黄网| 一级做a爰片性色毛片 | 国产日韩欧美一区 | 久久久99国产精品免费 | 午夜精品网站 | 欧美一区免费 | 亚洲国产精品久久久久 | 91精品国产99久久久 | 91久久艹| 亚洲人成人一区二区在线观看 | 手机看片国产精品 | 久久国内精品 | 亚洲xx站 | 欧美精品一区三区 | 亚洲国产精品99久久久久久久久 | 国产精品久久久久久久久免费 | 亚洲一区二区在线视频 | 无码国模国产在线观看 | 久久夜精 | 成人欧美一区二区三区在线播放 | 国产精品一任线免费观看 | 日韩一区中文字幕 | 日韩成人av在线 | 丁香婷婷久久久综合精品国产 | 国产日韩欧美高清 | 国产网站在线 | 久久久久久久av | 亚洲视频一区在线播放 | m豆传媒在线链接观看 | 91丨九色丨国产 | 欧洲一区二区三区 | 国内精品一区二区 | 免费观看一级视频 | 国产不卡在线 | 91久久精品一区二区三区 | 久草新免费 | 日韩一区二区三区精品 | 亚洲永久| 精品www | 色播开心网 | 亚洲人成人一区二区在线观看 | 99久久婷婷国产精品综合 | 日韩欧美国产电影 | 国产精品亚洲一区二区三区在线 | 久久人人爽人人爽人人片av高清 | 欧美亚洲一区 | 美女在线视频一区二区 | 黄色直接看 | 欧美大片一区二区 | 精品国偷自产国产一区 | 国产精品久久久久久亚洲调教 | 99re视频 | 99久久免费精品国产男女性高好 | 日韩久久久久久 | 欧美日一区二区 | 97色综合 | 色毛片| 欧美日韩国产免费一区二区三区 | 国产中文字幕一区 | 日日干夜夜干 | 91亚洲国产 | 国产成人涩涩涩视频在线观看 | 超碰在线看 | 免费在线精品视频 | 一级视频在线观看 | 亚洲无吗电影 | 超级黄色一级片 | 色综合99 | 中文字幕亚洲综合久久久软件 | 另类免费视频 | 欧美99热| 国产日韩精品入口 | 日本中文字幕视频 | 国产综合精品 | 天天射天天 | 91视频免费看 | 国产精品无码永久免费888 | 亚洲免费色 | 成年人精品视频在线观看 | 国产91久久精品一区二区 | 经典法国性xxxx精品 | 日本不卡一区 | 精品一区二区在线观看 | 1级毛片 | 国产a√ | 亚洲第一成年免费网站 | 国产午夜小视频 | 国产亚洲精品久久久久久青梅 | 久久青 | 国产精品福利视频 | 欧美精品成人一区二区三区四区 | 欧美一级免费高清 | 日韩极品视频 | 日韩精品免费看 | 黑人性dh | 亚洲色图3p | 欧洲妇女成人淫片aaa视频 | 久久精品视频亚洲 | 亚洲第一福利视频 | 一区二区三区免费 | 亚洲一级黄色 | 精品一区二区三区四区 | 亚洲永久免费 | 亚洲激情久久 | 精品人人 | 久久久久久国产精品 | 在线观看免费视频黄 | av片免费看 | 久久国产精品久久 | 中文字幕亚洲欧美 | 4h影视| 成人免费高清视频 | 欧美日韩精品电影 | 在线观看成人高清 | 精品免费视频 | 最新午夜 | 黄色片视频在线观看 | 免费视频一区二区三区在线观看 | 国产亚洲欧美精品永久 | 欧美一区永久视频免费观看 | 免费黄色小视频 | 欧美一区二区免费 | 日本三级网站在线观看 | 69热在线观看 | 免费成人av在线 | 欧日韩免费视频 | 国产又粗又长又硬又猛电影 | 国产精品久久久久久久久免费桃花 | 懂色中文一区二区在线播放 | 亚洲欧美日韩在线 | 成人高清视频在线观看 | 欧美成人激情 | 精品伊人 | 天天久久婷婷 | 美女视频一区二区三区 | 久久久久无码国产精品一区 | 亚洲精品视频在线观看免费视频 | 好姑娘影视在线观看高清 | 国产二区视频 | 九色视频网站 | 国产一区二区在线播放 | 99这里只有精品视频 | 福利视频一区 | xxxx免费视频| 天天操网 | 亚洲性人人天天夜夜摸 | 国产成人综合在线 | 男人天堂视频网 | 黄色在线观看 | 国产一区二区三区色淫影院 | 一区在线视频 | 国产精品免费一区二区三区四区 | 最近免费中文字幕大全免费版视频 | 国产精品99在线观看 | 精品一级 | 婷婷综合一区 | 蜜桃av一区二区三区 | 亚洲欧美中文字幕 | av黄在线观看 | av一二| 国产欧美久久久久久 | 精品久久久av| 亚欧毛片 | 国产精品永久免费 | 久久se精品一区精品二区 | 欧美日韩中文 | 成人久久18免费网站图片 | 中文字幕 亚洲一区 | 久久精品二区 | 一区二区三区免费视频网站 | 蜜臀网| 欧美一区二区三区在线视频 | 精品久久一区二区三区 | 中文字幕第66页 | 天堂在线中文字幕 | 中文字幕久久精品 | 成人永久免费视频 | 一区二区三区视频在线免费观看 | 国产一区二区视频在线观看 | 国产精品丝袜一区二区 | 夜夜操av | 亚洲欧洲日韩 | av在线一区二区 | 欧美成人一区二区 | 亚洲视频一区二区三区 | 在线免费观看一区 | 免费xxxx大片国产在线 | 欧美日本免费一区二区三区 | 日韩精品一区二区三区在线观看 | 日韩精品一区二区三区四区视频 | 久久国产精品毛片 | 一本岛在线视频 | 亚洲精品久久久久久下一站 | 成年网站视频 | 一区二区三区免费 | 国产成人精品综合 | 成人一区二区三区久久精品嫩草 | 国产黄色大片免费看 | 网址av| 啵啵影院午夜男人免费视频 | 日本久久久影视 | 亚洲网在线| ririsao亚洲国产中文 | 免费精品视频 | 欧洲亚洲精品久久久久 | 久久久久久久91 | 欧美性大战久久久久久久蜜臀 | 国产在线二区 | 国内福利视频 | 午夜精品成人一区二区 | av在线播放免费 | 中文字幕国产视频 | 久草免费在线视频 | 伊人网综合在线 | 中文字幕观看 | 国产免费观看一区二区三区 | 国产欧美精品区一区二区三区 | 操人网址 | 日韩国产欧美一区 | 亚洲免费一区二区 | 亚洲在线视频 | 国产精品久久久久久久一区探花 | 91.成人天堂一区 | 国产精品一区二区在线 | 91日韩精品一区二区三区 | 亚洲综合视频 | 中文字幕av在线播放 | 蜜桃色网| 成年人在线视频播放 | 日韩一区二区不卡 | 日韩中文一区二区三区 | 日韩一区三区 | 福利91| 99免费视频 | 成人精品一区二区三区中文字幕 | 亚洲高清视频在线观看 | 久久免费视频网 | 夜夜草视频| 综合五月| 精品欧美一区二区三区久久久 | 免费视频一区二区 | 国产一区二区免费 | www.久久99 | 午夜视频在线播放 | 一区二区在线免费观看 | 国产精品成人国产乱一区 | 亚洲精品一区在线观看 | 国产精品jizz在线观看麻豆 | 欧洲精品在线观看 | 91久久综合亚洲鲁鲁五月天 | 久久视频在线 | 国产婷婷在线观看 | 亚洲一区二区国产 | 成人免费视频网站在线观看 | 黑人粗黑大躁护士 | 欧美午夜一区二区三区免费大片 | 亚洲福利精品视频 | 99精品视频在线 | 久久综合一区二区三区 | 成人免费精品视频 | 亚洲精品一| 欧美日韩在线看 | 亚洲视频自拍 | 91亚洲成人 | 1区2区3区视频 | 精品久久久久久国产 | 国产精品极品美女在线观看免费 | 91高清在线 | 先锋av资源网 | 日韩成人在线视频 | 日本一区二区高清视频 | 欧美二区精品 | 色噜噜狠狠狠综合曰曰曰88av | 性高湖久久久久久久久aaaaa | 久久久久久久久99精品 | www.久久久久久久久久久久 | 日韩久久一区二区 | 久操不卡| 美女午夜影院 | 丝袜久久 | 狠狠操夜夜爱 | 黄色片在线免费观看 | 超碰3| 色九九| 在线视频亚洲 | 黄免费视频 | 久久精品二区 | 久久久精品综合 | 国产成人精品免高潮在线观看 | 日韩视频在线观看一区 | 亚洲国产精品一区二区久久 | 国产91成人在在线播放 | 午夜精品久久久久久 | 成人在线免费观看 | 色婷婷亚洲一区二区三区 | 国产一区二区影院 | 在线91| 国产精品久久99 | 欧美一级视频在线观看 | 一级黄色片视频 | 羞羞视频在线播放 | 国产成人精品一区二区三区网站观看 | 嫩呦国产一区二区三区av | 国产精品色综合 | 日韩一区二区在线播放 | 久久99精品久久久久久久青青日本 | 亚洲精品一区二区三区麻豆 | 久久精品一区二区国产 | 国产成人一级毛片 | 99热播在线 | 国产精品久久久久久婷婷天堂 | 亚洲一区二区三区中文字幕 | 日韩1 | 成人在线视频一区 | 国产乱视频网站 | 99免费视频| 91在线观看视频 | 国产高清久久久 | 免费一看一级毛片 | 国产浪潮av色综合久久超碰 | 欧美嘿咻 | 久久一 | 精品国产一区二区三区不卡蜜臂 | 欧美一级高清在线 | 最新午夜综合福利视频 | 日韩一区二区三区在线视频 | 日韩欧在线 | 久久精品亚洲欧美日韩精品中文字幕 | 亚洲精品1 | 国产精品国产精品国产专区不卡 | 国产欧美精品一区二区三区 | 久久综合爱 | 日日做夜夜爽毛片麻豆 | 久久久av | 91亚洲高清 | 午夜精品久久久久久久久久久久久 | 久草 在线| 免费看国产一级特黄aaaa大片 | 色九九 | 一级片在线观看免费 | 国产成人一区二区三区 | 不卡欧美 | 午夜影院a| 99精品欧美一区二区三区综合在线 | 一区免费视频 | 亚洲男人网 | 四虎影院在线 | 日韩三及片 | 亚洲成人国产精品 | 久在线视频 | 午夜电影网址 | 香蕉久久久久久 | 久久亚洲综合 | 在线成人国产 | 亚洲高清精品视频 | 日韩精品一区二区三区中文在线 | 成人免费福利视频 | 日本欧美久久久久免费播放网 | 91久久久久 | 少妇久久久| 国产午夜视频 | 亚洲视频免费在线观看 | 国产精品自产拍在线观看桃花 | 久久1区 | 午夜一区二区三区 | 午夜私人影院 | 成人av教育 | 亚洲免费精品 | 国产精品久久久久一区二区三区 | 午夜精品久久久久久久久久久久 | 欧美日本一区 | 国产一区二区观看 | 永久av | 国产视频一区二区三区四区 | 国产精品69久久久久水密桃 | 精品免费视频 | 中文字幕一区二区三区在线视频 | 久久综合久久久 | 亚洲乱码在线 | 国产亚洲精品成人av久久ww | 中文字幕第一页在线 | 青青草网站 | 日韩国产一区 | 精品久久中文字幕 | www.avtt天堂网 | 久久久久国产成人精品亚洲午夜 | 国产成人精品高清久久 | 狠狠色狠狠色合久久伊人 | 日韩中文字幕免费视频 | 色婷网| 嫩呦国产一区二区三区av | 国产女精品| 午夜不卡视频 | 精品欧美乱码久久久久久1区2区 | 日韩一区二区三区精品 | 污污视频免费网站 | 不卡视频一区 | 日韩欧美一区二区视频 | 中文字幕一区二区三区免费视频 | 91夜夜操| 女人夜夜春高潮爽a∨片传媒 | 国产精品日产欧美久久久久 | 国产精品欧美日韩在线观看 | 中文字幕高清视频 | 久草视频在线播放 | 自拍偷拍视频网 | 国产精品人人做人人爽人人添 | 欧美 日韩 国产 一区 | 日韩2020狼一二三 | 欧美精品在线免费观看 | 欧美精品色网 | 久久久久国产一级毛片高清版小说 | 国产一二三区在线观看 | 在线国产一区 | 一级黄色片看看 | av黄色在线免费观看 | av在线毛片 | 国外成人在线视频网站 | 亚洲网站色| 亚洲品质自拍视频网站 | 久久国产日韩 | 欧美国产日韩一区 | 国产一级毛片在线视频 | 精品亚洲视频在线 | 精品亚洲成a人在线观看 | 四虎永久 | 欧美精品免费在线观看 | 国产精品久久av | 日韩精品一区二区三区在线播放 | 久久久免费精品 | 国产欧美综合一区二区三区 | 国产精品久久久久久久久久久久久久 | 男人的天堂久久 | 国产剧情一区二区 | 最新黄色网址在线播放 | 国产免费一区二区三区 | 久久久久久9 | 九九热欧美 | 99亚洲视频 | 亚洲成人首页 | 亚洲国产精品一区 | 操夜夜| 亚洲欧洲一区二区 | 久久丝袜| 日韩视频精品在线 | 97视频在线免费观看 | 欧美成人一区二区三区 | 天天操妹子 | 亚洲深深色噜噜狠狠网站 | 91在线观看视频 | 亚洲精品一区二三区不卡 | 免费视频一区 | 国产99久久精品 | 在线国产91 | 国产精品成人品 | h片在线免费观看 | 一区二区三区视频在线观看 | 伊人久久精品久久亚洲一区 | 国产综合视频在线播放 | 欧美性猛交一区二区三区精品 | 成人一区二区三区 | 一级片黄片毛片 | 久久午夜电影 | 欧美日韩国产综合视频 | 羞羞视频网站在线看 | 一区二区三区视频 | 成人黄页在线观看 | 在线第一页| 欧美激情综合五月色丁香小说 | 天天操天天添 | 日韩欧美精品在线 | 国产精品自拍视频 | 亚洲成av人片在线观看 | 国内成人精品2018免费看 | 国产精品二区三区 | 国产成人天天爽高清视频 | 亚洲欧洲在线观看 | 国产精品国产精品 | 国产精品一卡二卡三卡 | 久久久久久av | 国产视频一区二区 | 国产一区2区 | 欧美成人精品一区 | 免费福利网站 | 日韩精品免费在线视频 | 欧美日韩亚洲国产综合 | 亚洲精品乱码久久久久久国产主播 | 国产一区二区黑人欧美xxxx | 久久久精品影院 | 国产美女中出 | 亚洲国产精品久久 | 久久久久久久久久久久91 | 中文字幕在线免费视频 | 在线观看欧美成人 | 黄色日本视频 | 品久久久久久久久久96高清 | 免费成人av| 99热在线播放 | 色女人的天堂 | 成人av综合 | 国产精品久久久久久吹潮 | 久久久亚洲精品中文字幕 | h片免费观看 | 久久九九国产精品 | 97国产精品 | 天天视频成人 |