> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/go/go-bundle/sdks/nfs/api/sharesapi.md).

# SharesApi

All URIs are relative to *<https://nfs.de-fra.ionos.com>*

| Method                                                | HTTP request                                      | Description         |
| ----------------------------------------------------- | ------------------------------------------------- | ------------------- |
| [**ClustersSharesDelete**](#ClustersSharesDelete)     | **Delete** /clusters/{clusterId}/shares/{shareId} | Delete Share        |
| [**ClustersSharesFindById**](#ClustersSharesFindById) | **Get** /clusters/{clusterId}/shares/{shareId}    | Retrieve Share      |
| [**ClustersSharesGet**](#ClustersSharesGet)           | **Get** /clusters/{clusterId}/shares              | Retrieve all Shares |
| [**ClustersSharesPost**](#ClustersSharesPost)         | **Post** /clusters/{clusterId}/shares             | Create Share        |
| [**ClustersSharesPut**](#ClustersSharesPut)           | **Put** /clusters/{clusterId}/shares/{shareId}    | Ensure Share        |

## ClustersSharesDelete

```go
var result  = ClustersSharesDelete(ctx, clusterId, shareId)
                      .Execute()
```

Delete Share

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    nfs "github.com/ionos-cloud/sdk-go-bundle/products/nfs"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    clusterId := "e69b22a5-8fee-56b1-b6fb-4a07e4205ead" // string | The ID (UUID) of the Cluster.
    shareId := "7b1ef56d-dfc6-51fe-aff0-7af2d6747868" // string | The ID (UUID) of the Share.

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := nfs.NewAPIClient(configuration)
    resp, err := apiClient.SharesApi.ClustersSharesDelete(context.Background(), clusterId, shareId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `SharesApi.ClustersSharesDelete``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
}
```

### Path Parameters

| Name          | Type                | Description                                                                 | Notes |
| ------------- | ------------------- | --------------------------------------------------------------------------- | ----- |
| **ctx**       | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. |       |
| **clusterId** | **string**          | The ID (UUID) of the Cluster.                                               |       |
| **shareId**   | **string**          | The ID (UUID) of the Share.                                                 |       |

### Other Parameters

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

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |

### Return type

(empty response body)

### HTTP request headers

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

## ClustersSharesFindById

```go
var result ShareRead = ClustersSharesFindById(ctx, clusterId, shareId)
                      .Execute()
```

Retrieve Share

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    nfs "github.com/ionos-cloud/sdk-go-bundle/products/nfs"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    clusterId := "e69b22a5-8fee-56b1-b6fb-4a07e4205ead" // string | The ID (UUID) of the Cluster.
    shareId := "7b1ef56d-dfc6-51fe-aff0-7af2d6747868" // string | The ID (UUID) of the Share.

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := nfs.NewAPIClient(configuration)
    resource, resp, err := apiClient.SharesApi.ClustersSharesFindById(context.Background(), clusterId, shareId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `SharesApi.ClustersSharesFindById``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `ClustersSharesFindById`: ShareRead
    fmt.Fprintf(os.Stdout, "Response from `SharesApi.ClustersSharesFindById`: %v\n", resource)
}
```

### Path Parameters

| Name          | Type                | Description                                                                 | Notes |
| ------------- | ------------------- | --------------------------------------------------------------------------- | ----- |
| **ctx**       | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. |       |
| **clusterId** | **string**          | The ID (UUID) of the Cluster.                                               |       |
| **shareId**   | **string**          | The ID (UUID) of the Share.                                                 |       |

### Other Parameters

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

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |

### Return type

[**ShareRead**](/cloud/go/go-bundle/sdks/nfs/models/shareread.md)

### HTTP request headers

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

## ClustersSharesGet

```go
var result ShareReadList = ClustersSharesGet(ctx, clusterId)
                      .Offset(offset)
                      .Limit(limit)
                      .Execute()
```

Retrieve all Shares

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    nfs "github.com/ionos-cloud/sdk-go-bundle/products/nfs"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    clusterId := "e69b22a5-8fee-56b1-b6fb-4a07e4205ead" // string | The ID (UUID) of the Cluster.
    offset := int32(0) // int32 | The first element (of the total list of elements) to include in the response. Use this parameter together with the limit for pagination. (optional) (default to 0)
    limit := int32(100) // int32 | The maximum number of elements to return. Use this parameter together with the offset for pagination. (optional) (default to 100)

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := nfs.NewAPIClient(configuration)
    resource, resp, err := apiClient.SharesApi.ClustersSharesGet(context.Background(), clusterId).Offset(offset).Limit(limit).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `SharesApi.ClustersSharesGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `ClustersSharesGet`: ShareReadList
    fmt.Fprintf(os.Stdout, "Response from `SharesApi.ClustersSharesGet`: %v\n", resource)
}
```

### Path Parameters

| Name          | Type                | Description                                                                 | Notes |
| ------------- | ------------------- | --------------------------------------------------------------------------- | ----- |
| **ctx**       | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. |       |
| **clusterId** | **string**          | The ID (UUID) of the Cluster.                                               |       |

### Other Parameters

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

| Name       | Type      | Description                                                                                                                              | Notes             |
| ---------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
| **offset** | **int32** | The first element (of the total list of elements) to include in the response. Use this parameter together with the limit for pagination. | \[default to 0]   |
| **limit**  | **int32** | The maximum number of elements to return. Use this parameter together with the offset for pagination.                                    | \[default to 100] |

### Return type

[**ShareReadList**](/cloud/go/go-bundle/sdks/nfs/models/sharereadlist.md)

### HTTP request headers

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

## ClustersSharesPost

```go
var result ShareRead = ClustersSharesPost(ctx, clusterId)
                      .ShareCreate(shareCreate)
                      .Execute()
```

Create Share

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    nfs "github.com/ionos-cloud/sdk-go-bundle/products/nfs"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    clusterId := "e69b22a5-8fee-56b1-b6fb-4a07e4205ead" // string | The ID (UUID) of the Cluster.
    shareCreate := *openapiclient.NewShareCreate(*openapiclient.NewShare("Share 1", []openapiclient.ShareClientGroups{*openapiclient.NewShareClientGroups()})) // ShareCreate | Share to create.

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := nfs.NewAPIClient(configuration)
    resource, resp, err := apiClient.SharesApi.ClustersSharesPost(context.Background(), clusterId).ShareCreate(shareCreate).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `SharesApi.ClustersSharesPost``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `ClustersSharesPost`: ShareRead
    fmt.Fprintf(os.Stdout, "Response from `SharesApi.ClustersSharesPost`: %v\n", resource)
}
```

### Path Parameters

| Name          | Type                | Description                                                                 | Notes |
| ------------- | ------------------- | --------------------------------------------------------------------------- | ----- |
| **ctx**       | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. |       |
| **clusterId** | **string**          | The ID (UUID) of the Cluster.                                               |       |

### Other Parameters

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

| Name            | Type                                                                  | Description      | Notes |
| --------------- | --------------------------------------------------------------------- | ---------------- | ----- |
| **shareCreate** | [**ShareCreate**](/cloud/go/go-bundle/sdks/nfs/models/sharecreate.md) | Share to create. |       |

### Return type

[**ShareRead**](/cloud/go/go-bundle/sdks/nfs/models/shareread.md)

### HTTP request headers

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

## ClustersSharesPut

```go
var result ShareRead = ClustersSharesPut(ctx, clusterId, shareId)
                      .ShareEnsure(shareEnsure)
                      .Execute()
```

Ensure Share

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    nfs "github.com/ionos-cloud/sdk-go-bundle/products/nfs"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    clusterId := "e69b22a5-8fee-56b1-b6fb-4a07e4205ead" // string | The ID (UUID) of the Cluster.
    shareId := "7b1ef56d-dfc6-51fe-aff0-7af2d6747868" // string | The ID (UUID) of the Share.
    shareEnsure := *openapiclient.NewShareEnsure("7b1ef56d-dfc6-51fe-aff0-7af2d6747868", *openapiclient.NewShare("Share 1", []openapiclient.ShareClientGroups{*openapiclient.NewShareClientGroups()})) // ShareEnsure | update Share

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := nfs.NewAPIClient(configuration)
    resource, resp, err := apiClient.SharesApi.ClustersSharesPut(context.Background(), clusterId, shareId).ShareEnsure(shareEnsure).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `SharesApi.ClustersSharesPut``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `ClustersSharesPut`: ShareRead
    fmt.Fprintf(os.Stdout, "Response from `SharesApi.ClustersSharesPut`: %v\n", resource)
}
```

### Path Parameters

| Name          | Type                | Description                                                                 | Notes |
| ------------- | ------------------- | --------------------------------------------------------------------------- | ----- |
| **ctx**       | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. |       |
| **clusterId** | **string**          | The ID (UUID) of the Cluster.                                               |       |
| **shareId**   | **string**          | The ID (UUID) of the Share.                                                 |       |

### Other Parameters

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

| Name            | Type                                                                  | Description  | Notes |
| --------------- | --------------------------------------------------------------------- | ------------ | ----- |
| **shareEnsure** | [**ShareEnsure**](/cloud/go/go-bundle/sdks/nfs/models/shareensure.md) | update Share |       |

### Return type

[**ShareRead**](/cloud/go/go-bundle/sdks/nfs/models/shareread.md)

### HTTP request headers

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/go/go-bundle/sdks/nfs/api/sharesapi.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
