Skip to content

Latest commit

 

History

History
362 lines (236 loc) · 10.8 KB

PoliciesApi.md

File metadata and controls

362 lines (236 loc) · 10.8 KB

\PoliciesApi

All URIs are relative to http://localhost/nifi-api

Method HTTP request Description
CreateAccessPolicy Post /policies Creates an access policy
GetAccessPolicy Get /policies/{id} Gets an access policy
GetAccessPolicyForResource Get /policies/{action}/{resource} Gets an access policy for the specified action and resource
RemoveAccessPolicy Delete /policies/{id} Deletes an access policy
UpdateAccessPolicy Put /policies/{id} Updates a access policy

CreateAccessPolicy

AccessPolicyEntity CreateAccessPolicy(ctx).Body(body).Execute()

Creates an access policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    body := *openapiclient.NewAccessPolicyEntity() // AccessPolicyEntity | The access policy configuration details.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.PoliciesApi.CreateAccessPolicy(context.Background()).Body(body).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PoliciesApi.CreateAccessPolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateAccessPolicy`: AccessPolicyEntity
    fmt.Fprintf(os.Stdout, "Response from `PoliciesApi.CreateAccessPolicy`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateAccessPolicyRequest struct via the builder pattern

Name Type Description Notes
body AccessPolicyEntity The access policy configuration details.

Return type

AccessPolicyEntity

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAccessPolicy

AccessPolicyEntity GetAccessPolicy(ctx, id).Execute()

Gets an access policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The access policy id.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.PoliciesApi.GetAccessPolicy(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PoliciesApi.GetAccessPolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetAccessPolicy`: AccessPolicyEntity
    fmt.Fprintf(os.Stdout, "Response from `PoliciesApi.GetAccessPolicy`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The access policy id.

Other Parameters

Other parameters are passed through a pointer to a apiGetAccessPolicyRequest struct via the builder pattern

Name Type Description Notes

Return type

AccessPolicyEntity

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAccessPolicyForResource

AccessPolicyEntity GetAccessPolicyForResource(ctx, action, resource).Execute()

Gets an access policy for the specified action and resource

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    action := "action_example" // string | The request action.
    resource := "resource_example" // string | The resource of the policy.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.PoliciesApi.GetAccessPolicyForResource(context.Background(), action, resource).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PoliciesApi.GetAccessPolicyForResource``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetAccessPolicyForResource`: AccessPolicyEntity
    fmt.Fprintf(os.Stdout, "Response from `PoliciesApi.GetAccessPolicyForResource`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
action string The request action.
resource string The resource of the policy.

Other Parameters

Other parameters are passed through a pointer to a apiGetAccessPolicyForResourceRequest struct via the builder pattern

Name Type Description Notes

Return type

AccessPolicyEntity

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RemoveAccessPolicy

AccessPolicyEntity RemoveAccessPolicy(ctx, id).Version(version).ClientId(clientId).DisconnectedNodeAcknowledged(disconnectedNodeAcknowledged).Execute()

Deletes an access policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The access policy id.
    version := "version_example" // string | The revision is used to verify the client is working with the latest version of the flow. (optional)
    clientId := "clientId_example" // string | If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response. (optional)
    disconnectedNodeAcknowledged := true // bool | Acknowledges that this node is disconnected to allow for mutable requests to proceed. (optional) (default to false)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.PoliciesApi.RemoveAccessPolicy(context.Background(), id).Version(version).ClientId(clientId).DisconnectedNodeAcknowledged(disconnectedNodeAcknowledged).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PoliciesApi.RemoveAccessPolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `RemoveAccessPolicy`: AccessPolicyEntity
    fmt.Fprintf(os.Stdout, "Response from `PoliciesApi.RemoveAccessPolicy`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The access policy id.

Other Parameters

Other parameters are passed through a pointer to a apiRemoveAccessPolicyRequest struct via the builder pattern

Name Type Description Notes

version | string | The revision is used to verify the client is working with the latest version of the flow. | clientId | string | If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response. | disconnectedNodeAcknowledged | bool | Acknowledges that this node is disconnected to allow for mutable requests to proceed. | [default to false]

Return type

AccessPolicyEntity

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateAccessPolicy

AccessPolicyEntity UpdateAccessPolicy(ctx, id).Body(body).Execute()

Updates a access policy

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The access policy id.
    body := *openapiclient.NewAccessPolicyEntity() // AccessPolicyEntity | The access policy configuration details.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.PoliciesApi.UpdateAccessPolicy(context.Background(), id).Body(body).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PoliciesApi.UpdateAccessPolicy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateAccessPolicy`: AccessPolicyEntity
    fmt.Fprintf(os.Stdout, "Response from `PoliciesApi.UpdateAccessPolicy`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The access policy id.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateAccessPolicyRequest struct via the builder pattern

Name Type Description Notes

body | AccessPolicyEntity | The access policy configuration details. |

Return type

AccessPolicyEntity

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]