Class: SDM::SecretStores
- Inherits:
-
Object
- Object
- SDM::SecretStores
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
SecretStores are servers where resource secrets (passwords, keys) are stored.
See: AWSStore AzureStore CyberarkConjurStore CyberarkPAMStore CyberarkPAMExperimentalStore DelineaStore GCPStore VaultAppRoleStore VaultTLSStore VaultTokenStore
Instance Method Summary collapse
- #create(secret_store, deadline: nil) ⇒ Object
-
#delete(id, deadline: nil) ⇒ Object
Delete removes a SecretStore by ID.
-
#get(id, deadline: nil) ⇒ Object
Get reads one SecretStore by ID.
-
#initialize(channel, parent) ⇒ SecretStores
constructor
A new instance of SecretStores.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of SecretStores matching a given set of criteria.
-
#update(secret_store, deadline: nil) ⇒ Object
Update replaces all the fields of a SecretStore by ID.
Constructor Details
#initialize(channel, parent) ⇒ SecretStores
1468 1469 1470 1471 1472 1473 1474 1475 |
# File 'lib/svc.rb', line 1468 def initialize(channel, parent) begin @stub = V1::SecretStores::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(secret_store, deadline: nil) ⇒ Object
1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 |
# File 'lib/svc.rb', line 1477 def create( secret_store, deadline: nil ) req = V1::SecretStoreCreateRequest.new() req.secret_store = Plumbing::convert_secret_store_to_plumbing(secret_store) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("SecretStores.Create", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = SecretStoreCreateResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.secret_store = Plumbing::convert_secret_store_to_porcelain(plumbing_response.secret_store) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete removes a SecretStore by ID.
1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 |
# File 'lib/svc.rb', line 1567 def delete( id, deadline: nil ) req = V1::SecretStoreDeleteRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("SecretStores.Delete", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = SecretStoreDeleteResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one SecretStore by ID.
1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 |
# File 'lib/svc.rb', line 1507 def get( id, deadline: nil ) req = V1::SecretStoreGetRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get(req, metadata: @parent.("SecretStores.Get", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = SecretStoreGetResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.secret_store = Plumbing::convert_secret_store_to_porcelain(plumbing_response.secret_store) resp end |
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of SecretStores matching a given set of criteria.
1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 |
# File 'lib/svc.rb', line 1596 def list( filter, *args, deadline: nil ) req = V1::SecretStoreListRequest.new() req. = V1::ListRequestMetadata.new() page_size_option = @parent.["PageSize"] if page_size_option.is_a? Integer req..limit = page_size_option end req.filter = Plumbing::quote_filter_args(filter, *args) resp = Enumerator::Generator.new { |g| tries = 0 loop do begin plumbing_response = @stub.list(req, metadata: @parent.("SecretStores.List", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end tries = 0 plumbing_response.secret_stores.each do |plumbing_item| g.yield Plumbing::convert_secret_store_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |
#update(secret_store, deadline: nil) ⇒ Object
Update replaces all the fields of a SecretStore by ID.
1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 |
# File 'lib/svc.rb', line 1537 def update( secret_store, deadline: nil ) req = V1::SecretStoreUpdateRequest.new() req.secret_store = Plumbing::convert_secret_store_to_plumbing(secret_store) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.update(req, metadata: @parent.("SecretStores.Update", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = SecretStoreUpdateResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.secret_store = Plumbing::convert_secret_store_to_porcelain(plumbing_response.secret_store) resp end |